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/model/api/api_generator.py
ApiGenerator.to_cloudformation
def to_cloudformation(self): """Generates CloudFormation resources from a SAM API resource :returns: a tuple containing the RestApi, Deployment, and Stage for an empty Api. :rtype: tuple """ rest_api = self._construct_rest_api() deployment = self._construct_deployment(rest_api) swagger = None if rest_api.Body is not None: swagger = rest_api.Body elif rest_api.BodyS3Location is not None: swagger = rest_api.BodyS3Location stage = self._construct_stage(deployment, swagger) permissions = self._construct_authorizer_lambda_permission() return rest_api, deployment, stage, permissions
python
def to_cloudformation(self): """Generates CloudFormation resources from a SAM API resource :returns: a tuple containing the RestApi, Deployment, and Stage for an empty Api. :rtype: tuple """ rest_api = self._construct_rest_api() deployment = self._construct_deployment(rest_api) swagger = None if rest_api.Body is not None: swagger = rest_api.Body elif rest_api.BodyS3Location is not None: swagger = rest_api.BodyS3Location stage = self._construct_stage(deployment, swagger) permissions = self._construct_authorizer_lambda_permission() return rest_api, deployment, stage, permissions
[ "def", "to_cloudformation", "(", "self", ")", ":", "rest_api", "=", "self", ".", "_construct_rest_api", "(", ")", "deployment", "=", "self", ".", "_construct_deployment", "(", "rest_api", ")", "swagger", "=", "None", "if", "rest_api", ".", "Body", "is", "not", "None", ":", "swagger", "=", "rest_api", ".", "Body", "elif", "rest_api", ".", "BodyS3Location", "is", "not", "None", ":", "swagger", "=", "rest_api", ".", "BodyS3Location", "stage", "=", "self", ".", "_construct_stage", "(", "deployment", ",", "swagger", ")", "permissions", "=", "self", ".", "_construct_authorizer_lambda_permission", "(", ")", "return", "rest_api", ",", "deployment", ",", "stage", ",", "permissions" ]
Generates CloudFormation resources from a SAM API resource :returns: a tuple containing the RestApi, Deployment, and Stage for an empty Api. :rtype: tuple
[ "Generates", "CloudFormation", "resources", "from", "a", "SAM", "API", "resource" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/api/api_generator.py#L184-L203
train
Generates a CloudFormation resource from a SAM API 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_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,c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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(337 - 289) + chr(11525 - 11414) + chr(0b11101 + 0o25) + chr(937 - 886) + '\065', 16154 - 16146), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b10001 + 0o46) + chr(2387 - 2338), 29633 - 29625), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(9985 - 9874) + chr(452 - 397) + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010 + 0o1) + chr(114 - 59) + '\067', 0b1000), ehT0Px3KOsy9('\060' + chr(0b110011 + 0o74) + chr(0b1010 + 0o50) + chr(0b110101) + '\x33', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101110 + 0o4) + '\x32' + '\063', 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + '\061' + chr(54) + '\063', 0o10), ehT0Px3KOsy9(chr(1745 - 1697) + chr(0b1101110 + 0o1) + chr(341 - 290) + '\x31', 33162 - 33154), ehT0Px3KOsy9(chr(905 - 857) + chr(111) + '\061' + '\061' + '\x35', 0o10), ehT0Px3KOsy9(chr(452 - 404) + chr(0b101 + 0o152) + chr(867 - 817) + chr(930 - 875), 54103 - 54095), ehT0Px3KOsy9('\060' + chr(9988 - 9877) + chr(0b110001) + chr(0b110100 + 0o3) + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\063' + '\x35' + chr(0b1001 + 0o47), 22648 - 22640), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + '\x30' + '\x35', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b10010 + 0o135) + chr(404 - 355) + '\x37' + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(0b100001 + 0o26) + chr(1284 - 1233), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9128 - 9017) + chr(0b10101 + 0o34) + chr(0b110011) + chr(0b110001), 37868 - 37860), ehT0Px3KOsy9(chr(466 - 418) + '\157' + chr(1974 - 1923) + chr(0b11010 + 0o26) + chr(51), 27849 - 27841), ehT0Px3KOsy9(chr(0b110000) + chr(3425 - 3314) + chr(999 - 950) + chr(96 - 42) + chr(55), 26168 - 26160), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + '\065' + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100011 + 0o16) + chr(51) + chr(225 - 173), ord("\x08")), ehT0Px3KOsy9(chr(1023 - 975) + '\157' + chr(0b110001) + '\061' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + '\060' + chr(1467 - 1415), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(49) + '\x33' + '\x36', 0b1000), ehT0Px3KOsy9(chr(1292 - 1244) + chr(111) + chr(0b11101 + 0o25) + chr(1673 - 1624), 61561 - 61553), ehT0Px3KOsy9('\x30' + '\x6f' + chr(614 - 565) + chr(0b110101) + chr(0b1110 + 0o51), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(288 - 240) + chr(0b1110 + 0o42), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2196 - 2148), 48112 - 48104), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x37' + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + chr(0b110001) + '\x30', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(1897 - 1847) + chr(0b110101) + chr(0b101100 + 0o6), 0b1000), ehT0Px3KOsy9('\060' + chr(10000 - 9889) + chr(2446 - 2396) + chr(0b1110 + 0o43) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(2501 - 2446) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(1968 - 1920) + chr(0b1 + 0o156) + chr(0b110010) + '\x30' + '\x35', 18049 - 18041), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2362 - 2312) + '\064' + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x36' + chr(0b110010), 28446 - 28438), ehT0Px3KOsy9(chr(48) + chr(0b1010000 + 0o37) + chr(0b11101 + 0o24) + chr(0b1010 + 0o46) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b100000 + 0o117) + chr(388 - 338) + chr(0b110001) + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + '\x35' + chr(0b1100 + 0o44), 35241 - 35233), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(1640 - 1529) + '\062' + chr(2839 - 2785) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(6325 - 6214) + '\x37' + chr(1775 - 1726), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110101) + chr(0b1011 + 0o45), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb3'), chr(4104 - 4004) + chr(0b1011100 + 0o11) + chr(9576 - 9477) + chr(111) + chr(3451 - 3351) + chr(0b1001100 + 0o31))(chr(4284 - 4167) + '\164' + '\146' + chr(0b101101) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def NpIm0Ph3ybvM(oVre8I6UXc3b): zxUfyoBahbWI = oVre8I6UXc3b._construct_rest_api() Gh86J6oCA0R0 = oVre8I6UXc3b._construct_deployment(zxUfyoBahbWI) vKQLfCidaf7H = None if xafqLlk3kkUe(zxUfyoBahbWI, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc2\x1fm\xb3\xc2\xd0+A?r\x0e\x89'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(101))(chr(0b1110101) + '\164' + chr(0b101100 + 0o72) + '\x2d' + '\x38')) is not None: vKQLfCidaf7H = zxUfyoBahbWI._fQLiCXXrepa elif xafqLlk3kkUe(zxUfyoBahbWI, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd4\x01M\xba\xff\xd4\x1fR\x18A\x19\x83'), '\x64' + chr(0b111010 + 0o53) + chr(8539 - 8440) + chr(0b100 + 0o153) + chr(100) + '\145')('\165' + chr(116) + chr(0b1000110 + 0o40) + '\055' + chr(0b111000 + 0o0))) is not None: vKQLfCidaf7H = zxUfyoBahbWI.IxqETGlKUVgk VRrhsVxQMv59 = oVre8I6UXc3b._construct_stage(Gh86J6oCA0R0, vKQLfCidaf7H) Rm5AxuvmuBEr = oVre8I6UXc3b._construct_authorizer_lambda_permission() return (zxUfyoBahbWI, Gh86J6oCA0R0, VRrhsVxQMv59, Rm5AxuvmuBEr)
awslabs/serverless-application-model
samtranslator/model/api/api_generator.py
ApiGenerator._add_cors
def _add_cors(self): """ Add CORS configuration to the Swagger file, if necessary """ INVALID_ERROR = "Invalid value for 'Cors' property" if not self.cors: return if self.cors and not self.definition_body: raise InvalidResourceException(self.logical_id, "Cors works only with inline Swagger specified in " "'DefinitionBody' property") if isinstance(self.cors, string_types) or is_instrinsic(self.cors): # Just set Origin property. Others will be defaults properties = CorsProperties(AllowOrigin=self.cors) elif isinstance(self.cors, dict): # Make sure keys in the dict are recognized if not all(key in CorsProperties._fields for key in self.cors.keys()): raise InvalidResourceException(self.logical_id, INVALID_ERROR) properties = CorsProperties(**self.cors) else: raise InvalidResourceException(self.logical_id, INVALID_ERROR) if not SwaggerEditor.is_valid(self.definition_body): raise InvalidResourceException(self.logical_id, "Unable to add Cors configuration because " "'DefinitionBody' does not contain a valid Swagger") if properties.AllowCredentials is True and properties.AllowOrigin == _CORS_WILDCARD: raise InvalidResourceException(self.logical_id, "Unable to add Cors configuration because " "'AllowCredentials' can not be true when " "'AllowOrigin' is \"'*'\" or not set") editor = SwaggerEditor(self.definition_body) for path in editor.iter_on_path(): editor.add_cors(path, properties.AllowOrigin, properties.AllowHeaders, properties.AllowMethods, max_age=properties.MaxAge, allow_credentials=properties.AllowCredentials) # Assign the Swagger back to template self.definition_body = editor.swagger
python
def _add_cors(self): """ Add CORS configuration to the Swagger file, if necessary """ INVALID_ERROR = "Invalid value for 'Cors' property" if not self.cors: return if self.cors and not self.definition_body: raise InvalidResourceException(self.logical_id, "Cors works only with inline Swagger specified in " "'DefinitionBody' property") if isinstance(self.cors, string_types) or is_instrinsic(self.cors): # Just set Origin property. Others will be defaults properties = CorsProperties(AllowOrigin=self.cors) elif isinstance(self.cors, dict): # Make sure keys in the dict are recognized if not all(key in CorsProperties._fields for key in self.cors.keys()): raise InvalidResourceException(self.logical_id, INVALID_ERROR) properties = CorsProperties(**self.cors) else: raise InvalidResourceException(self.logical_id, INVALID_ERROR) if not SwaggerEditor.is_valid(self.definition_body): raise InvalidResourceException(self.logical_id, "Unable to add Cors configuration because " "'DefinitionBody' does not contain a valid Swagger") if properties.AllowCredentials is True and properties.AllowOrigin == _CORS_WILDCARD: raise InvalidResourceException(self.logical_id, "Unable to add Cors configuration because " "'AllowCredentials' can not be true when " "'AllowOrigin' is \"'*'\" or not set") editor = SwaggerEditor(self.definition_body) for path in editor.iter_on_path(): editor.add_cors(path, properties.AllowOrigin, properties.AllowHeaders, properties.AllowMethods, max_age=properties.MaxAge, allow_credentials=properties.AllowCredentials) # Assign the Swagger back to template self.definition_body = editor.swagger
[ "def", "_add_cors", "(", "self", ")", ":", "INVALID_ERROR", "=", "\"Invalid value for 'Cors' property\"", "if", "not", "self", ".", "cors", ":", "return", "if", "self", ".", "cors", "and", "not", "self", ".", "definition_body", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"Cors works only with inline Swagger specified in \"", "\"'DefinitionBody' property\"", ")", "if", "isinstance", "(", "self", ".", "cors", ",", "string_types", ")", "or", "is_instrinsic", "(", "self", ".", "cors", ")", ":", "# Just set Origin property. Others will be defaults", "properties", "=", "CorsProperties", "(", "AllowOrigin", "=", "self", ".", "cors", ")", "elif", "isinstance", "(", "self", ".", "cors", ",", "dict", ")", ":", "# Make sure keys in the dict are recognized", "if", "not", "all", "(", "key", "in", "CorsProperties", ".", "_fields", "for", "key", "in", "self", ".", "cors", ".", "keys", "(", ")", ")", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "INVALID_ERROR", ")", "properties", "=", "CorsProperties", "(", "*", "*", "self", ".", "cors", ")", "else", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "INVALID_ERROR", ")", "if", "not", "SwaggerEditor", ".", "is_valid", "(", "self", ".", "definition_body", ")", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"Unable to add Cors configuration because \"", "\"'DefinitionBody' does not contain a valid Swagger\"", ")", "if", "properties", ".", "AllowCredentials", "is", "True", "and", "properties", ".", "AllowOrigin", "==", "_CORS_WILDCARD", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"Unable to add Cors configuration because \"", "\"'AllowCredentials' can not be true when \"", "\"'AllowOrigin' is \\\"'*'\\\" or not set\"", ")", "editor", "=", "SwaggerEditor", "(", "self", ".", "definition_body", ")", "for", "path", "in", "editor", ".", "iter_on_path", "(", ")", ":", "editor", ".", "add_cors", "(", "path", ",", "properties", ".", "AllowOrigin", ",", "properties", ".", "AllowHeaders", ",", "properties", ".", "AllowMethods", ",", "max_age", "=", "properties", ".", "MaxAge", ",", "allow_credentials", "=", "properties", ".", "AllowCredentials", ")", "# Assign the Swagger back to template", "self", ".", "definition_body", "=", "editor", ".", "swagger" ]
Add CORS configuration to the Swagger file, if necessary
[ "Add", "CORS", "configuration", "to", "the", "Swagger", "file", "if", "necessary" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/api/api_generator.py#L205-L249
train
Add CORS configuration to the Swagger file 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,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9Z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0,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(778 - 730) + '\157' + '\061' + '\063' + chr(0b110011), 61711 - 61703), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1001 + 0o53), 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b10011 + 0o134) + chr(0b10111 + 0o33) + chr(1919 - 1869) + chr(1384 - 1330), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x35' + chr(509 - 457), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(0b110010) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(55) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(49) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4263 - 4152) + chr(51) + '\065' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101011 + 0o10) + chr(1050 - 1001) + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(0b100 + 0o55) + chr(0b1001 + 0o50), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(0b110100) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1 + 0o156) + chr(0b110011) + chr(49) + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + chr(51) + '\063' + chr(161 - 110), ord("\x08")), ehT0Px3KOsy9(chr(2054 - 2006) + chr(0b1101111) + '\x32' + chr(53) + chr(0b11011 + 0o26), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(180 - 128) + '\x31', 47124 - 47116), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(8780 - 8669) + chr(0b110011) + chr(0b1000 + 0o50) + chr(683 - 630), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b1 + 0o60) + '\x35', 65105 - 65097), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(49) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101 + 0o54) + chr(53) + chr(48), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b100111 + 0o14) + chr(0b110001) + chr(0b101111 + 0o3), 0b1000), ehT0Px3KOsy9(chr(224 - 176) + chr(0b1000100 + 0o53) + chr(50) + '\x32' + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(0b110000) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b10100 + 0o40) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + chr(212 - 164) + chr(1001 - 952), 51913 - 51905), ehT0Px3KOsy9('\x30' + chr(9424 - 9313) + chr(50) + '\x34' + '\x35', 8), ehT0Px3KOsy9(chr(1724 - 1676) + '\x6f' + '\x32' + chr(52) + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(2238 - 2127) + chr(1714 - 1663) + chr(0b110111) + '\060', 58091 - 58083), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1472 - 1421) + '\060' + '\065', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(54) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(48) + '\062', 42700 - 42692), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(0b110100) + chr(0b110100), 8), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\157' + '\063' + chr(53) + chr(532 - 484), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b10110 + 0o131) + '\063' + chr(1245 - 1191) + chr(0b11 + 0o57), 0o10), ehT0Px3KOsy9(chr(1384 - 1336) + '\157' + chr(49) + chr(0b110101) + chr(0b101010 + 0o10), 0b1000), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\157' + '\x33' + chr(1851 - 1802) + '\061', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + '\x33' + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(1310 - 1259) + '\060', 0o10), ehT0Px3KOsy9(chr(1309 - 1261) + chr(0b1101111) + '\x32' + chr(0b11010 + 0o26) + chr(0b11010 + 0o26), 0b1000), ehT0Px3KOsy9(chr(922 - 874) + chr(0b1001001 + 0o46) + chr(0b100101 + 0o14) + chr(0b110100) + '\063', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\065' + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'u'), chr(0b1010101 + 0o17) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(9796 - 9695))('\165' + '\x74' + chr(6248 - 6146) + chr(45) + chr(0b11010 + 0o36)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def qBC1F3vzZJmW(oVre8I6UXc3b): _WQZ4uOg5DaZ = xafqLlk3kkUe(SXOLrMavuUCe(b'\x12j\xe0M8\x90\xed\xcb\xba\xe8\x08\xbcm\xfb\xcfN\xb7m\xe9+\xa5\xe3\xb7\x82a\xd5\xd4\x97\xb5\x91\xb0\x10\x91'), chr(0b10011 + 0o121) + chr(101) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(0b101111 + 0o66))(chr(361 - 244) + '\x74' + chr(0b1100110) + chr(1777 - 1732) + '\x38') if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'8k\xe4_'), '\144' + chr(7257 - 7156) + chr(7582 - 7483) + chr(0b1101111) + '\x64' + chr(4425 - 4324))(chr(0b1110101) + chr(116) + '\146' + chr(1920 - 1875) + '\070')): return if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'8k\xe4_'), '\x64' + '\145' + chr(99) + chr(0b1101111) + chr(0b1001 + 0o133) + chr(0b1100 + 0o131))(chr(117) + '\x74' + '\x66' + chr(1423 - 1378) + '\x38')) and (not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'?a\xf0E:\x90\xfd\x82\xa3\xe7;\xabg\xbf\xd0'), chr(0b1100100) + chr(1608 - 1507) + '\x63' + '\157' + chr(296 - 196) + '\145')('\x75' + chr(1970 - 1854) + '\x66' + chr(0b10111 + 0o26) + '\x38'))): raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x15t\xcc^b\xcf\xc4\x8f\x8e\xe12\x8e'), chr(0b10110 + 0o116) + '\x65' + chr(0b1100011) + chr(0b1101101 + 0o2) + chr(0b1110 + 0o126) + chr(3726 - 3625))(chr(0b1110101) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x18k\xe4_t\x8e\xe6\x99\xa7\xfaD\xa6f\xb7\xd0\x01\xb2$\xba\x00\xea\xf8\xaa\xc9(\xcb\xc3\xd8\x96\x83\xa3\x03\x8f\x97\x18\xe9\xef\xe8\xe5\x002b\xffI0\xd9\xe0\x85\xec\xae \xacn\xb2\xc7H\xb1$\xa1\x06\x88\xfe\xa0\xdcf\x85\xd6\x8a\xaa\x84\xa7\x16\x9c\x8b'), '\144' + '\145' + chr(99) + '\x6f' + chr(100) + chr(0b1001100 + 0o31))(chr(117) + chr(3156 - 3040) + chr(0b1100110) + chr(1024 - 979) + chr(2724 - 2668))) if PlSM16l2KDPD(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'8k\xe4_'), chr(100) + chr(0b100101 + 0o100) + chr(8778 - 8679) + chr(111) + chr(1458 - 1358) + chr(0b100 + 0o141))('\x75' + chr(0b1011000 + 0o34) + chr(0b110111 + 0o57) + chr(45) + '\x38')), sInLJQno9SRQ) or cZ3QUDmab4zH(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'8k\xe4_'), chr(100) + chr(5685 - 5584) + chr(99) + '\157' + chr(0b1100100) + '\145')(chr(12176 - 12059) + chr(116) + '\146' + chr(1379 - 1334) + '\070'))): o4Mv82sLmOP8 = LKdJOZTW1olL(AllowOrigin=oVre8I6UXc3b.cors) elif PlSM16l2KDPD(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'8k\xe4_'), '\x64' + '\x65' + '\x63' + '\x6f' + chr(0b11101 + 0o107) + chr(8951 - 8850))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(0b1111 + 0o36) + chr(0b111000))), wLqBDw8l0eIm): if not Dl48nj1rbi23((K3J4ZwSlE0sT in xafqLlk3kkUe(LKdJOZTW1olL, xafqLlk3kkUe(SXOLrMavuUCe(b'\x04b\xffI8\x9d\xfa'), chr(0b10011 + 0o121) + chr(101) + chr(99) + '\157' + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(11087 - 10971) + '\x66' + chr(0b100 + 0o51) + chr(56))) for K3J4ZwSlE0sT in xafqLlk3kkUe(oVre8I6UXc3b.cors, xafqLlk3kkUe(SXOLrMavuUCe(b'0a\xef_'), '\x64' + '\145' + '\143' + chr(2097 - 1986) + chr(100) + chr(0b0 + 0o145))(chr(117) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(0b111000)))())): raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x15t\xcc^b\xcf\xc4\x8f\x8e\xe12\x8e'), chr(0b1100100) + chr(101) + '\x63' + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(117) + chr(0b11111 + 0o125) + chr(0b11101 + 0o111) + '\x2d' + chr(0b111000))), _WQZ4uOg5DaZ) o4Mv82sLmOP8 = LKdJOZTW1olL(**oVre8I6UXc3b.cors) else: raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x15t\xcc^b\xcf\xc4\x8f\x8e\xe12\x8e'), '\x64' + '\145' + chr(0b1100011) + '\157' + chr(100) + '\x65')(chr(4537 - 4420) + '\x74' + '\146' + '\x2d' + chr(1056 - 1000))), _WQZ4uOg5DaZ) if not xafqLlk3kkUe(IX7SCU7eVrph, xafqLlk3kkUe(SXOLrMavuUCe(b'2w\xc9Z5\x95\xe0\x8f'), '\x64' + chr(3038 - 2937) + chr(8269 - 8170) + chr(111) + chr(1805 - 1705) + chr(0b1100101))(chr(117) + '\x74' + chr(102) + chr(0b101101) + '\070'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'?a\xf0E:\x90\xfd\x82\xa3\xe7;\xabg\xbf\xd0'), chr(0b1100100) + chr(1067 - 966) + '\143' + '\x6f' + chr(100) + chr(0b111111 + 0o46))('\165' + chr(8309 - 8193) + chr(0b111001 + 0o55) + chr(0b101101) + chr(0b111000)))): raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x15t\xcc^b\xcf\xc4\x8f\x8e\xe12\x8e'), chr(100) + chr(0b1000111 + 0o36) + chr(99) + chr(111) + chr(0b1100100) + '\x65')(chr(0b1100 + 0o151) + chr(9910 - 9794) + chr(102) + '\x2d' + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\x0ej\xf7N8\x9c\xa9\x9f\xa3\xa9\x05\xadl\xfb\xeaN\xb7>\xee\x0b\xa5\xff\xa2\xcc&\xd0\xd4\x99\xb1\x9d\xad\n\xc8\x90\x0f\xaa\xfd\xed\xf3\x06{#\xd2I2\x90\xe7\x82\xb8\xe0\x0b\xa7J\xb4\xcdX\xe2m\xaa\x07\xaf\xe2\xe4\xcb.\xd1\x86\x9b\xaa\x9a\xb6\x05\x81\x9cJ\xa8\xbc\xee\xe1\x0f2`\xb6\x7f#\x98\xee\x8c\xa9\xfb'), chr(8891 - 8791) + chr(0b1010101 + 0o20) + chr(0b1100011) + chr(0b1001001 + 0o46) + '\x64' + chr(3041 - 2940))('\165' + '\164' + '\146' + chr(0b101101) + '\x38')) if xafqLlk3kkUe(o4Mv82sLmOP8, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1ah\xfaC#\xba\xfb\x8e\xa8\xec\n\xbda\xba\xc5R'), chr(0b1001001 + 0o33) + chr(0b1100101) + '\143' + chr(111) + '\x64' + chr(0b100101 + 0o100))(chr(0b1110101) + chr(116) + '\x66' + chr(0b1000 + 0o45) + chr(0b110101 + 0o3))) is ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001), 0b1000) and xafqLlk3kkUe(o4Mv82sLmOP8, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1ah\xfaC#\xb6\xfb\x82\xab\xe0\n'), '\144' + chr(4976 - 4875) + chr(0b1000101 + 0o36) + chr(0b1100101 + 0o12) + '\x64' + chr(101))('\x75' + chr(0b1110100) + '\x66' + chr(0b100000 + 0o15) + '\x38')) == ahYV7HQRB2C6: raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x15t\xcc^b\xcf\xc4\x8f\x8e\xe12\x8e'), '\144' + chr(6169 - 6068) + chr(99) + '\157' + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(0b1011 + 0o133) + chr(0b10111 + 0o26) + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x0ej\xf7N8\x9c\xa9\x9f\xa3\xa9\x05\xadl\xfb\xeaN\xb7>\xee\x0b\xa5\xff\xa2\xcc&\xd0\xd4\x99\xb1\x9d\xad\n\xc8\x90\x0f\xaa\xfd\xed\xf3\x06{#\xd7@8\x96\xfe\xa8\xbe\xec\x00\xacf\xaf\xc0@\xa9>\xe9H\xa9\xf0\xaa\x85/\xca\xd2\xd8\xa7\x91\xe2\x10\x9a\x87\x0f\xe9\xeb\xf0\xe5\r{#\xd7@8\x96\xfe\xa4\xbe\xe0\x03\xa0f\xfc\x89H\xb6m\xecO\xe0\xb6\xe6\x85.\xd7\x86\x96\xaa\x80\xe2\x17\x8d\x86'), chr(0b1100100) + chr(5953 - 5852) + chr(6521 - 6422) + '\157' + chr(100) + chr(101))(chr(0b1110101) + chr(188 - 72) + chr(102) + chr(45) + '\x38')) QP6wN7VyBwGk = IX7SCU7eVrph(oVre8I6UXc3b.definition_body) for EaCjyhZptSer in xafqLlk3kkUe(QP6wN7VyBwGk, xafqLlk3kkUe(SXOLrMavuUCe(b'2p\xf3^\x0b\x96\xe7\xb4\xbc\xe8\x10\xa1'), chr(100) + '\145' + '\143' + '\x6f' + chr(0b1100100) + chr(101))('\x75' + chr(0b1011101 + 0o27) + chr(6715 - 6613) + chr(45) + chr(0b100100 + 0o24)))(): xafqLlk3kkUe(QP6wN7VyBwGk, xafqLlk3kkUe(SXOLrMavuUCe(b':`\xf2s7\x96\xfb\x98'), chr(100) + chr(0b1100101) + '\143' + chr(1828 - 1717) + '\144' + chr(0b101110 + 0o67))(chr(0b1010 + 0o153) + '\x74' + chr(2774 - 2672) + '\055' + '\070'))(EaCjyhZptSer, xafqLlk3kkUe(o4Mv82sLmOP8, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1ah\xfaC#\xb6\xfb\x82\xab\xe0\n'), chr(0b1100100) + '\145' + '\143' + '\157' + chr(100) + chr(101))(chr(0b1001110 + 0o47) + chr(8565 - 8449) + chr(102) + '\x2d' + '\x38')), xafqLlk3kkUe(o4Mv82sLmOP8, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1ah\xfaC#\xb1\xec\x8a\xa8\xec\x16\xba'), chr(0b1100100) + '\145' + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(10728 - 10611) + chr(0b1010110 + 0o36) + '\146' + chr(0b101011 + 0o2) + chr(2709 - 2653))), xafqLlk3kkUe(o4Mv82sLmOP8, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1ah\xfaC#\xb4\xec\x9f\xa4\xe6\x00\xba'), chr(0b111100 + 0o50) + '\145' + '\143' + chr(0b1000011 + 0o54) + '\144' + chr(101))('\165' + chr(116) + chr(8856 - 8754) + chr(1778 - 1733) + '\x38')), max_age=xafqLlk3kkUe(o4Mv82sLmOP8, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16e\xeem3\x9c'), chr(0b1100100) + chr(101) + '\x63' + chr(0b110 + 0o151) + chr(6973 - 6873) + chr(101))(chr(117) + '\164' + chr(0b1010101 + 0o21) + chr(0b101101) + chr(467 - 411))), allow_credentials=xafqLlk3kkUe(o4Mv82sLmOP8, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1ah\xfaC#\xba\xfb\x8e\xa8\xec\n\xbda\xba\xc5R'), '\144' + chr(0b101100 + 0o71) + '\143' + chr(0b100000 + 0o117) + chr(8747 - 8647) + chr(0b1100101))(chr(11545 - 11428) + chr(116) + '\x66' + '\055' + '\x38'))) oVre8I6UXc3b.Lb6zibIDkMHn = QP6wN7VyBwGk.swagger
awslabs/serverless-application-model
samtranslator/model/api/api_generator.py
ApiGenerator._add_auth
def _add_auth(self): """ Add Auth configuration to the Swagger file, if necessary """ if not self.auth: return if self.auth and not self.definition_body: raise InvalidResourceException(self.logical_id, "Auth works only with inline Swagger specified in " "'DefinitionBody' property") # Make sure keys in the dict are recognized if not all(key in AuthProperties._fields for key in self.auth.keys()): raise InvalidResourceException( self.logical_id, "Invalid value for 'Auth' property") if not SwaggerEditor.is_valid(self.definition_body): raise InvalidResourceException(self.logical_id, "Unable to add Auth configuration because " "'DefinitionBody' does not contain a valid Swagger") swagger_editor = SwaggerEditor(self.definition_body) auth_properties = AuthProperties(**self.auth) authorizers = self._get_authorizers(auth_properties.Authorizers, auth_properties.DefaultAuthorizer) if authorizers: swagger_editor.add_authorizers(authorizers) self._set_default_authorizer(swagger_editor, authorizers, auth_properties.DefaultAuthorizer) # Assign the Swagger back to template self.definition_body = swagger_editor.swagger
python
def _add_auth(self): """ Add Auth configuration to the Swagger file, if necessary """ if not self.auth: return if self.auth and not self.definition_body: raise InvalidResourceException(self.logical_id, "Auth works only with inline Swagger specified in " "'DefinitionBody' property") # Make sure keys in the dict are recognized if not all(key in AuthProperties._fields for key in self.auth.keys()): raise InvalidResourceException( self.logical_id, "Invalid value for 'Auth' property") if not SwaggerEditor.is_valid(self.definition_body): raise InvalidResourceException(self.logical_id, "Unable to add Auth configuration because " "'DefinitionBody' does not contain a valid Swagger") swagger_editor = SwaggerEditor(self.definition_body) auth_properties = AuthProperties(**self.auth) authorizers = self._get_authorizers(auth_properties.Authorizers, auth_properties.DefaultAuthorizer) if authorizers: swagger_editor.add_authorizers(authorizers) self._set_default_authorizer(swagger_editor, authorizers, auth_properties.DefaultAuthorizer) # Assign the Swagger back to template self.definition_body = swagger_editor.swagger
[ "def", "_add_auth", "(", "self", ")", ":", "if", "not", "self", ".", "auth", ":", "return", "if", "self", ".", "auth", "and", "not", "self", ".", "definition_body", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"Auth works only with inline Swagger specified in \"", "\"'DefinitionBody' property\"", ")", "# Make sure keys in the dict are recognized", "if", "not", "all", "(", "key", "in", "AuthProperties", ".", "_fields", "for", "key", "in", "self", ".", "auth", ".", "keys", "(", ")", ")", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"Invalid value for 'Auth' property\"", ")", "if", "not", "SwaggerEditor", ".", "is_valid", "(", "self", ".", "definition_body", ")", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"Unable to add Auth configuration because \"", "\"'DefinitionBody' does not contain a valid Swagger\"", ")", "swagger_editor", "=", "SwaggerEditor", "(", "self", ".", "definition_body", ")", "auth_properties", "=", "AuthProperties", "(", "*", "*", "self", ".", "auth", ")", "authorizers", "=", "self", ".", "_get_authorizers", "(", "auth_properties", ".", "Authorizers", ",", "auth_properties", ".", "DefaultAuthorizer", ")", "if", "authorizers", ":", "swagger_editor", ".", "add_authorizers", "(", "authorizers", ")", "self", ".", "_set_default_authorizer", "(", "swagger_editor", ",", "authorizers", ",", "auth_properties", ".", "DefaultAuthorizer", ")", "# Assign the Swagger back to template", "self", ".", "definition_body", "=", "swagger_editor", ".", "swagger" ]
Add Auth configuration to the Swagger file, if necessary
[ "Add", "Auth", "configuration", "to", "the", "Swagger", "file", "if", "necessary" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/api/api_generator.py#L251-L281
train
Add Auth configuration to the Swagger file 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,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y9,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(726 - 675) + chr(0b110001) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(51) + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(2187 - 2076) + chr(0b110001) + '\062' + chr(287 - 234), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2491 - 2440) + '\061' + chr(0b11010 + 0o26), 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(5734 - 5623) + '\x32' + chr(332 - 283), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1718 - 1667) + chr(55) + '\x33', 29693 - 29685), ehT0Px3KOsy9(chr(48) + chr(111) + chr(393 - 343) + chr(54) + '\x31', 53493 - 53485), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + chr(0b110010) + chr(0b110101 + 0o0) + chr(0b101101 + 0o4), 0o10), ehT0Px3KOsy9(chr(1822 - 1774) + chr(0b1101111) + '\063' + chr(0b110011) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(1808 - 1759) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(0b110001) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + '\062' + chr(0b10110 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(1396 - 1347) + '\x31' + chr(3021 - 2966), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33', 37464 - 37456), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\x6f' + chr(0b1011 + 0o47) + chr(1286 - 1232) + chr(0b101011 + 0o14), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101011 + 0o4) + chr(2154 - 2103) + chr(631 - 576) + chr(378 - 326), 7219 - 7211), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + chr(2525 - 2474) + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + chr(11835 - 11724) + chr(49) + '\x30' + chr(50), 54269 - 54261), ehT0Px3KOsy9(chr(0b110000) + chr(0b11100 + 0o123) + '\x34' + chr(2756 - 2703), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b11110 + 0o23) + '\062' + '\x35', 8), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(55) + '\067', 18042 - 18034), ehT0Px3KOsy9('\x30' + chr(111) + chr(1016 - 967) + '\063' + chr(0b110001 + 0o0), 22766 - 22758), ehT0Px3KOsy9('\x30' + chr(6975 - 6864) + '\062' + chr(802 - 748) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(624 - 576) + '\x6f' + chr(2085 - 2034) + chr(560 - 505) + '\x33', 8), ehT0Px3KOsy9(chr(780 - 732) + '\x6f' + chr(49) + chr(52) + chr(0b1001 + 0o55), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(0b110100) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(10774 - 10663) + chr(49) + chr(49) + chr(54), 0o10), ehT0Px3KOsy9(chr(487 - 439) + chr(111) + '\061' + '\x31' + chr(0b1000 + 0o52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\065' + chr(0b110 + 0o60), 7440 - 7432), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(2090 - 2040) + chr(2266 - 2217), 0o10), ehT0Px3KOsy9(chr(1017 - 969) + chr(0b1 + 0o156) + chr(0b101101 + 0o5) + chr(55) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(49) + '\062', 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(0b110110) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\157' + '\x33' + chr(0b110000) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + '\x33' + chr(0b101110 + 0o2), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(0b110001 + 0o4) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + '\063' + chr(0b110000) + chr(1599 - 1546), 0o10), ehT0Px3KOsy9('\060' + chr(0b1100111 + 0o10) + '\x31' + chr(0b110000) + '\x30', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100 + 0o61) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0'), chr(0b10001 + 0o123) + '\145' + chr(99) + chr(11313 - 11202) + '\144' + chr(1958 - 1857))('\165' + '\x74' + chr(1628 - 1526) + chr(0b101101) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ZMcM3IlAGeIK(oVre8I6UXc3b): if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaf)!\xa0'), chr(100) + '\145' + chr(0b1001100 + 0o27) + '\157' + chr(0b11000 + 0o114) + chr(0b1001011 + 0o32))(chr(117) + chr(0b1110100) + '\146' + '\x2d' + '\070')): return if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaf)!\xa0'), chr(0b1100100) + chr(101) + chr(0b1011111 + 0o4) + '\157' + '\x64' + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(6253 - 6151) + chr(0b10000 + 0o35) + chr(56))) and (not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82>c\xb2x\x99\xf8\xed\xb3\xc7\xc4|'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(3881 - 3781) + '\x65')(chr(186 - 69) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + '\x38'))): raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b"\x80,\x0f\xba'\xcd\xfc\xcd\x9a\xe2\xdaU"), chr(6434 - 6334) + chr(101) + '\x63' + chr(111) + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(116) + chr(102) + '\055' + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\x8f)!\xa01\x8c\xde\xdb\xb3\xf9\xac}y#z\x97\x8b\xf46Mu\xd67\xd9\x92\x08\x05n\x19Y0\xdd\xed\x11}\xe1\xeb\x1f\xa0#\xa7:<\xadu\xdb\xd8\xc7\xf8\xad\xc8wq&m\xde\x88\xf4-K\x17\xd0=\xcc\xdcF\x10<%^4\xc8\xfe\r'), chr(0b10010 + 0o122) + '\x65' + '\x63' + chr(0b11001 + 0o126) + chr(0b1011000 + 0o14) + chr(0b101010 + 0o73))(chr(0b1110101) + chr(116) + '\x66' + chr(0b1001 + 0o44) + chr(1040 - 984))) if not Dl48nj1rbi23((K3J4ZwSlE0sT in xafqLlk3kkUe(e9YLbhvyBiVu, xafqLlk3kkUe(SXOLrMavuUCe(b'\x91:<\xad}\x9f\xc2'), '\144' + '\145' + '\x63' + chr(0b1101111) + '\144' + chr(0b11101 + 0o110))('\x75' + chr(0b1001100 + 0o50) + chr(0b1100110) + '\x2d' + chr(56))) for K3J4ZwSlE0sT in xafqLlk3kkUe(oVre8I6UXc3b.auth, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa59,\xbb'), chr(100) + chr(0b111101 + 0o50) + '\143' + '\x6f' + chr(2617 - 2517) + chr(101))(chr(1480 - 1363) + chr(0b1010000 + 0o44) + chr(5983 - 5881) + chr(0b101101) + chr(0b1011 + 0o55)))())): raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b"\x80,\x0f\xba'\xcd\xfc\xcd\x9a\xe2\xdaU"), '\144' + chr(0b1010 + 0o133) + chr(0b1100011) + '\157' + chr(0b1101 + 0o127) + chr(101))('\165' + chr(0b1110100) + chr(0b1001101 + 0o31) + chr(0b101 + 0o50) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'\x872#\xa9}\x92\xd5\x89\xae\xeb\xe0groe\xd8\x8e\xbded \xcb1\x92\xdb\x16\x12!:K#\xce\xf3'), chr(0b1100100) + chr(0b1000110 + 0o37) + '\143' + chr(0b1101111) + chr(100) + chr(0b10011 + 0o122))(chr(117) + '\x74' + chr(0b1001011 + 0o33) + chr(319 - 274) + '\x38')) if not xafqLlk3kkUe(IX7SCU7eVrph, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7/\n\xbep\x97\xd8\xcd'), chr(6043 - 5943) + '\x65' + '\143' + '\x6f' + '\x64' + chr(9077 - 8976))('\x75' + chr(2181 - 2065) + chr(102) + '\x2d' + '\x38'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82>c\xb2x\x99\xf8\xed\xb3\xc7\xc4|'), chr(0b1100100) + '\145' + chr(6535 - 6436) + chr(1114 - 1003) + chr(100) + '\x65')('\165' + '\x74' + '\x66' + '\x2d' + chr(0b111000)))): raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b"\x80,\x0f\xba'\xcd\xfc\xcd\x9a\xe2\xdaU"), chr(427 - 327) + '\145' + chr(0b1100011) + '\x6f' + chr(0b1100100) + '\x65')('\x75' + '\164' + chr(0b1100110) + '\x2d' + chr(2406 - 2350))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b24\xaa}\x9e\x91\xdd\xb7\xaa\xedvsoB\xc2\x88\xf5bF:\xd1?\xdc\x9c\x13\x12/>G>\xd4\xaa\x16j\xa2\xf9\x1a\xb6%\xee{\x11\xadw\x92\xdf\xc0\xac\xe3\xe3|U g\xce\xdb\xbd&J0\xccy\xdb\x94\x12@-%@%\xdb\xe3\x1a/\xa0\xb8\x19\xa4,\xa78u\x9bf\x9a\xd6\xce\xbd\xf8'), '\x64' + chr(5095 - 4994) + chr(99) + chr(0b10101 + 0o132) + chr(0b100000 + 0o104) + chr(101))('\165' + '\164' + chr(0b1000110 + 0o40) + '\x2d' + chr(0b100100 + 0o24))) wRRhgsPypNRT = IX7SCU7eVrph(oVre8I6UXc3b.Lb6zibIDkMHn) krg_AlCVmqvG = e9YLbhvyBiVu(**oVre8I6UXc3b.auth) CpcmGXxRJzMq = oVre8I6UXc3b._get_authorizers(krg_AlCVmqvG.Authorizers, krg_AlCVmqvG.DefaultAuthorizer) if CpcmGXxRJzMq: xafqLlk3kkUe(wRRhgsPypNRT, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaf81\x97p\x8e\xc5\xc1\xb7\xf8\xe5hr=p'), '\144' + '\x65' + '\143' + '\157' + chr(100) + chr(7055 - 6954))(chr(0b1110101) + '\x74' + chr(0b101010 + 0o74) + '\055' + chr(0b111000)))(CpcmGXxRJzMq) xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x91/0\xbcN\x9f\xd4\xcf\xb9\xff\xe0fH.v\xc3\x94\xf20L/\xda+'), '\144' + chr(0b1100010 + 0o3) + chr(99) + '\157' + chr(0b11110 + 0o106) + chr(5594 - 5493))(chr(0b1110101) + chr(0b11000 + 0o134) + '\146' + '\055' + '\070'))(wRRhgsPypNRT, CpcmGXxRJzMq, xafqLlk3kkUe(krg_AlCVmqvG, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a93\xa9d\x97\xc5\xe8\xad\xfe\xe4}e&y\xd2\x8e'), chr(0b11111 + 0o105) + chr(0b1100101) + '\x63' + chr(0b111000 + 0o67) + chr(0b110011 + 0o61) + chr(5075 - 4974))(chr(117) + chr(116) + chr(0b110010 + 0o64) + chr(0b101010 + 0o3) + chr(0b111000)))) oVre8I6UXc3b.Lb6zibIDkMHn = wRRhgsPypNRT.swagger
awslabs/serverless-application-model
samtranslator/model/api/api_generator.py
ApiGenerator._add_gateway_responses
def _add_gateway_responses(self): """ Add Gateway Response configuration to the Swagger file, if necessary """ if not self.gateway_responses: return if self.gateway_responses and not self.definition_body: raise InvalidResourceException( self.logical_id, "GatewayResponses works only with inline Swagger specified in " "'DefinitionBody' property") # Make sure keys in the dict are recognized for responses_key, responses_value in self.gateway_responses.items(): for response_key in responses_value.keys(): if response_key not in GatewayResponseProperties: raise InvalidResourceException( self.logical_id, "Invalid property '{}' in 'GatewayResponses' property '{}'".format(response_key, responses_key)) if not SwaggerEditor.is_valid(self.definition_body): raise InvalidResourceException( self.logical_id, "Unable to add Auth configuration because " "'DefinitionBody' does not contain a valid Swagger") swagger_editor = SwaggerEditor(self.definition_body) gateway_responses = {} for response_type, response in self.gateway_responses.items(): gateway_responses[response_type] = ApiGatewayResponse( api_logical_id=self.logical_id, response_parameters=response.get('ResponseParameters', {}), response_templates=response.get('ResponseTemplates', {}), status_code=response.get('StatusCode', None) ) if gateway_responses: swagger_editor.add_gateway_responses(gateway_responses) # Assign the Swagger back to template self.definition_body = swagger_editor.swagger
python
def _add_gateway_responses(self): """ Add Gateway Response configuration to the Swagger file, if necessary """ if not self.gateway_responses: return if self.gateway_responses and not self.definition_body: raise InvalidResourceException( self.logical_id, "GatewayResponses works only with inline Swagger specified in " "'DefinitionBody' property") # Make sure keys in the dict are recognized for responses_key, responses_value in self.gateway_responses.items(): for response_key in responses_value.keys(): if response_key not in GatewayResponseProperties: raise InvalidResourceException( self.logical_id, "Invalid property '{}' in 'GatewayResponses' property '{}'".format(response_key, responses_key)) if not SwaggerEditor.is_valid(self.definition_body): raise InvalidResourceException( self.logical_id, "Unable to add Auth configuration because " "'DefinitionBody' does not contain a valid Swagger") swagger_editor = SwaggerEditor(self.definition_body) gateway_responses = {} for response_type, response in self.gateway_responses.items(): gateway_responses[response_type] = ApiGatewayResponse( api_logical_id=self.logical_id, response_parameters=response.get('ResponseParameters', {}), response_templates=response.get('ResponseTemplates', {}), status_code=response.get('StatusCode', None) ) if gateway_responses: swagger_editor.add_gateway_responses(gateway_responses) # Assign the Swagger back to template self.definition_body = swagger_editor.swagger
[ "def", "_add_gateway_responses", "(", "self", ")", ":", "if", "not", "self", ".", "gateway_responses", ":", "return", "if", "self", ".", "gateway_responses", "and", "not", "self", ".", "definition_body", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"GatewayResponses works only with inline Swagger specified in \"", "\"'DefinitionBody' property\"", ")", "# Make sure keys in the dict are recognized", "for", "responses_key", ",", "responses_value", "in", "self", ".", "gateway_responses", ".", "items", "(", ")", ":", "for", "response_key", "in", "responses_value", ".", "keys", "(", ")", ":", "if", "response_key", "not", "in", "GatewayResponseProperties", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"Invalid property '{}' in 'GatewayResponses' property '{}'\"", ".", "format", "(", "response_key", ",", "responses_key", ")", ")", "if", "not", "SwaggerEditor", ".", "is_valid", "(", "self", ".", "definition_body", ")", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"Unable to add Auth configuration because \"", "\"'DefinitionBody' does not contain a valid Swagger\"", ")", "swagger_editor", "=", "SwaggerEditor", "(", "self", ".", "definition_body", ")", "gateway_responses", "=", "{", "}", "for", "response_type", ",", "response", "in", "self", ".", "gateway_responses", ".", "items", "(", ")", ":", "gateway_responses", "[", "response_type", "]", "=", "ApiGatewayResponse", "(", "api_logical_id", "=", "self", ".", "logical_id", ",", "response_parameters", "=", "response", ".", "get", "(", "'ResponseParameters'", ",", "{", "}", ")", ",", "response_templates", "=", "response", ".", "get", "(", "'ResponseTemplates'", ",", "{", "}", ")", ",", "status_code", "=", "response", ".", "get", "(", "'StatusCode'", ",", "None", ")", ")", "if", "gateway_responses", ":", "swagger_editor", ".", "add_gateway_responses", "(", "gateway_responses", ")", "# Assign the Swagger back to template", "self", ".", "definition_body", "=", "swagger_editor", ".", "swagger" ]
Add Gateway Response configuration to the Swagger file, if necessary
[ "Add", "Gateway", "Response", "configuration", "to", "the", "Swagger", "file", "if", "necessary" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/api/api_generator.py#L283-L324
train
Adds Gateway Response configuration to the Swagger file if necessary
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9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qBDw8l0eIm,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) + '\x33' + chr(119 - 66) + chr(664 - 609), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(0b10100 + 0o37) + chr(1473 - 1418), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(0b110 + 0o60) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + '\x31' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(0b10110 + 0o40) + chr(0b10110 + 0o41), 0o10), ehT0Px3KOsy9(chr(1348 - 1300) + '\x6f' + chr(1643 - 1593) + chr(50) + chr(892 - 844), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(54) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(1964 - 1916) + '\x6f' + chr(0b110011) + chr(0b110101) + chr(0b110010), 64950 - 64942), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + '\x34' + '\060', 30785 - 30777), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(111) + '\x31' + chr(55) + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + '\061' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(6293 - 6182) + '\061' + chr(0b100111 + 0o16) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(7606 - 7495) + '\061' + chr(0b110010) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(604 - 556) + '\157' + chr(0b110100) + chr(52), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + chr(1182 - 1133) + '\x37' + '\060', 35951 - 35943), ehT0Px3KOsy9(chr(48) + chr(1891 - 1780) + '\063' + chr(51) + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(720 - 609) + chr(49) + '\067' + '\064', 0o10), ehT0Px3KOsy9(chr(1803 - 1755) + chr(0b100100 + 0o113) + chr(49) + chr(54) + chr(0b110111), 5112 - 5104), ehT0Px3KOsy9(chr(539 - 491) + '\157' + chr(0b101001 + 0o10) + chr(50) + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101111 + 0o3) + '\x35' + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + chr(3647 - 3536) + chr(2096 - 2046) + chr(55) + chr(0b101001 + 0o16), 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(3379 - 3268) + '\x31' + '\062' + chr(1001 - 953), 0o10), ehT0Px3KOsy9(chr(385 - 337) + chr(7904 - 7793) + chr(0b11100 + 0o27) + chr(1884 - 1829) + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(48) + '\x32', 0o10), ehT0Px3KOsy9(chr(1684 - 1636) + chr(0b1101111) + chr(687 - 638) + chr(1309 - 1259) + chr(0b100 + 0o61), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + '\x37' + '\067', 0o10), ehT0Px3KOsy9(chr(396 - 348) + chr(2011 - 1900) + '\062' + '\065' + chr(0b110001 + 0o3), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(647 - 595) + chr(1866 - 1816), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + '\060' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(0b101 + 0o61) + '\067', 8), ehT0Px3KOsy9('\x30' + chr(5213 - 5102) + '\062' + chr(1245 - 1193) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11141 - 11030) + chr(859 - 808) + chr(0b101110 + 0o4) + chr(0b110111), 31491 - 31483), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(0b110101) + chr(1147 - 1095), 8), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(55) + chr(0b10001 + 0o37), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + '\061' + '\064' + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + '\x33' + chr(0b101100 + 0o6) + '\x31', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1945 - 1897) + '\x6f' + chr(53) + chr(0b11 + 0o55), 12292 - 12284)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1'), chr(0b111000 + 0o54) + chr(101) + chr(0b1100011) + '\x6f' + '\x64' + chr(0b1001010 + 0o33))('\165' + chr(0b1110100) + chr(2506 - 2404) + chr(0b101010 + 0o3) + chr(0b100 + 0o64)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def WSW0y3U9KhOK(oVre8I6UXc3b): if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0\xce\\\xee\x15m\xc1\xc1z\xba\xd6('), '\x64' + chr(1506 - 1405) + chr(5374 - 5275) + chr(11287 - 11176) + chr(0b1100100) + chr(0b10111 + 0o116))('\x75' + chr(0b1101010 + 0o12) + chr(0b1100110) + '\055' + '\x38')): return if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0\xce\\\xee\x15m\xc1\xc1z\xba\xd6('), chr(0b11111 + 0o105) + '\x65' + chr(0b1101 + 0o126) + chr(1130 - 1019) + chr(3222 - 3122) + chr(0b1100101))('\x75' + chr(0b1010111 + 0o35) + chr(0b1100110) + chr(0b101101) + '\070')) and (not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3\xfd3\xcb&j\xbe\xd4Y\xa7\xe8\x14'), chr(4596 - 4496) + chr(101) + chr(7515 - 7416) + chr(0b1001 + 0o146) + '\x64' + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(1337 - 1292) + chr(147 - 91)))): raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa1\xef_\xc3y>\xba\xf4p\x82\xf6='), chr(0b1100100) + '\145' + '\143' + chr(0b1101111) + chr(949 - 849) + '\x65')(chr(0b11100 + 0o131) + chr(116) + '\146' + '\055' + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8\xfeq\xd48i\x8e\xc2W\x99\xd0\x15\xa1y\x0f"\x04s\x17\xab\x17\x04t\xc0\xd1<\x85b"\x16\xd8\x8a\xa5\x1e\xcb\xbb\xc5\xd6\x01\xf1\xbc\xe8d\xd6(m\x85\xb0A\x9a\xc5\x19\xa6l\x034@$\x11\xb7\\P\x10\xca\xd99\x92+!\x16\xc3\x8c\xc7\x18\xc1\xae\x8b\x98\x14\xa3\x80\xef`\xc3;q'), '\144' + '\145' + chr(418 - 319) + chr(0b1101111) + chr(100) + chr(101))('\165' + '\164' + chr(102) + chr(0b101101) + chr(0b111000))) for (kLsMrW7gtkgu, Fv1ZWTGbrPFj) in xafqLlk3kkUe(oVre8I6UXc3b.gateway_responses, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa1\xe5s\xd4\x06R\xc4\xd9^\xb9\xe8C'), chr(0b1100100) + '\145' + chr(2780 - 2681) + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(0b1 + 0o164) + '\x74' + chr(0b10010 + 0o124) + chr(1641 - 1596) + chr(56)))(): for nWRW2_U7Ey70 in xafqLlk3kkUe(Fv1ZWTGbrPFj, xafqLlk3kkUe(SXOLrMavuUCe(b'\x84\xfa|\xc2'), '\144' + chr(0b1100101) + chr(8766 - 8667) + chr(0b1101111) + chr(0b11101 + 0o107) + '\145')(chr(0b1000010 + 0o63) + chr(675 - 559) + chr(102) + '\x2d' + chr(0b1001 + 0o57)))(): if nWRW2_U7Ey70 not in DWAPsD4jP3JK: raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa1\xef_\xc3y>\xba\xf4p\x82\xf6='), '\x64' + chr(101) + '\x63' + chr(111) + '\x64' + '\145')('\x75' + chr(0b1110100) + chr(3233 - 3131) + '\x2d' + '\x38')), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa6\xf1s\xd0#a\x93\xb0B\x98\xcf\n\xaax\x1e(\x04#\x03\xa4[W=\xc1\x9fw\xbb#!\x1a\xdb\x83\xfc%\xc0\xa4\xdc\xd7\n\xa2\x8a\xec"\x91?z\x98\xe0W\x98\xd4\x03\xef-\x11,\x03'), chr(0b1100100) + chr(0b1100101) + chr(2176 - 2077) + chr(0b1001001 + 0o46) + chr(100) + '\x65')(chr(117) + '\164' + chr(0b1100110) + '\x2d' + chr(1842 - 1786)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9\xabw\xde\x07i\xa4\xa3b\x9a\xc5\x10'), '\144' + '\145' + '\x63' + '\157' + chr(6200 - 6100) + chr(101))(chr(1670 - 1553) + chr(0b1110100) + '\x66' + chr(56 - 11) + chr(56)))(nWRW2_U7Ey70, kLsMrW7gtkgu)) if not xafqLlk3kkUe(IX7SCU7eVrph, xafqLlk3kkUe(SXOLrMavuUCe(b'\x86\xecZ\xc7.d\x9e\xf4'), '\x64' + chr(0b110101 + 0o60) + chr(5092 - 4993) + '\157' + '\x64' + chr(0b1100101))(chr(117) + '\164' + chr(0b110010 + 0o64) + '\x2d' + chr(56)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3\xfd3\xcb&j\xbe\xd4Y\xa7\xe8\x14'), '\x64' + '\145' + '\143' + chr(6776 - 6665) + '\144' + chr(2235 - 2134))(chr(0b1110010 + 0o3) + '\164' + chr(0b1100110) + chr(45) + '\x38'))): raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa1\xef_\xc3y>\xba\xf4p\x82\xf6='), chr(3583 - 3483) + chr(101) + '\x63' + '\157' + chr(100) + '\145')(chr(117) + chr(8330 - 8214) + '\x66' + chr(0b10010 + 0o33) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xba\xf1d\xd3#m\xd7\xe4]\xca\xc1\x1e\xab*+$PlX\xba\x13\x192\xc6\xd8%\x8e#!\x16\xc3\x8c\xa5\x15\xc0\xb4\xcd\xcd\x17\xb4\xcf\xb8A\xd4)a\x99\xf9F\x83\xcf\x14\x8de\x0e(\x03$\x1c\xb6\x19\x04t\xc1\xd0$\xdc!:\x11\xd8\x83\xec\x19\x85\xb6\x8c\xce\x05\xbd\x86\xfb%\xe28i\x90\xf7W\x98'), chr(0b1100001 + 0o3) + chr(0b1010110 + 0o17) + chr(0b1001000 + 0o33) + chr(0b1101111) + '\144' + '\145')(chr(0b1100000 + 0o25) + '\x74' + chr(0b1011111 + 0o7) + '\x2d' + chr(0b111000))) wRRhgsPypNRT = IX7SCU7eVrph(oVre8I6UXc3b.Lb6zibIDkMHn) OQY_Ze6QHPvR = {} for (LKhndj5WpPec, ekFGDFIe9V8v) in xafqLlk3kkUe(oVre8I6UXc3b.gateway_responses, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa1\xe5s\xd4\x06R\xc4\xd9^\xb9\xe8C'), chr(9775 - 9675) + '\x65' + '\x63' + chr(6143 - 6032) + chr(0b1100100) + chr(101))('\165' + chr(0b1110100) + chr(102) + chr(0b1110 + 0o37) + chr(952 - 896)))(): OQY_Ze6QHPvR[LKhndj5WpPec] = pHepY5Emcglv(api_logical_id=oVre8I6UXc3b.NpZr66MdBhVG, response_parameters=ekFGDFIe9V8v.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\xfav\xc1 f\x84\xf5b\x8b\xd2\x1b\xa2o\x1e4Vw'), chr(100) + chr(101) + chr(99) + chr(5779 - 5668) + chr(0b1100100) + chr(0b1100101))(chr(3782 - 3665) + chr(0b10101 + 0o137) + chr(0b1100110) + '\055' + chr(0b101010 + 0o16)), {}), response_templates=ekFGDFIe9V8v.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\xfav\xc1 f\x84\xf5f\x8f\xcd\n\xa3k\x1e4W'), chr(0b1001010 + 0o32) + chr(0b1011110 + 0o7) + chr(99) + '\157' + chr(0b1100100) + chr(0b100011 + 0o102))(chr(117) + '\x74' + chr(5994 - 5892) + chr(0b101101) + chr(0b111000)), {}), status_code=ekFGDFIe9V8v.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xebd\xc5:{\xb4\xffV\x8f'), chr(0b10011 + 0o121) + chr(0b1011 + 0o132) + '\x63' + '\x6f' + chr(0b1100100) + '\145')(chr(117) + chr(0b1110100) + '\x66' + chr(0b101101 + 0o0) + chr(0b11010 + 0o36)), None)) if OQY_Ze6QHPvR: xafqLlk3kkUe(wRRhgsPypNRT, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e\xfba\xee(i\x83\xf5E\x8b\xd9%\xbdo\x19!Kj\x0b\xbc\x0f'), '\144' + '\145' + '\x63' + '\157' + chr(7655 - 7555) + '\145')(chr(0b1010101 + 0o40) + chr(6546 - 6430) + '\146' + chr(0b101101) + '\x38'))(OQY_Ze6QHPvR) oVre8I6UXc3b.Lb6zibIDkMHn = wRRhgsPypNRT.swagger
awslabs/serverless-application-model
samtranslator/model/api/api_generator.py
ApiGenerator._get_permission
def _get_permission(self, authorizer_name, authorizer_lambda_function_arn): """Constructs and returns the Lambda Permission resource allowing the Authorizer to invoke the function. :returns: the permission resource :rtype: model.lambda_.LambdaPermission """ rest_api = ApiGatewayRestApi(self.logical_id, depends_on=self.depends_on, attributes=self.resource_attributes) api_id = rest_api.get_runtime_attr('rest_api_id') partition = ArnGenerator.get_partition_name() resource = '${__ApiId__}/authorizers/*' source_arn = fnSub(ArnGenerator.generate_arn(partition=partition, service='execute-api', resource=resource), {"__ApiId__": api_id}) lambda_permission = LambdaPermission(self.logical_id + authorizer_name + 'AuthorizerPermission', attributes=self.passthrough_resource_attributes) lambda_permission.Action = 'lambda:invokeFunction' lambda_permission.FunctionName = authorizer_lambda_function_arn lambda_permission.Principal = 'apigateway.amazonaws.com' lambda_permission.SourceArn = source_arn return lambda_permission
python
def _get_permission(self, authorizer_name, authorizer_lambda_function_arn): """Constructs and returns the Lambda Permission resource allowing the Authorizer to invoke the function. :returns: the permission resource :rtype: model.lambda_.LambdaPermission """ rest_api = ApiGatewayRestApi(self.logical_id, depends_on=self.depends_on, attributes=self.resource_attributes) api_id = rest_api.get_runtime_attr('rest_api_id') partition = ArnGenerator.get_partition_name() resource = '${__ApiId__}/authorizers/*' source_arn = fnSub(ArnGenerator.generate_arn(partition=partition, service='execute-api', resource=resource), {"__ApiId__": api_id}) lambda_permission = LambdaPermission(self.logical_id + authorizer_name + 'AuthorizerPermission', attributes=self.passthrough_resource_attributes) lambda_permission.Action = 'lambda:invokeFunction' lambda_permission.FunctionName = authorizer_lambda_function_arn lambda_permission.Principal = 'apigateway.amazonaws.com' lambda_permission.SourceArn = source_arn return lambda_permission
[ "def", "_get_permission", "(", "self", ",", "authorizer_name", ",", "authorizer_lambda_function_arn", ")", ":", "rest_api", "=", "ApiGatewayRestApi", "(", "self", ".", "logical_id", ",", "depends_on", "=", "self", ".", "depends_on", ",", "attributes", "=", "self", ".", "resource_attributes", ")", "api_id", "=", "rest_api", ".", "get_runtime_attr", "(", "'rest_api_id'", ")", "partition", "=", "ArnGenerator", ".", "get_partition_name", "(", ")", "resource", "=", "'${__ApiId__}/authorizers/*'", "source_arn", "=", "fnSub", "(", "ArnGenerator", ".", "generate_arn", "(", "partition", "=", "partition", ",", "service", "=", "'execute-api'", ",", "resource", "=", "resource", ")", ",", "{", "\"__ApiId__\"", ":", "api_id", "}", ")", "lambda_permission", "=", "LambdaPermission", "(", "self", ".", "logical_id", "+", "authorizer_name", "+", "'AuthorizerPermission'", ",", "attributes", "=", "self", ".", "passthrough_resource_attributes", ")", "lambda_permission", ".", "Action", "=", "'lambda:invokeFunction'", "lambda_permission", ".", "FunctionName", "=", "authorizer_lambda_function_arn", "lambda_permission", ".", "Principal", "=", "'apigateway.amazonaws.com'", "lambda_permission", ".", "SourceArn", "=", "source_arn", "return", "lambda_permission" ]
Constructs and returns the Lambda Permission resource allowing the Authorizer to invoke the function. :returns: the permission resource :rtype: model.lambda_.LambdaPermission
[ "Constructs", "and", "returns", "the", "Lambda", "Permission", "resource", "allowing", "the", "Authorizer", "to", "invoke", "the", "function", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/api/api_generator.py#L360-L381
train
Constructs and returns the Lambda Permission resource allowing the Authorizer to invoke 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,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDAS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xlR9h,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(538 - 490) + chr(0b101010 + 0o105) + chr(0b110010) + '\062' + chr(0b1000 + 0o57), 5311 - 5303), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + '\065' + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(54) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\x6f' + chr(50) + chr(0b110000) + chr(0b10010 + 0o42), 0o10), ehT0Px3KOsy9('\060' + chr(504 - 393) + '\x32' + chr(0b110101) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4927 - 4816) + chr(0b110001) + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + '\061' + chr(1400 - 1345), ord("\x08")), ehT0Px3KOsy9(chr(1163 - 1115) + chr(11055 - 10944) + '\062' + chr(51) + chr(0b110111), 20966 - 20958), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b100111 + 0o13) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(2221 - 2170) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(111) + chr(824 - 773) + chr(49) + chr(51), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(0b110101) + '\064', 0o10), ehT0Px3KOsy9(chr(386 - 338) + chr(0b1101111) + '\062' + '\x36' + chr(0b10101 + 0o33), 44336 - 44328), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + chr(119 - 8) + chr(1375 - 1324) + chr(50) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + '\x30' + '\x34', 29138 - 29130), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + '\062' + chr(1245 - 1197) + chr(0b110010), 17150 - 17142), ehT0Px3KOsy9(chr(1856 - 1808) + chr(0b110101 + 0o72) + '\x31' + chr(1410 - 1359) + chr(0b1110 + 0o47), 41285 - 41277), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b100101 + 0o112) + '\x34' + '\063', 50118 - 50110), ehT0Px3KOsy9(chr(48) + chr(0b101 + 0o152) + '\x33' + chr(2275 - 2224) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + chr(0b1010101 + 0o32) + '\062' + chr(416 - 366) + chr(53), 34293 - 34285), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(663 - 613) + chr(845 - 795) + chr(2166 - 2114), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(1757 - 1703) + '\x31', 50573 - 50565), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(2046 - 1991) + chr(1698 - 1647), 0b1000), ehT0Px3KOsy9(chr(48) + chr(6574 - 6463) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(7664 - 7553) + chr(49) + chr(2023 - 1970) + chr(2203 - 2154), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11101 + 0o25) + chr(250 - 202) + '\x31', 2686 - 2678), ehT0Px3KOsy9('\060' + chr(111) + '\x36' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010110 + 0o31) + '\063' + '\x32' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + '\066' + chr(52), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + '\x35' + chr(0b10100 + 0o43), 47270 - 47262), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1426 - 1371), 11014 - 11006), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b110010) + chr(55), 10817 - 10809), ehT0Px3KOsy9('\x30' + chr(0b100010 + 0o115) + chr(0b101101 + 0o4) + '\063' + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(54), 0o10), ehT0Px3KOsy9(chr(2122 - 2074) + '\157' + chr(0b1001 + 0o51) + chr(0b110110) + chr(0b110 + 0o56), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(5949 - 5838) + chr(49) + chr(1679 - 1631) + '\067', 57829 - 57821), ehT0Px3KOsy9(chr(48) + chr(0b110111 + 0o70) + chr(0b101011 + 0o7) + chr(0b110101) + chr(0b1001 + 0o53), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + '\x37' + '\063', 15721 - 15713), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(0b10 + 0o63) + '\x30', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110101) + '\060', 21745 - 21737)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9'), chr(100) + chr(8925 - 8824) + '\143' + chr(10734 - 10623) + chr(100) + chr(101))(chr(0b110000 + 0o105) + '\164' + chr(0b1100110) + chr(0b1011 + 0o42) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ltaTcw9z_97g(oVre8I6UXc3b, SYZOEjpGz36e, UeXD26BKVwFv): zxUfyoBahbWI = E6kpDkEm8Siw(oVre8I6UXc3b.NpZr66MdBhVG, depends_on=oVre8I6UXc3b.oayEYOknteBp, attributes=oVre8I6UXc3b.x7ddN_ki5nGn) X7mnYJ6SRw0h = zxUfyoBahbWI.get_runtime_attr(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe5\x0c\x07\xf0\xf6k\xff\xf6\x08q\xaf'), '\144' + '\x65' + '\143' + chr(0b1101111) + chr(100) + chr(8700 - 8599))(chr(117) + chr(0b1110100) + '\x66' + '\055' + chr(0b111000))) OVBNb17g1bVT = CuA6J2AA1iJi.get_partition_name() o9IPj2MJBBod = xafqLlk3kkUe(SXOLrMavuUCe(b'\xb3\x12+\xdb\xe8z\xe6\xd63G\x94\x11\x9fl\xa60\xea2Q\xb0\xef\xf1\x83H*C'), chr(100) + chr(0b1100101) + '\x63' + chr(6768 - 6657) + '\x64' + chr(0b1001111 + 0o26))(chr(11859 - 11742) + chr(116) + chr(7310 - 7208) + chr(45) + '\070') hAQZmU1baMWF = ht4eALydAxe8(CuA6J2AA1iJi.generate_arn(partition=OVBNb17g1bVT, service=xafqLlk3kkUe(SXOLrMavuUCe(b'\xf2\x11\x11\xe7\xdc~\xea\xb26h\xa2'), chr(0b1100100) + chr(0b1100101) + '\143' + '\157' + '\144' + chr(0b1001000 + 0o35))('\165' + chr(13052 - 12936) + chr(0b10101 + 0o121) + chr(45) + chr(0b111000)), resource=o9IPj2MJBBod), {xafqLlk3kkUe(SXOLrMavuUCe(b'\xc865\xf4\xc0C\xeb\xc0\x08'), chr(100) + chr(0b111 + 0o136) + chr(99) + chr(0b101010 + 0o105) + chr(0b1100100) + '\145')(chr(0b1110101) + '\x74' + chr(102) + chr(757 - 712) + chr(0b111000)): X7mnYJ6SRw0h}) SoufSaQB0VC3 = wv7EHNcArnq0(oVre8I6UXc3b.NpZr66MdBhVG + SYZOEjpGz36e + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6\x1c\x00\xec\xc6x\xe6\xe52j\x9b\t\xc2`\xba7\xf14L\xb7'), '\144' + '\x65' + '\x63' + chr(0b1010111 + 0o30) + '\144' + '\x65')(chr(117) + chr(13138 - 13022) + chr(102) + chr(0b101101) + '\x38'), attributes=oVre8I6UXc3b.passthrough_resource_attributes) SoufSaQB0VC3.YrIGcn2Z8x2z = xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb\x08\x19\xe6\xcdk\xb5\xf69n\xa4\x07\xd5K\xa6*\xe1)J\xb6\xfb'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(111) + chr(0b1010011 + 0o21) + '\145')(chr(0b1110101) + '\x74' + chr(102) + chr(685 - 640) + chr(56)) SoufSaQB0VC3.qUoaUMQeQIKB = UeXD26BKVwFv SoufSaQB0VC3.vc4tBqos7OYW = xafqLlk3kkUe(SXOLrMavuUCe(b'\xf6\x19\x1d\xe3\xc8~\xea\xe86a\xe5\r\xddl\xa9+\xec<T\xaa\xbb\xf7\x9eV'), '\x64' + chr(0b1100101) + chr(99) + chr(111) + chr(100) + chr(0b1111 + 0o126))(chr(0b101100 + 0o111) + '\164' + chr(0b110111 + 0o57) + '\055' + chr(56)) SoufSaQB0VC3.zlNz9OZ1moSb = hAQZmU1baMWF return SoufSaQB0VC3
awslabs/serverless-application-model
samtranslator/model/api/api_generator.py
ApiGenerator._set_endpoint_configuration
def _set_endpoint_configuration(self, rest_api, value): """ Sets endpoint configuration property of AWS::ApiGateway::RestApi resource :param rest_api: RestApi resource :param string/dict value: Value to be set """ rest_api.EndpointConfiguration = {"Types": [value]} rest_api.Parameters = {"endpointConfigurationTypes": value}
python
def _set_endpoint_configuration(self, rest_api, value): """ Sets endpoint configuration property of AWS::ApiGateway::RestApi resource :param rest_api: RestApi resource :param string/dict value: Value to be set """ rest_api.EndpointConfiguration = {"Types": [value]} rest_api.Parameters = {"endpointConfigurationTypes": value}
[ "def", "_set_endpoint_configuration", "(", "self", ",", "rest_api", ",", "value", ")", ":", "rest_api", ".", "EndpointConfiguration", "=", "{", "\"Types\"", ":", "[", "value", "]", "}", "rest_api", ".", "Parameters", "=", "{", "\"endpointConfigurationTypes\"", ":", "value", "}" ]
Sets endpoint configuration property of AWS::ApiGateway::RestApi resource :param rest_api: RestApi resource :param string/dict value: Value to be set
[ "Sets", "endpoint", "configuration", "property", "of", "AWS", "::", "ApiGateway", "::", "RestApi", "resource", ":", "param", "rest_api", ":", "RestApi", "resource", ":", "param", "string", "/", "dict", "value", ":", "Value", "to", "be", "set" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/api/api_generator.py#L416-L424
train
Sets the endpoint configuration property of AWS ::ApiGateway :: RestApi
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,_b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KaIaWE,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(366 - 318) + '\157' + chr(55) + chr(0b10001 + 0o44), 0b1000), ehT0Px3KOsy9('\060' + chr(0b11111 + 0o120) + chr(0b110111) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b111011 + 0o64) + chr(475 - 424) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(156 - 108) + chr(111) + chr(0b11011 + 0o30) + chr(0b11 + 0o56) + chr(0b110110), 47777 - 47769), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11110 + 0o24) + chr(49) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(160 - 112) + chr(0b1101111) + chr(50) + '\067' + chr(521 - 472), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + '\x31' + chr(52), 46533 - 46525), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + chr(1585 - 1536) + '\x35' + chr(1438 - 1385), 35743 - 35735), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(1694 - 1641) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\063' + '\064' + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2218 - 2168) + '\x32' + '\x34', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + '\060' + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b111 + 0o54) + chr(0b10111 + 0o35) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + '\x31' + chr(0b10001 + 0o43) + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b1101 + 0o45) + chr(0b110110) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1011 + 0o50) + chr(0b1101 + 0o45) + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1647 - 1596) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1100100 + 0o13) + chr(0b101111 + 0o3) + chr(0b110100) + chr(2490 - 2435), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + '\061' + chr(416 - 367), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(4142 - 4031) + '\062' + chr(53) + chr(0b1011 + 0o47), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(0b110011) + '\060', 13659 - 13651), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + chr(0b1000 + 0o51) + chr(0b11000 + 0o35), 42350 - 42342), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + '\x35' + chr(0b1 + 0o64), 11634 - 11626), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x35' + '\x30', 0o10), ehT0Px3KOsy9(chr(339 - 291) + chr(111) + chr(49) + chr(0b110110) + chr(1714 - 1660), 0b1000), ehT0Px3KOsy9('\060' + chr(10853 - 10742) + chr(1111 - 1061) + chr(0b100010 + 0o25) + chr(1691 - 1636), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(0b110000) + chr(0b110101), 8), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + chr(0b11 + 0o60) + chr(54) + chr(0b1100 + 0o47), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + '\x30' + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1000101 + 0o52) + '\063' + chr(51) + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1001101 + 0o42) + chr(0b110111) + '\x35', 8), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(5698 - 5587) + '\063' + chr(54), 8), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(10717 - 10606) + chr(0b100 + 0o55) + chr(0b1011 + 0o51) + '\061', 8), ehT0Px3KOsy9(chr(1188 - 1140) + '\157' + chr(935 - 884) + chr(0b11110 + 0o25) + chr(54), 10963 - 10955), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(1955 - 1906) + '\067' + '\x37', 0b1000), ehT0Px3KOsy9(chr(280 - 232) + chr(0b1101111) + chr(49) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101100 + 0o3) + '\x32' + chr(54), 42340 - 42332), ehT0Px3KOsy9(chr(1954 - 1906) + chr(111) + chr(0b1101 + 0o46) + chr(1257 - 1205), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(606 - 552) + '\060', 0b1000), ehT0Px3KOsy9(chr(808 - 760) + chr(0b1101111) + chr(0b110010) + chr(0b110000 + 0o1) + chr(49), 52524 - 52516)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\x6f' + chr(53) + chr(48), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x13'), chr(0b111001 + 0o53) + chr(6244 - 6143) + chr(8895 - 8796) + '\x6f' + chr(0b10 + 0o142) + chr(0b1100101))('\165' + chr(1218 - 1102) + '\146' + chr(1433 - 1388) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def IoVatIH13QWA(oVre8I6UXc3b, zxUfyoBahbWI, QmmgWUB13VCJ): zxUfyoBahbWI.cmyeg6qy4vUa = {xafqLlk3kkUe(SXOLrMavuUCe(b'i@j\xab\xfc'), '\144' + chr(0b1010 + 0o133) + chr(0b1100011) + chr(3447 - 3336) + chr(5943 - 5843) + chr(2755 - 2654))('\165' + '\x74' + chr(0b1100110) + chr(1525 - 1480) + chr(1570 - 1514)): [QmmgWUB13VCJ]} zxUfyoBahbWI.dxzjHB_F1JOW = {xafqLlk3kkUe(SXOLrMavuUCe(b'XW~\xbe\xe0\xd0\xe2\x19\xab\x89\xfa#\x8b\x06\xc6\xa7\x7f\xd3`\xc5\xf6Y\xd4X\x13\xcc'), chr(0b1100100) + chr(0b1100101) + chr(0b1000101 + 0o36) + '\157' + '\144' + chr(918 - 817))(chr(117) + chr(0b1011101 + 0o27) + chr(0b1100110) + '\x2d' + chr(56)): QmmgWUB13VCJ}
awslabs/serverless-application-model
examples/apps/greengrass-hello-world/greengrass_ipc_python_sdk/utils/exponential_backoff.py
retry
def retry(time_unit, multiplier, backoff_coefficient, max_delay, max_attempts, expiration_duration, enable_jitter): """ The retry function will keep retrying `task_to_try` until either: (1) it returns None, then retry() finishes (2) `max_attempts` is reached, then retry() raises an exception. (3) if retrying one more time will cause total wait time to go above: `expiration_duration`, then retry() raises an exception Beware that any exception raised by task_to_try won't get surfaced until (2) or (3) is satisfied. At step n, it sleeps for [0, delay), where delay is defined as the following: `delay = min(max_delay, multiplier * (backoff_coefficient ** (n - 1))) * time_unit` seconds Additionally, if you enable jitter, for each retry, the function will instead sleep for: random.random() * sleep, that is [0, sleep) seconds. :param time_unit: This field represents a fraction of a second, which is used as a multiplier to compute the amount of time to sleep. :type time_unit: float :param multiplier: The initial wait duration for the first retry. :type multiplier: float :param backoff_coefficient: the base value for exponential retry. :type backoff_coefficient: float :param max_delay: The maximum amount of time to wait per try. :type max_delay: float :param max_attempts: This method will retry up to this value. :type max_attempts: int :param expiration_duration: the maximum amount of time retry can wait. :type expiration_duration: float :param enable_jitter: Setting this to true will add jitter. :type enable_jitter: bool """ def deco_retry(task_to_try): @wraps(task_to_try) def retry_impl(*args, **kwargs): total_wait_time = 0 have_tried = 0 retry_errors = [] while have_tried < max_attempts: try: task_to_try(*args, **kwargs) return except Exception as e: retry_errors.append(e) going_to_sleep_for = min(max_delay, multiplier * (backoff_coefficient ** have_tried)) if enable_jitter: going_to_sleep_for = random.random() * going_to_sleep_for duration = going_to_sleep_for * time_unit if total_wait_time + duration > expiration_duration: raise RetryTimeoutException(task_to_try.__name__, have_tried, max_attempts, total_wait_time, multiplier, backoff_coefficient, enable_jitter, retry_errors) runtime_logger.warn('Retrying [{0}], going to sleep for {1} seconds, exception stacktrace:\n{2}' .format(task_to_try.__name__, duration, traceback.format_exc())) time.sleep(duration) total_wait_time += duration have_tried += 1 raise RetryTimeoutException(task_to_try.__name__, have_tried, max_attempts, total_wait_time, multiplier, backoff_coefficient, enable_jitter, retry_errors) return retry_impl return deco_retry
python
def retry(time_unit, multiplier, backoff_coefficient, max_delay, max_attempts, expiration_duration, enable_jitter): """ The retry function will keep retrying `task_to_try` until either: (1) it returns None, then retry() finishes (2) `max_attempts` is reached, then retry() raises an exception. (3) if retrying one more time will cause total wait time to go above: `expiration_duration`, then retry() raises an exception Beware that any exception raised by task_to_try won't get surfaced until (2) or (3) is satisfied. At step n, it sleeps for [0, delay), where delay is defined as the following: `delay = min(max_delay, multiplier * (backoff_coefficient ** (n - 1))) * time_unit` seconds Additionally, if you enable jitter, for each retry, the function will instead sleep for: random.random() * sleep, that is [0, sleep) seconds. :param time_unit: This field represents a fraction of a second, which is used as a multiplier to compute the amount of time to sleep. :type time_unit: float :param multiplier: The initial wait duration for the first retry. :type multiplier: float :param backoff_coefficient: the base value for exponential retry. :type backoff_coefficient: float :param max_delay: The maximum amount of time to wait per try. :type max_delay: float :param max_attempts: This method will retry up to this value. :type max_attempts: int :param expiration_duration: the maximum amount of time retry can wait. :type expiration_duration: float :param enable_jitter: Setting this to true will add jitter. :type enable_jitter: bool """ def deco_retry(task_to_try): @wraps(task_to_try) def retry_impl(*args, **kwargs): total_wait_time = 0 have_tried = 0 retry_errors = [] while have_tried < max_attempts: try: task_to_try(*args, **kwargs) return except Exception as e: retry_errors.append(e) going_to_sleep_for = min(max_delay, multiplier * (backoff_coefficient ** have_tried)) if enable_jitter: going_to_sleep_for = random.random() * going_to_sleep_for duration = going_to_sleep_for * time_unit if total_wait_time + duration > expiration_duration: raise RetryTimeoutException(task_to_try.__name__, have_tried, max_attempts, total_wait_time, multiplier, backoff_coefficient, enable_jitter, retry_errors) runtime_logger.warn('Retrying [{0}], going to sleep for {1} seconds, exception stacktrace:\n{2}' .format(task_to_try.__name__, duration, traceback.format_exc())) time.sleep(duration) total_wait_time += duration have_tried += 1 raise RetryTimeoutException(task_to_try.__name__, have_tried, max_attempts, total_wait_time, multiplier, backoff_coefficient, enable_jitter, retry_errors) return retry_impl return deco_retry
[ "def", "retry", "(", "time_unit", ",", "multiplier", ",", "backoff_coefficient", ",", "max_delay", ",", "max_attempts", ",", "expiration_duration", ",", "enable_jitter", ")", ":", "def", "deco_retry", "(", "task_to_try", ")", ":", "@", "wraps", "(", "task_to_try", ")", "def", "retry_impl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "total_wait_time", "=", "0", "have_tried", "=", "0", "retry_errors", "=", "[", "]", "while", "have_tried", "<", "max_attempts", ":", "try", ":", "task_to_try", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "except", "Exception", "as", "e", ":", "retry_errors", ".", "append", "(", "e", ")", "going_to_sleep_for", "=", "min", "(", "max_delay", ",", "multiplier", "*", "(", "backoff_coefficient", "**", "have_tried", ")", ")", "if", "enable_jitter", ":", "going_to_sleep_for", "=", "random", ".", "random", "(", ")", "*", "going_to_sleep_for", "duration", "=", "going_to_sleep_for", "*", "time_unit", "if", "total_wait_time", "+", "duration", ">", "expiration_duration", ":", "raise", "RetryTimeoutException", "(", "task_to_try", ".", "__name__", ",", "have_tried", ",", "max_attempts", ",", "total_wait_time", ",", "multiplier", ",", "backoff_coefficient", ",", "enable_jitter", ",", "retry_errors", ")", "runtime_logger", ".", "warn", "(", "'Retrying [{0}], going to sleep for {1} seconds, exception stacktrace:\\n{2}'", ".", "format", "(", "task_to_try", ".", "__name__", ",", "duration", ",", "traceback", ".", "format_exc", "(", ")", ")", ")", "time", ".", "sleep", "(", "duration", ")", "total_wait_time", "+=", "duration", "have_tried", "+=", "1", "raise", "RetryTimeoutException", "(", "task_to_try", ".", "__name__", ",", "have_tried", ",", "max_attempts", ",", "total_wait_time", ",", "multiplier", ",", "backoff_coefficient", ",", "enable_jitter", ",", "retry_errors", ")", "return", "retry_impl", "return", "deco_retry" ]
The retry function will keep retrying `task_to_try` until either: (1) it returns None, then retry() finishes (2) `max_attempts` is reached, then retry() raises an exception. (3) if retrying one more time will cause total wait time to go above: `expiration_duration`, then retry() raises an exception Beware that any exception raised by task_to_try won't get surfaced until (2) or (3) is satisfied. At step n, it sleeps for [0, delay), where delay is defined as the following: `delay = min(max_delay, multiplier * (backoff_coefficient ** (n - 1))) * time_unit` seconds Additionally, if you enable jitter, for each retry, the function will instead sleep for: random.random() * sleep, that is [0, sleep) seconds. :param time_unit: This field represents a fraction of a second, which is used as a multiplier to compute the amount of time to sleep. :type time_unit: float :param multiplier: The initial wait duration for the first retry. :type multiplier: float :param backoff_coefficient: the base value for exponential retry. :type backoff_coefficient: float :param max_delay: The maximum amount of time to wait per try. :type max_delay: float :param max_attempts: This method will retry up to this value. :type max_attempts: int :param expiration_duration: the maximum amount of time retry can wait. :type expiration_duration: float :param enable_jitter: Setting this to true will add jitter. :type enable_jitter: bool
[ "The", "retry", "function", "will", "keep", "retrying", "task_to_try", "until", "either", ":", "(", "1", ")", "it", "returns", "None", "then", "retry", "()", "finishes", "(", "2", ")", "max_attempts", "is", "reached", "then", "retry", "()", "raises", "an", "exception", ".", "(", "3", ")", "if", "retrying", "one", "more", "time", "will", "cause", "total", "wait", "time", "to", "go", "above", ":", "expiration_duration", "then", "retry", "()", "raises", "an", "exception" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/greengrass-hello-world/greengrass_ipc_python_sdk/utils/exponential_backoff.py#L47-L116
train
This function returns a function that will retry a task_to_try in a new order.
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_z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ji,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) + '\x6f' + chr(0b110011) + chr(392 - 338) + chr(2126 - 2077), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(121 - 71) + chr(0b100000 + 0o21) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100010 + 0o15) + chr(0b110010) + chr(0b110111) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(55) + '\x34', 13102 - 13094), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\157' + chr(51) + '\x31' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11010 + 0o27) + '\x30' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110 + 0o54) + chr(0b110100) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\060' + chr(6490 - 6379) + chr(0b100 + 0o57) + chr(0b110110) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110110) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1101111) + chr(51) + chr(0b1001 + 0o52) + chr(1826 - 1772), 0o10), ehT0Px3KOsy9(chr(2151 - 2103) + '\157' + '\x32' + '\x31' + chr(0b11101 + 0o26), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + '\x37' + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + '\060' + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1011 + 0o144) + '\x33' + chr(0b110011) + chr(2373 - 2320), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10101 + 0o35) + '\x35' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\157' + '\064' + chr(2277 - 2223), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b110011 + 0o74) + chr(1324 - 1275) + chr(0b110000 + 0o5) + chr(0b11000 + 0o37), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b11100 + 0o123) + '\x31' + chr(1114 - 1062) + '\x33', 0b1000), ehT0Px3KOsy9(chr(211 - 163) + chr(0b1101111) + '\x37' + chr(0b10010 + 0o40), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x35' + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10010 + 0o41) + '\x36', 0b1000), ehT0Px3KOsy9(chr(1009 - 961) + chr(111) + chr(0b0 + 0o62) + chr(0b1111 + 0o42) + '\060', 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1101111) + chr(0b1111 + 0o43) + chr(0b1001 + 0o50) + chr(0b11000 + 0o30), 8), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + '\062' + '\x32' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9425 - 9314) + chr(49) + '\064' + chr(449 - 395), 49202 - 49194), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x34' + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1011111 + 0o20) + chr(0b110011) + '\x31' + chr(0b10011 + 0o42), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + '\062' + chr(49), 15098 - 15090), ehT0Px3KOsy9('\x30' + '\157' + '\066' + chr(2125 - 2074), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(0b110010) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b0 + 0o61) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011101 + 0o22) + chr(0b110011) + chr(0b110110) + '\x37', 9387 - 9379), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b1100 + 0o47) + chr(0b11100 + 0o32), 8), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\157' + chr(51) + chr(0b10 + 0o65) + chr(2432 - 2379), 0b1000), ehT0Px3KOsy9(chr(48) + chr(8152 - 8041) + '\x36' + chr(779 - 726), 53439 - 53431), ehT0Px3KOsy9(chr(1903 - 1855) + chr(407 - 296) + '\062' + chr(55) + chr(0b1000 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b100011 + 0o21) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101011 + 0o4) + chr(0b110010) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1000100 + 0o53) + chr(0b110010) + chr(0b10011 + 0o37) + chr(0b10100 + 0o37), 40102 - 40094), ehT0Px3KOsy9('\x30' + chr(111) + chr(53) + chr(1407 - 1355), 55873 - 55865)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b100010 + 0o115) + '\x35' + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(0b1010101 + 0o32) + '\144' + '\145')('\165' + '\164' + chr(102) + chr(45) + chr(0b11010 + 0o36)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def bAp2a7bfQaMD(LoCPKzIoY7qp, S0Mp0SOoXply, umRgQ4MB7VuB, nBa3VnL0_Vv0, tzEXo_Lvh8Tj, MeemHJ3b180R, OHAVFEDoMMbW): def ltsYUQigY6Ib(r4whxnpHYywD): @cUOaMZfY2Ho1(r4whxnpHYywD) def CBm7SP1Ib3sa(*kJDRfRhcZHjS, **M8EIoTs2GJXE): BleSjE1EKqnT = ehT0Px3KOsy9(chr(48) + '\157' + '\060', 0o10) hU8VBXGmBWMj = ehT0Px3KOsy9('\x30' + '\x6f' + '\x30', 8) W5NOIhevMDgm = [] while hU8VBXGmBWMj < tzEXo_Lvh8Tj: try: r4whxnpHYywD(*kJDRfRhcZHjS, **M8EIoTs2GJXE) return except jLmadlzMdunT as GlnVAPeT6CUe: xafqLlk3kkUe(W5NOIhevMDgm, xafqLlk3kkUe(SXOLrMavuUCe(b'\x90\xf9\xcb\x19\xa2&'), '\144' + '\145' + chr(99) + '\157' + '\x64' + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b1100110) + '\x2d' + chr(0b11011 + 0o35)))(GlnVAPeT6CUe) rfWh7ZLCOLxt = Dx22bkKPdt5d(nBa3VnL0_Vv0, S0Mp0SOoXply * umRgQ4MB7VuB ** hU8VBXGmBWMj) if OHAVFEDoMMbW: rfWh7ZLCOLxt = drxw09AdRdci.drxw09AdRdci() * rfWh7ZLCOLxt AW3Z20f3DKFA = rfWh7ZLCOLxt * LoCPKzIoY7qp if BleSjE1EKqnT + AW3Z20f3DKFA > MeemHJ3b180R: raise NQyszRvy3QdB(xafqLlk3kkUe(r4whxnpHYywD, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6\xeb\xde\x16\xf8-\xf8\x85|\x92\xca\xca'), chr(0b1100100) + '\145' + chr(0b1100011) + '\157' + chr(0b100101 + 0o77) + chr(3259 - 3158))('\165' + '\164' + '\146' + chr(1220 - 1175) + chr(0b1100 + 0o54))), hU8VBXGmBWMj, tzEXo_Lvh8Tj, BleSjE1EKqnT, S0Mp0SOoXply, umRgQ4MB7VuB, OHAVFEDoMMbW, W5NOIhevMDgm) xafqLlk3kkUe(tHsekZuX_0R7, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f\xcd\xfe\x12\x82\x00\xc3\x96q\x90\xc0\x91'), chr(100) + chr(0b1100101) + '\x63' + '\x6f' + '\144' + chr(101))('\165' + '\x74' + chr(0b1100110) + chr(0b10101 + 0o30) + chr(0b11000 + 0o40)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3\xec\xcf\x0e\xb5+\xcc\x93\x17\x85\xf0\xcc\xbf\x80\x80\x06\x08\x0cS@y\xa8\xfc\xfbFR\xa1\xb4V\xa2j\x91q\x8f\x15\xc1Uj\xb3_\x94\xea\xd4\x12\xa81\x8e\xd4R\xa6\xe8\x99\xb2\xa9\xc5I\x01CIZ\x7f\xeb\xe3\xe0\x14@\xae\xb4\t\xd81\xc5c'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(0b1100001 + 0o3) + '\x65')(chr(117) + chr(0b1110100) + chr(102) + chr(45) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7\xbd\xc9\x13\x84#\xf1\xc7g\xae\xee\x96'), chr(3860 - 3760) + '\145' + chr(0b101001 + 0o72) + chr(0b10001 + 0o136) + chr(100) + chr(3719 - 3618))('\165' + '\164' + chr(0b1100110) + chr(0b101101) + '\070'))(xafqLlk3kkUe(r4whxnpHYywD, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6\xeb\xde\x16\xf8-\xf8\x85|\x92\xca\xca'), '\144' + chr(4239 - 4138) + chr(99) + '\157' + chr(100) + '\145')(chr(12041 - 11924) + chr(10895 - 10779) + chr(102) + chr(0b11111 + 0o16) + chr(2039 - 1983))), AW3Z20f3DKFA, xafqLlk3kkUe(CiXxQDnt84wa, xafqLlk3kkUe(SXOLrMavuUCe(b'\x97\xe6\xc9\x11\xad6\xfd\x91O\xbd'), chr(0b1010011 + 0o21) + chr(0b1100101) + '\143' + chr(111) + '\144' + chr(0b1100101))('\x75' + chr(1160 - 1044) + chr(102) + chr(696 - 651) + chr(0b111000)))())) xafqLlk3kkUe(ltvhPP4VhXre, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xe5\xde\x19\xbc'), chr(0b101001 + 0o73) + '\x65' + chr(0b1100011) + chr(0b1101111) + '\x64' + '\x65')(chr(0b1110010 + 0o3) + chr(0b1110100) + chr(0b100111 + 0o77) + '\055' + chr(404 - 348)))(AW3Z20f3DKFA) BleSjE1EKqnT += AW3Z20f3DKFA hU8VBXGmBWMj += ehT0Px3KOsy9(chr(1379 - 1331) + chr(0b1101111) + chr(351 - 302), 0b1000) raise NQyszRvy3QdB(xafqLlk3kkUe(r4whxnpHYywD, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6\xeb\xde\x16\xf8-\xf8\x85|\x92\xca\xca'), '\x64' + chr(0b111000 + 0o55) + chr(99) + chr(6514 - 6403) + '\x64' + chr(1028 - 927))('\165' + '\x74' + chr(0b1100010 + 0o4) + '\x2d' + chr(0b111000))), hU8VBXGmBWMj, tzEXo_Lvh8Tj, BleSjE1EKqnT, S0Mp0SOoXply, umRgQ4MB7VuB, OHAVFEDoMMbW, W5NOIhevMDgm) return CBm7SP1Ib3sa return ltsYUQigY6Ib
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
to_cloudformation
def to_cloudformation(self, **kwargs): """Returns the Lambda function, role, and event resources to which this SAM Function corresponds. :param dict kwargs: already-converted resources that may need to be modified when converting this \ macro to pure CloudFormation :returns: a list of vanilla CloudFormation Resources, to which this Function expands :rtype: list """ resources = [] intrinsics_resolver = kwargs["intrinsics_resolver"] if self.DeadLetterQueue: self._validate_dlq() lambda_function = self._construct_lambda_function() resources.append(lambda_function) lambda_alias = None if self.AutoPublishAlias: alias_name = self._get_resolved_alias_name("AutoPublishAlias", self.AutoPublishAlias, intrinsics_resolver) lambda_version = self._construct_version(lambda_function, intrinsics_resolver=intrinsics_resolver) lambda_alias = self._construct_alias(alias_name, lambda_function, lambda_version) resources.append(lambda_version) resources.append(lambda_alias) if self.DeploymentPreference: self._validate_deployment_preference_and_add_update_policy(kwargs.get('deployment_preference_collection', None), lambda_alias, intrinsics_resolver) managed_policy_map = kwargs.get('managed_policy_map', {}) if not managed_policy_map: raise Exception('Managed policy map is empty, but should not be.') execution_role = None if lambda_function.Role is None: execution_role = self._construct_role(managed_policy_map) lambda_function.Role = execution_role.get_runtime_attr('arn') resources.append(execution_role) try: resources += self._generate_event_resources(lambda_function, execution_role, kwargs['event_resources'], lambda_alias=lambda_alias) except InvalidEventException as e: raise InvalidResourceException(self.logical_id, e.message) return resources
python
def to_cloudformation(self, **kwargs): """Returns the Lambda function, role, and event resources to which this SAM Function corresponds. :param dict kwargs: already-converted resources that may need to be modified when converting this \ macro to pure CloudFormation :returns: a list of vanilla CloudFormation Resources, to which this Function expands :rtype: list """ resources = [] intrinsics_resolver = kwargs["intrinsics_resolver"] if self.DeadLetterQueue: self._validate_dlq() lambda_function = self._construct_lambda_function() resources.append(lambda_function) lambda_alias = None if self.AutoPublishAlias: alias_name = self._get_resolved_alias_name("AutoPublishAlias", self.AutoPublishAlias, intrinsics_resolver) lambda_version = self._construct_version(lambda_function, intrinsics_resolver=intrinsics_resolver) lambda_alias = self._construct_alias(alias_name, lambda_function, lambda_version) resources.append(lambda_version) resources.append(lambda_alias) if self.DeploymentPreference: self._validate_deployment_preference_and_add_update_policy(kwargs.get('deployment_preference_collection', None), lambda_alias, intrinsics_resolver) managed_policy_map = kwargs.get('managed_policy_map', {}) if not managed_policy_map: raise Exception('Managed policy map is empty, but should not be.') execution_role = None if lambda_function.Role is None: execution_role = self._construct_role(managed_policy_map) lambda_function.Role = execution_role.get_runtime_attr('arn') resources.append(execution_role) try: resources += self._generate_event_resources(lambda_function, execution_role, kwargs['event_resources'], lambda_alias=lambda_alias) except InvalidEventException as e: raise InvalidResourceException(self.logical_id, e.message) return resources
[ "def", "to_cloudformation", "(", "self", ",", "*", "*", "kwargs", ")", ":", "resources", "=", "[", "]", "intrinsics_resolver", "=", "kwargs", "[", "\"intrinsics_resolver\"", "]", "if", "self", ".", "DeadLetterQueue", ":", "self", ".", "_validate_dlq", "(", ")", "lambda_function", "=", "self", ".", "_construct_lambda_function", "(", ")", "resources", ".", "append", "(", "lambda_function", ")", "lambda_alias", "=", "None", "if", "self", ".", "AutoPublishAlias", ":", "alias_name", "=", "self", ".", "_get_resolved_alias_name", "(", "\"AutoPublishAlias\"", ",", "self", ".", "AutoPublishAlias", ",", "intrinsics_resolver", ")", "lambda_version", "=", "self", ".", "_construct_version", "(", "lambda_function", ",", "intrinsics_resolver", "=", "intrinsics_resolver", ")", "lambda_alias", "=", "self", ".", "_construct_alias", "(", "alias_name", ",", "lambda_function", ",", "lambda_version", ")", "resources", ".", "append", "(", "lambda_version", ")", "resources", ".", "append", "(", "lambda_alias", ")", "if", "self", ".", "DeploymentPreference", ":", "self", ".", "_validate_deployment_preference_and_add_update_policy", "(", "kwargs", ".", "get", "(", "'deployment_preference_collection'", ",", "None", ")", ",", "lambda_alias", ",", "intrinsics_resolver", ")", "managed_policy_map", "=", "kwargs", ".", "get", "(", "'managed_policy_map'", ",", "{", "}", ")", "if", "not", "managed_policy_map", ":", "raise", "Exception", "(", "'Managed policy map is empty, but should not be.'", ")", "execution_role", "=", "None", "if", "lambda_function", ".", "Role", "is", "None", ":", "execution_role", "=", "self", ".", "_construct_role", "(", "managed_policy_map", ")", "lambda_function", ".", "Role", "=", "execution_role", ".", "get_runtime_attr", "(", "'arn'", ")", "resources", ".", "append", "(", "execution_role", ")", "try", ":", "resources", "+=", "self", ".", "_generate_event_resources", "(", "lambda_function", ",", "execution_role", ",", "kwargs", "[", "'event_resources'", "]", ",", "lambda_alias", "=", "lambda_alias", ")", "except", "InvalidEventException", "as", "e", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "e", ".", "message", ")", "return", "resources" ]
Returns the Lambda function, role, and event resources to which this SAM Function corresponds. :param dict kwargs: already-converted resources that may need to be modified when converting this \ macro to pure CloudFormation :returns: a list of vanilla CloudFormation Resources, to which this Function expands :rtype: list
[ "Returns", "the", "Lambda", "function", "role", "and", "event", "resources", "to", "which", "this", "SAM", "Function", "corresponds", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L80-L126
train
Converts this SAM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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(chr(0b101110 + 0o2) + '\x6f' + chr(51) + chr(55) + chr(0b110 + 0o57), 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + '\064', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(334 - 284) + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(55) + '\x35', 46583 - 46575), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(0b0 + 0o66) + chr(0b11111 + 0o30), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + '\x36' + chr(564 - 512), ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1011101 + 0o22) + chr(416 - 367) + chr(551 - 502) + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(49) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(1188 - 1077) + chr(53) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + chr(0b1101 + 0o44) + chr(0b11011 + 0o34), 56522 - 56514), ehT0Px3KOsy9(chr(0b110000) + chr(0b111010 + 0o65) + chr(50) + chr(51) + '\x36', 33962 - 33954), ehT0Px3KOsy9(chr(1188 - 1140) + chr(0b1101111) + chr(51) + chr(0b110110) + chr(55), 0o10), ehT0Px3KOsy9('\060' + chr(0b100111 + 0o110) + chr(0b111 + 0o54) + chr(48) + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b110 + 0o151) + chr(49) + chr(50) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101111) + chr(2145 - 2094) + chr(0b110000) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(556 - 506) + chr(54) + chr(0b110000), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(54) + chr(50), 59008 - 59000), ehT0Px3KOsy9(chr(48) + chr(0b110110 + 0o71) + '\063' + chr(0b110101) + '\060', 36062 - 36054), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1000101 + 0o52) + '\x32' + '\062' + '\064', 2398 - 2390), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(1295 - 1245) + '\063', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x32', 0b1000), ehT0Px3KOsy9('\060' + chr(0b10011 + 0o134) + chr(50) + chr(0b110110) + '\067', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2902 - 2848) + chr(1853 - 1798), ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1000100 + 0o53) + chr(0b110010) + chr(0b110111) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(6848 - 6737) + chr(49) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(92 - 37), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101010 + 0o5) + '\061' + '\064' + chr(0b1001 + 0o55), 0b1000), ehT0Px3KOsy9(chr(1309 - 1261) + chr(8917 - 8806) + chr(0b100001 + 0o21) + chr(357 - 302) + chr(53), 8), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b1011111 + 0o20) + chr(0b10100 + 0o36) + '\x35' + chr(0b110110), 40455 - 40447), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + '\x37' + chr(52), 0o10), ehT0Px3KOsy9(chr(324 - 276) + chr(3618 - 3507) + chr(51) + chr(0b110111) + chr(50), 15828 - 15820), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(681 - 630) + chr(0b110010) + chr(0b100100 + 0o20), 0o10), ehT0Px3KOsy9('\x30' + chr(4901 - 4790) + chr(0b101100 + 0o7) + chr(48) + '\x33', 0b1000), ehT0Px3KOsy9(chr(1823 - 1775) + chr(111) + '\x36' + chr(1009 - 957), 0o10), ehT0Px3KOsy9(chr(167 - 119) + chr(111) + chr(51) + '\064' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b11101 + 0o122) + chr(62 - 10) + chr(0b100010 + 0o20), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + '\x33', 0o10), ehT0Px3KOsy9('\060' + chr(4036 - 3925) + chr(0b110011) + '\x36' + chr(945 - 894), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(2139 - 2028) + chr(54) + '\067', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\157' + chr(0b110101) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3'), chr(0b1100100) + '\145' + chr(0b1000000 + 0o43) + chr(8637 - 8526) + chr(0b110000 + 0o64) + chr(0b101100 + 0o71))(chr(12835 - 12718) + '\164' + chr(0b1100110) + chr(0b1111 + 0o36) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def NpIm0Ph3ybvM(oVre8I6UXc3b, **M8EIoTs2GJXE): z4Xs9XhDbg00 = [] M8xEnnSGIF9g = M8EIoTs2GJXE[xafqLlk3kkUe(SXOLrMavuUCe(b"\x94j\xa5\xcf\xde\x9a>\xe1O|\xc1\x85\xa7'\xaf\xdc\x04\x8d\xe6"), chr(0b1100100) + chr(0b1100101) + chr(8516 - 8417) + chr(0b1010111 + 0o30) + chr(0b111001 + 0o53) + '\x65')(chr(0b1100110 + 0o17) + chr(0b1000000 + 0o64) + '\146' + chr(45) + chr(0b111000))] if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9a\xb0\xd9\xfb\x919\xfcI}\xcf\x82\xa7!\xa5'), chr(100) + '\x65' + chr(99) + chr(0b110 + 0o151) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b1011100 + 0o12) + chr(0b101101) + '\x38')): xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2r\xb0\xd1\xde\x90,\xfcIP\xfa\x9b\xb3'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(0b111101 + 0o47) + '\x65')(chr(1855 - 1738) + chr(116) + '\x66' + chr(0b101101) + chr(2245 - 2189)))() TyX845NjZzYy = oVre8I6UXc3b._construct_lambda_function() xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9ct\xa1\xd8\xd9\x90'), chr(0b1111 + 0o125) + '\145' + chr(0b1100011) + '\x6f' + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(9246 - 9130) + chr(0b110110 + 0o60) + chr(1522 - 1477) + '\x38'))(TyX845NjZzYy) x4pgu5PA4WQW = None if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbcq\xa5\xd2\xe7\x81/\xe4E|\xf6\xb6\xae=\xa1\xc3'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(4359 - 4258))('\x75' + chr(0b1110100) + chr(102) + '\x2d' + chr(0b101 + 0o63))): VoDHYLkbSt4x = oVre8I6UXc3b._get_resolved_alias_name(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbcq\xa5\xd2\xe7\x81/\xe4E|\xf6\xb6\xae=\xa1\xc3'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(0b1101 + 0o130))(chr(9174 - 9057) + chr(0b1010010 + 0o42) + chr(102) + chr(0b101101) + chr(0b111000)), oVre8I6UXc3b.AutoPublishAlias, M8xEnnSGIF9g) ihcWhVXbHDhq = oVre8I6UXc3b._construct_version(TyX845NjZzYy, intrinsics_resolver=M8xEnnSGIF9g) x4pgu5PA4WQW = oVre8I6UXc3b._construct_alias(VoDHYLkbSt4x, TyX845NjZzYy, ihcWhVXbHDhq) xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9ct\xa1\xd8\xd9\x90'), chr(1329 - 1229) + '\x65' + '\143' + '\x6f' + chr(0b110011 + 0o61) + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b1011001 + 0o15) + '\x2d' + chr(0b111000)))(ihcWhVXbHDhq) xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9ct\xa1\xd8\xd9\x90'), '\144' + chr(101) + chr(99) + chr(111) + chr(0b101101 + 0o67) + chr(0b100001 + 0o104))('\x75' + chr(0b1110100) + chr(0b1100110) + '\x2d' + chr(0b110 + 0o62)))(x4pgu5PA4WQW) if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9a\xa1\xd1\xd8\x8d \xedB{\xce\x85\xa72\xa5\xc2\x17\x86\xf7\xf6'), '\144' + chr(7967 - 7866) + '\x63' + '\x6f' + '\144' + chr(0b1000 + 0o135))(chr(117) + chr(12067 - 11951) + '\146' + chr(0b101101) + chr(3132 - 3076))): xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2r\xb0\xd1\xde\x90,\xfcIP\xfa\x92\xb28\xaf\xc9\x1f\x8d\xfa\xe7]\xc7E\xdf~lu\x03\xd3\xcd\x19\xa5\xb5\xadP\xb9C\x7f\x97h\x88t\xb5\xdc\xc3\x91\x12\xf8Cc\xf7\x94\xbb'), chr(100) + chr(0b111000 + 0o55) + chr(0b100011 + 0o100) + chr(0b101001 + 0o106) + '\144' + chr(101))(chr(5988 - 5871) + chr(116) + chr(102) + '\055' + '\070'))(xafqLlk3kkUe(M8EIoTs2GJXE, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9aa\xa5'), '\144' + '\x65' + '\x63' + '\157' + chr(0b1001100 + 0o30) + '\x65')(chr(7813 - 7696) + chr(0b11001 + 0o133) + '\x66' + '\055' + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x99a\xa1\xd1\xd8\x8d \xedB{\xc1\x87\xb01\xa6\xd5\x00\x8d\xfa\xf0g\xe8T\xd5teb\x05\xc9\xc7\x13\x94'), chr(0b1100100) + chr(101) + chr(0b111 + 0o134) + '\157' + chr(5243 - 5143) + chr(0b111000 + 0o55))('\165' + chr(10786 - 10670) + chr(102) + '\x2d' + chr(0b111000)), None), x4pgu5PA4WQW, M8xEnnSGIF9g) A0jYarkTOby2 = M8EIoTs2GJXE.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\x90e\xbf\xdc\xd0\x91)\xd7\\`\xf2\x9e\xa1-\x9f\xdd\x13\x98'), chr(0b100111 + 0o75) + '\145' + chr(0b1100011) + '\157' + chr(100) + chr(101))(chr(0b101 + 0o160) + chr(0b100111 + 0o115) + '\x66' + chr(45) + chr(0b110 + 0o62)), {}) if not A0jYarkTOby2: raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0e\xbf\xdc\xd0\x91)\xa8\\`\xf2\x9e\xa1-\xe0\xdd\x13\x98\xb4\xfaq\x97R\xd7h}~J\x9d\xcc\t\x8e\xf4\xb0\\\x89Ww\x97\x17\x93k\xa5\x9d\xd5\x91c'), '\144' + '\x65' + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b10111 + 0o116))(chr(0b10101 + 0o140) + chr(2849 - 2733) + chr(102) + chr(0b11000 + 0o25) + chr(56))) ISYkzCis8uho = None if xafqLlk3kkUe(TyX845NjZzYy, xafqLlk3kkUe(SXOLrMavuUCe(b'\xafk\xbd\xd8'), chr(0b11 + 0o141) + chr(0b1100101) + '\143' + chr(111) + chr(0b10101 + 0o117) + chr(0b1100101))(chr(7832 - 7715) + chr(0b1110100) + '\146' + chr(0b101101) + chr(0b11101 + 0o33))) is None: ISYkzCis8uho = oVre8I6UXc3b._construct_role(A0jYarkTOby2) TyX845NjZzYy.B6tWx3SQKoGm = ISYkzCis8uho.get_runtime_attr(xafqLlk3kkUe(SXOLrMavuUCe(b'\x9cv\xbf'), '\x64' + chr(0b1100101) + '\143' + '\x6f' + chr(100) + chr(101))('\165' + chr(0b1110100) + chr(0b100110 + 0o100) + chr(0b101101) + chr(2573 - 2517))) xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9ct\xa1\xd8\xd9\x90'), chr(100) + '\x65' + '\143' + chr(111) + chr(0b1100100) + chr(0b1010111 + 0o16))(chr(0b1110101) + '\164' + chr(0b1100110) + chr(1002 - 957) + chr(0b111000)))(ISYkzCis8uho) try: z4Xs9XhDbg00 += oVre8I6UXc3b._generate_event_resources(TyX845NjZzYy, ISYkzCis8uho, M8EIoTs2GJXE[xafqLlk3kkUe(SXOLrMavuUCe(b'\x98r\xb4\xd3\xc3\xab?\xed_`\xeb\x85\xa11\xb3'), chr(1756 - 1656) + chr(101) + chr(5780 - 5681) + '\157' + chr(0b1100100) + chr(101))('\x75' + chr(0b1110001 + 0o3) + chr(0b1100110) + '\x2d' + chr(0b11010 + 0o36))], lambda_alias=x4pgu5PA4WQW) except eXWqlSUlGxPF as GlnVAPeT6CUe: raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb3t\x8b\xcf\x81\xc2\x00\xecng\xc8\xb0'), chr(0b1100100) + '\145' + chr(3785 - 3686) + '\x6f' + chr(0b100110 + 0o76) + chr(101))('\x75' + chr(116) + chr(0b1011000 + 0o16) + chr(0b101101) + chr(0b100110 + 0o22))), xafqLlk3kkUe(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'\x90a\xa2\xce\xd6\x93('), '\144' + '\x65' + chr(4725 - 4626) + chr(111) + '\x64' + '\x65')('\x75' + '\164' + chr(0b110100 + 0o62) + chr(45) + '\070'))) return z4Xs9XhDbg00
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
_get_resolved_alias_name
def _get_resolved_alias_name(self, property_name, original_alias_value, intrinsics_resolver): """ Alias names can be supplied as an intrinsic function. This method tries to extract alias name from a reference to a parameter. If it cannot completely resolve (ie. if a complex intrinsic function was used), then this method raises an exception. If alias name is just a plain string, it will return as is :param dict or string original_alias_value: Value of Alias property as provided by the customer :param samtranslator.intrinsics.resolver.IntrinsicsResolver intrinsics_resolver: Instance of the resolver that knows how to resolve parameter references :return string: Alias name :raises InvalidResourceException: If the value is a complex intrinsic function that cannot be resolved """ # Try to resolve. resolved_alias_name = intrinsics_resolver.resolve_parameter_refs(original_alias_value) if not isinstance(resolved_alias_name, string_types): # This is still a dictionary which means we are not able to completely resolve intrinsics raise InvalidResourceException(self.logical_id, "'{}' must be a string or a Ref to a template parameter" .format(property_name)) return resolved_alias_name
python
def _get_resolved_alias_name(self, property_name, original_alias_value, intrinsics_resolver): """ Alias names can be supplied as an intrinsic function. This method tries to extract alias name from a reference to a parameter. If it cannot completely resolve (ie. if a complex intrinsic function was used), then this method raises an exception. If alias name is just a plain string, it will return as is :param dict or string original_alias_value: Value of Alias property as provided by the customer :param samtranslator.intrinsics.resolver.IntrinsicsResolver intrinsics_resolver: Instance of the resolver that knows how to resolve parameter references :return string: Alias name :raises InvalidResourceException: If the value is a complex intrinsic function that cannot be resolved """ # Try to resolve. resolved_alias_name = intrinsics_resolver.resolve_parameter_refs(original_alias_value) if not isinstance(resolved_alias_name, string_types): # This is still a dictionary which means we are not able to completely resolve intrinsics raise InvalidResourceException(self.logical_id, "'{}' must be a string or a Ref to a template parameter" .format(property_name)) return resolved_alias_name
[ "def", "_get_resolved_alias_name", "(", "self", ",", "property_name", ",", "original_alias_value", ",", "intrinsics_resolver", ")", ":", "# Try to resolve.", "resolved_alias_name", "=", "intrinsics_resolver", ".", "resolve_parameter_refs", "(", "original_alias_value", ")", "if", "not", "isinstance", "(", "resolved_alias_name", ",", "string_types", ")", ":", "# This is still a dictionary which means we are not able to completely resolve intrinsics", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"'{}' must be a string or a Ref to a template parameter\"", ".", "format", "(", "property_name", ")", ")", "return", "resolved_alias_name" ]
Alias names can be supplied as an intrinsic function. This method tries to extract alias name from a reference to a parameter. If it cannot completely resolve (ie. if a complex intrinsic function was used), then this method raises an exception. If alias name is just a plain string, it will return as is :param dict or string original_alias_value: Value of Alias property as provided by the customer :param samtranslator.intrinsics.resolver.IntrinsicsResolver intrinsics_resolver: Instance of the resolver that knows how to resolve parameter references :return string: Alias name :raises InvalidResourceException: If the value is a complex intrinsic function that cannot be resolved
[ "Alias", "names", "can", "be", "supplied", "as", "an", "intrinsic", "function", ".", "This", "method", "tries", "to", "extract", "alias", "name", "from", "a", "reference", "to", "a", "parameter", ".", "If", "it", "cannot", "completely", "resolve", "(", "ie", ".", "if", "a", "complex", "intrinsic", "function", "was", "used", ")", "then", "this", "method", "raises", "an", "exception", ".", "If", "alias", "name", "is", "just", "a", "plain", "string", "it", "will", "return", "as", "is" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L128-L150
train
This method tries to resolve the alias name from a reference to a parameter. If it cannot resolve it raises an exception.
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,_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HaS3Ppej,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) + '\x32' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(54) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(1373 - 1324) + '\x36' + chr(0b110100), 55774 - 55766), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1000 + 0o53) + chr(0b10011 + 0o43) + chr(0b110101), 3150 - 3142), ehT0Px3KOsy9(chr(1156 - 1108) + '\157' + '\062' + chr(55) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(2105 - 2051) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(0b110001) + chr(48) + '\x35', 0b1000), ehT0Px3KOsy9(chr(492 - 444) + '\157' + chr(380 - 329) + chr(1419 - 1365) + '\x34', 0b1000), ehT0Px3KOsy9(chr(98 - 50) + '\x6f' + '\063' + chr(1502 - 1448) + '\064', 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + '\x37' + chr(2027 - 1974), 0o10), ehT0Px3KOsy9('\060' + chr(0b1010 + 0o145) + '\067' + chr(1003 - 954), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(2086 - 2031) + chr(764 - 716), 37885 - 37877), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + '\064' + '\063', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + '\x33' + '\064', 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1010 + 0o145) + '\063' + chr(0b110110) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(978 - 929) + '\x37', 0b1000), ehT0Px3KOsy9('\060' + chr(6630 - 6519) + chr(0b110011) + chr(2341 - 2289) + chr(0b11011 + 0o26), 0o10), ehT0Px3KOsy9(chr(779 - 731) + chr(9395 - 9284) + chr(0b110011) + '\x36' + chr(0b110000), 12791 - 12783), ehT0Px3KOsy9('\060' + chr(0b1001001 + 0o46) + chr(0b100101 + 0o14) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b100001 + 0o116) + '\061' + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + chr(5312 - 5201) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(0b110111) + '\x33', 0o10), ehT0Px3KOsy9(chr(423 - 375) + chr(0b1101111) + chr(2213 - 2162) + '\x36' + '\064', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\067' + '\066', 0o10), ehT0Px3KOsy9(chr(2253 - 2205) + chr(6096 - 5985) + '\x31' + chr(51) + chr(53), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + '\067' + chr(1867 - 1819), 0b1000), ehT0Px3KOsy9(chr(809 - 761) + chr(0b1101111) + chr(48), 0o10), ehT0Px3KOsy9(chr(381 - 333) + chr(0b110110 + 0o71) + chr(51) + chr(0b110101) + '\x36', 0b1000), ehT0Px3KOsy9(chr(1583 - 1535) + chr(0b1101111) + chr(0b10100 + 0o36) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101011 + 0o10) + chr(0b110 + 0o54) + chr(347 - 293), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + chr(49) + chr(0b101000 + 0o15) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\065' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1001 + 0o50) + '\062' + chr(0b110011 + 0o4), 48925 - 48917), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11001 + 0o35) + '\x31', 0o10), ehT0Px3KOsy9(chr(1525 - 1477) + '\157' + '\062' + chr(53) + chr(0b11100 + 0o32), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(501 - 451) + chr(0b110000) + chr(49), 55392 - 55384), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1110 + 0o44) + chr(48), 8), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(111) + chr(117 - 66) + chr(51) + chr(0b1001 + 0o52), 36480 - 36472), ehT0Px3KOsy9('\060' + chr(5018 - 4907) + chr(0b110010) + '\065' + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b10000 + 0o41) + '\060' + chr(53), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(243 - 195) + chr(0b1010010 + 0o35) + chr(0b110101) + chr(998 - 950), 53170 - 53162)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'>'), chr(0b100010 + 0o102) + '\145' + chr(545 - 446) + chr(0b1000001 + 0o56) + chr(515 - 415) + '\x65')(chr(117) + chr(5368 - 5252) + '\x66' + chr(45) + chr(3086 - 3030)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def JOSUz918otAA(oVre8I6UXc3b, MCYpAptUHTCq, YI6Zh5agj9zP, M8xEnnSGIF9g): IE48l5qevcnU = M8xEnnSGIF9g.resolve_parameter_refs(YI6Zh5agj9zP) if not PlSM16l2KDPD(IE48l5qevcnU, sInLJQno9SRQ): raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'^D.\x87\x89\x84\x08\x90\xb6\x95o?'), '\x64' + '\x65' + '\x63' + '\157' + '\x64' + chr(0b1000100 + 0o41))(chr(0b1110101) + chr(116) + '\146' + chr(0b101101) + '\070')), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'7O\t\xd2\x9f\xdf0\x87\x80\xdd[\x1dC\xfd\xd2<\x95\x82fe`\xdb\x9b\x0c}\x99 \xbcs\xb0I[8\x11\xcf\xa1d\xbe\xc05|U\x00\x90\x9f\xc2$\x86\x95\x90\\\x0c\x06\xee'), '\144' + '\145' + '\143' + chr(0b1011111 + 0o20) + chr(3454 - 3354) + '\145')(chr(0b101111 + 0o106) + '\164' + chr(0b1100110) + chr(912 - 867) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'F\x00\x06\x9a\xf7\xd3\x16\xc7\xa4\x8d\\\x12'), '\144' + '\145' + chr(6908 - 6809) + chr(0b1100100 + 0o13) + chr(0b11000 + 0o114) + chr(101))(chr(6247 - 6130) + chr(116) + '\x66' + chr(852 - 807) + '\070'))(MCYpAptUHTCq)) return IE48l5qevcnU
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
_construct_lambda_function
def _construct_lambda_function(self): """Constructs and returns the Lambda function. :returns: a list containing the Lambda function and execution role resources :rtype: list """ lambda_function = LambdaFunction(self.logical_id, depends_on=self.depends_on, attributes=self.resource_attributes) if self.FunctionName: lambda_function.FunctionName = self.FunctionName lambda_function.Handler = self.Handler lambda_function.Runtime = self.Runtime lambda_function.Description = self.Description lambda_function.MemorySize = self.MemorySize lambda_function.Timeout = self.Timeout lambda_function.VpcConfig = self.VpcConfig lambda_function.Role = self.Role lambda_function.Environment = self.Environment lambda_function.Code = self._construct_code_dict() lambda_function.KmsKeyArn = self.KmsKeyArn lambda_function.ReservedConcurrentExecutions = self.ReservedConcurrentExecutions lambda_function.Tags = self._construct_tag_list(self.Tags) lambda_function.Layers = self.Layers if self.Tracing: lambda_function.TracingConfig = {"Mode": self.Tracing} if self.DeadLetterQueue: lambda_function.DeadLetterConfig = {"TargetArn": self.DeadLetterQueue['TargetArn']} return lambda_function
python
def _construct_lambda_function(self): """Constructs and returns the Lambda function. :returns: a list containing the Lambda function and execution role resources :rtype: list """ lambda_function = LambdaFunction(self.logical_id, depends_on=self.depends_on, attributes=self.resource_attributes) if self.FunctionName: lambda_function.FunctionName = self.FunctionName lambda_function.Handler = self.Handler lambda_function.Runtime = self.Runtime lambda_function.Description = self.Description lambda_function.MemorySize = self.MemorySize lambda_function.Timeout = self.Timeout lambda_function.VpcConfig = self.VpcConfig lambda_function.Role = self.Role lambda_function.Environment = self.Environment lambda_function.Code = self._construct_code_dict() lambda_function.KmsKeyArn = self.KmsKeyArn lambda_function.ReservedConcurrentExecutions = self.ReservedConcurrentExecutions lambda_function.Tags = self._construct_tag_list(self.Tags) lambda_function.Layers = self.Layers if self.Tracing: lambda_function.TracingConfig = {"Mode": self.Tracing} if self.DeadLetterQueue: lambda_function.DeadLetterConfig = {"TargetArn": self.DeadLetterQueue['TargetArn']} return lambda_function
[ "def", "_construct_lambda_function", "(", "self", ")", ":", "lambda_function", "=", "LambdaFunction", "(", "self", ".", "logical_id", ",", "depends_on", "=", "self", ".", "depends_on", ",", "attributes", "=", "self", ".", "resource_attributes", ")", "if", "self", ".", "FunctionName", ":", "lambda_function", ".", "FunctionName", "=", "self", ".", "FunctionName", "lambda_function", ".", "Handler", "=", "self", ".", "Handler", "lambda_function", ".", "Runtime", "=", "self", ".", "Runtime", "lambda_function", ".", "Description", "=", "self", ".", "Description", "lambda_function", ".", "MemorySize", "=", "self", ".", "MemorySize", "lambda_function", ".", "Timeout", "=", "self", ".", "Timeout", "lambda_function", ".", "VpcConfig", "=", "self", ".", "VpcConfig", "lambda_function", ".", "Role", "=", "self", ".", "Role", "lambda_function", ".", "Environment", "=", "self", ".", "Environment", "lambda_function", ".", "Code", "=", "self", ".", "_construct_code_dict", "(", ")", "lambda_function", ".", "KmsKeyArn", "=", "self", ".", "KmsKeyArn", "lambda_function", ".", "ReservedConcurrentExecutions", "=", "self", ".", "ReservedConcurrentExecutions", "lambda_function", ".", "Tags", "=", "self", ".", "_construct_tag_list", "(", "self", ".", "Tags", ")", "lambda_function", ".", "Layers", "=", "self", ".", "Layers", "if", "self", ".", "Tracing", ":", "lambda_function", ".", "TracingConfig", "=", "{", "\"Mode\"", ":", "self", ".", "Tracing", "}", "if", "self", ".", "DeadLetterQueue", ":", "lambda_function", ".", "DeadLetterConfig", "=", "{", "\"TargetArn\"", ":", "self", ".", "DeadLetterQueue", "[", "'TargetArn'", "]", "}", "return", "lambda_function" ]
Constructs and returns the Lambda function. :returns: a list containing the Lambda function and execution role resources :rtype: list
[ "Constructs", "and", "returns", "the", "Lambda", "function", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L152-L184
train
Constructs and returns the Lambda function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkc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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('\x30' + '\x6f' + '\061' + '\x35' + chr(0b100110 + 0o15), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(0b1010 + 0o52) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(10973 - 10862) + chr(330 - 280) + '\x30' + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(2312 - 2201) + chr(1585 - 1536) + '\064' + chr(0b110010), 36077 - 36069), ehT0Px3KOsy9('\x30' + '\157' + '\061' + '\065' + chr(0b10100 + 0o34), 57315 - 57307), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + '\063' + chr(49), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(2292 - 2238) + chr(1631 - 1580), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x35' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1011 + 0o47) + chr(0b1110 + 0o42) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x35' + chr(1462 - 1411), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(1652 - 1602) + chr(2953 - 2898) + chr(186 - 134), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\x6f' + chr(784 - 735) + chr(0b110101) + chr(54), 64996 - 64988), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\157' + chr(1388 - 1337) + '\066' + '\x36', 0o10), ehT0Px3KOsy9(chr(323 - 275) + chr(111) + chr(0b110001) + chr(2475 - 2421) + chr(2151 - 2101), 0b1000), ehT0Px3KOsy9('\x30' + chr(3049 - 2938) + chr(0b110011) + '\062' + chr(1711 - 1660), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b110011 + 0o74) + '\x31' + '\064' + chr(0b110001), 22215 - 22207), ehT0Px3KOsy9('\060' + chr(5637 - 5526) + '\061' + '\066' + chr(49), 21936 - 21928), ehT0Px3KOsy9('\x30' + chr(0b1100101 + 0o12) + '\063' + chr(0b11111 + 0o27) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b110101) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(1518 - 1470) + '\x6f' + chr(53) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(992 - 944) + '\x6f' + chr(1229 - 1180) + chr(50) + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + chr(3524 - 3413) + '\061' + chr(49) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(2057 - 2008) + chr(48) + chr(0b11101 + 0o26), 34961 - 34953), ehT0Px3KOsy9(chr(1668 - 1620) + chr(0b1100101 + 0o12) + chr(0b111 + 0o52) + chr(996 - 943) + '\x37', 0o10), ehT0Px3KOsy9(chr(2089 - 2041) + '\x6f' + chr(49) + chr(48) + '\x33', 8), ehT0Px3KOsy9(chr(629 - 581) + chr(0b1011011 + 0o24) + chr(0b10101 + 0o41) + chr(54), 28485 - 28477), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(0b1001 + 0o52) + chr(0b101101 + 0o3), 0b1000), ehT0Px3KOsy9('\060' + chr(0b11010 + 0o125) + chr(428 - 378) + chr(48) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101 + 0o142) + chr(0b11100 + 0o27) + chr(0b10110 + 0o35) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(50) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110 + 0o55) + '\x31' + chr(0b1000 + 0o57), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2364 - 2315) + chr(0b110011) + chr(160 - 108), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(0b110011) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(1355 - 1302), 17575 - 17567), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(51) + chr(1778 - 1730), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b111111 + 0o60) + '\x33' + '\062' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1101111) + chr(0b110011 + 0o2) + '\x37', 39500 - 39492), ehT0Px3KOsy9(chr(48) + chr(0b100100 + 0o113) + chr(0b110001 + 0o0) + '\062', 43866 - 43858), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101101 + 0o2) + '\x37' + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(1668 - 1619) + chr(0b110010) + chr(0b110011), 57367 - 57359)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + chr(1215 - 1162) + chr(1962 - 1914), 54118 - 54110)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'E'), chr(7496 - 7396) + chr(9668 - 9567) + chr(99) + '\x6f' + chr(100) + '\x65')('\165' + chr(0b1110100) + chr(8308 - 8206) + '\x2d' + chr(2966 - 2910)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Mi9fLYvy3vdn(oVre8I6UXc3b): TyX845NjZzYy = OJgntXj3DOOS(oVre8I6UXc3b.NpZr66MdBhVG, depends_on=oVre8I6UXc3b.oayEYOknteBp, attributes=oVre8I6UXc3b.x7ddN_ki5nGn) if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a\xb2\xea\x03=\x94\xe2O\xd7b\xf7,'), '\x64' + chr(101) + chr(6436 - 6337) + chr(111) + chr(0b100101 + 0o77) + chr(0b1010101 + 0o20))(chr(0b1110101) + '\164' + chr(0b1100110) + '\x2d' + chr(0b111000 + 0o0))): TyX845NjZzYy.qUoaUMQeQIKB = oVre8I6UXc3b.qUoaUMQeQIKB TyX845NjZzYy.KcRWUBrMnefA = oVre8I6UXc3b.KcRWUBrMnefA TyX845NjZzYy.R4wKVceEz1H2 = oVre8I6UXc3b.R4wKVceEz1H2 TyX845NjZzYy.Gg5N_G5JhGDN = oVre8I6UXc3b.Gg5N_G5JhGDN TyX845NjZzYy.Erg_IAnOryLi = oVre8I6UXc3b.Erg_IAnOryLi TyX845NjZzYy.Xffnr6gMcYcK = oVre8I6UXc3b.Xffnr6gMcYcK TyX845NjZzYy.U7_J9KG_t1RZ = oVre8I6UXc3b.U7_J9KG_t1RZ TyX845NjZzYy.B6tWx3SQKoGm = oVre8I6UXc3b.B6tWx3SQKoGm TyX845NjZzYy.MVflWkM2uT1F = oVre8I6UXc3b.MVflWkM2uT1F TyX845NjZzYy.qsFcgZaZK0sp = oVre8I6UXc3b._construct_code_dict() TyX845NjZzYy.mzjX_E4ETP6k = oVre8I6UXc3b.mzjX_E4ETP6k TyX845NjZzYy.rIGc7gnoHOw_ = oVre8I6UXc3b.rIGc7gnoHOw_ TyX845NjZzYy.xQN6xY3huZ18 = oVre8I6UXc3b._construct_tag_list(oVre8I6UXc3b.xQN6xY3huZ18) TyX845NjZzYy.ZR6hnwRaGwpr = oVre8I6UXc3b.ZR6hnwRaGwpr if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'?\x95\xe4\x01\x01\xb7\xd4'), chr(0b1100100) + '\145' + chr(99) + chr(111) + chr(0b101100 + 0o70) + chr(4121 - 4020))(chr(0b1110101) + chr(6713 - 6597) + chr(4357 - 4255) + chr(1659 - 1614) + chr(1141 - 1085))): TyX845NjZzYy.vMrz0J7BBXOU = {xafqLlk3kkUe(SXOLrMavuUCe(b'&\x88\xe1\x07'), '\144' + '\145' + '\x63' + chr(0b1101111) + '\144' + chr(0b1011100 + 0o11))(chr(0b1110101) + chr(116) + chr(1327 - 1225) + chr(45) + '\070'): oVre8I6UXc3b.Tracing} if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'/\x82\xe4\x06$\xbc\xc7^\xe3Y\xed\x1b\x93\x07\xb6'), chr(0b1100100) + chr(7521 - 7420) + '\143' + chr(0b1101111) + '\144' + '\145')(chr(117) + chr(1985 - 1869) + '\146' + chr(0b101101) + chr(0b111000))): TyX845NjZzYy.edTHFKs3If6H = {xafqLlk3kkUe(SXOLrMavuUCe(b'?\x86\xf7\x05\r\xad\xf2X\xe8'), chr(0b11 + 0o141) + chr(0b1011111 + 0o6) + chr(1321 - 1222) + chr(111) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(0b1110100) + '\146' + chr(1954 - 1909) + chr(56)): oVre8I6UXc3b.DeadLetterQueue[xafqLlk3kkUe(SXOLrMavuUCe(b'?\x86\xf7\x05\r\xad\xf2X\xe8'), '\144' + chr(6115 - 6014) + '\143' + chr(146 - 35) + '\x64' + chr(3252 - 3151))('\x75' + '\164' + '\x66' + chr(0b101101) + '\070')]} return TyX845NjZzYy
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
_construct_role
def _construct_role(self, managed_policy_map): """Constructs a Lambda execution role based on this SAM function's Policies property. :returns: the generated IAM Role :rtype: model.iam.IAMRole """ execution_role = IAMRole(self.logical_id + 'Role', attributes=self.get_passthrough_resource_attributes()) execution_role.AssumeRolePolicyDocument = IAMRolePolicies.lambda_assume_role_policy() managed_policy_arns = [ArnGenerator.generate_aws_managed_policy_arn('service-role/AWSLambdaBasicExecutionRole')] if self.Tracing: managed_policy_arns.append(ArnGenerator.generate_aws_managed_policy_arn('AWSXrayWriteOnlyAccess')) function_policies = FunctionPolicies({"Policies": self.Policies}, # No support for policy templates in the "core" policy_template_processor=None) policy_documents = [] if self.DeadLetterQueue: policy_documents.append(IAMRolePolicies.dead_letter_queue_policy( self.dead_letter_queue_policy_actions[self.DeadLetterQueue['Type']], self.DeadLetterQueue['TargetArn'])) for index, policy_entry in enumerate(function_policies.get()): if policy_entry.type is PolicyTypes.POLICY_STATEMENT: policy_documents.append({ 'PolicyName': execution_role.logical_id + 'Policy' + str(index), 'PolicyDocument': policy_entry.data }) elif policy_entry.type is PolicyTypes.MANAGED_POLICY: # There are three options: # Managed Policy Name (string): Try to convert to Managed Policy ARN # Managed Policy Arn (string): Insert it directly into the list # Intrinsic Function (dict): Insert it directly into the list # # When you insert into managed_policy_arns list, de-dupe to prevent same ARN from showing up twice # policy_arn = policy_entry.data if isinstance(policy_entry.data, string_types) and policy_entry.data in managed_policy_map: policy_arn = managed_policy_map[policy_entry.data] # De-Duplicate managed policy arns before inserting. Mainly useful # when customer specifies a managed policy which is already inserted # by SAM, such as AWSLambdaBasicExecutionRole if policy_arn not in managed_policy_arns: managed_policy_arns.append(policy_arn) else: # Policy Templates are not supported here in the "core" raise InvalidResourceException( self.logical_id, "Policy at index {} in the 'Policies' property is not valid".format(index)) execution_role.ManagedPolicyArns = list(managed_policy_arns) execution_role.Policies = policy_documents or None execution_role.PermissionsBoundary = self.PermissionsBoundary return execution_role
python
def _construct_role(self, managed_policy_map): """Constructs a Lambda execution role based on this SAM function's Policies property. :returns: the generated IAM Role :rtype: model.iam.IAMRole """ execution_role = IAMRole(self.logical_id + 'Role', attributes=self.get_passthrough_resource_attributes()) execution_role.AssumeRolePolicyDocument = IAMRolePolicies.lambda_assume_role_policy() managed_policy_arns = [ArnGenerator.generate_aws_managed_policy_arn('service-role/AWSLambdaBasicExecutionRole')] if self.Tracing: managed_policy_arns.append(ArnGenerator.generate_aws_managed_policy_arn('AWSXrayWriteOnlyAccess')) function_policies = FunctionPolicies({"Policies": self.Policies}, # No support for policy templates in the "core" policy_template_processor=None) policy_documents = [] if self.DeadLetterQueue: policy_documents.append(IAMRolePolicies.dead_letter_queue_policy( self.dead_letter_queue_policy_actions[self.DeadLetterQueue['Type']], self.DeadLetterQueue['TargetArn'])) for index, policy_entry in enumerate(function_policies.get()): if policy_entry.type is PolicyTypes.POLICY_STATEMENT: policy_documents.append({ 'PolicyName': execution_role.logical_id + 'Policy' + str(index), 'PolicyDocument': policy_entry.data }) elif policy_entry.type is PolicyTypes.MANAGED_POLICY: # There are three options: # Managed Policy Name (string): Try to convert to Managed Policy ARN # Managed Policy Arn (string): Insert it directly into the list # Intrinsic Function (dict): Insert it directly into the list # # When you insert into managed_policy_arns list, de-dupe to prevent same ARN from showing up twice # policy_arn = policy_entry.data if isinstance(policy_entry.data, string_types) and policy_entry.data in managed_policy_map: policy_arn = managed_policy_map[policy_entry.data] # De-Duplicate managed policy arns before inserting. Mainly useful # when customer specifies a managed policy which is already inserted # by SAM, such as AWSLambdaBasicExecutionRole if policy_arn not in managed_policy_arns: managed_policy_arns.append(policy_arn) else: # Policy Templates are not supported here in the "core" raise InvalidResourceException( self.logical_id, "Policy at index {} in the 'Policies' property is not valid".format(index)) execution_role.ManagedPolicyArns = list(managed_policy_arns) execution_role.Policies = policy_documents or None execution_role.PermissionsBoundary = self.PermissionsBoundary return execution_role
[ "def", "_construct_role", "(", "self", ",", "managed_policy_map", ")", ":", "execution_role", "=", "IAMRole", "(", "self", ".", "logical_id", "+", "'Role'", ",", "attributes", "=", "self", ".", "get_passthrough_resource_attributes", "(", ")", ")", "execution_role", ".", "AssumeRolePolicyDocument", "=", "IAMRolePolicies", ".", "lambda_assume_role_policy", "(", ")", "managed_policy_arns", "=", "[", "ArnGenerator", ".", "generate_aws_managed_policy_arn", "(", "'service-role/AWSLambdaBasicExecutionRole'", ")", "]", "if", "self", ".", "Tracing", ":", "managed_policy_arns", ".", "append", "(", "ArnGenerator", ".", "generate_aws_managed_policy_arn", "(", "'AWSXrayWriteOnlyAccess'", ")", ")", "function_policies", "=", "FunctionPolicies", "(", "{", "\"Policies\"", ":", "self", ".", "Policies", "}", ",", "# No support for policy templates in the \"core\"", "policy_template_processor", "=", "None", ")", "policy_documents", "=", "[", "]", "if", "self", ".", "DeadLetterQueue", ":", "policy_documents", ".", "append", "(", "IAMRolePolicies", ".", "dead_letter_queue_policy", "(", "self", ".", "dead_letter_queue_policy_actions", "[", "self", ".", "DeadLetterQueue", "[", "'Type'", "]", "]", ",", "self", ".", "DeadLetterQueue", "[", "'TargetArn'", "]", ")", ")", "for", "index", ",", "policy_entry", "in", "enumerate", "(", "function_policies", ".", "get", "(", ")", ")", ":", "if", "policy_entry", ".", "type", "is", "PolicyTypes", ".", "POLICY_STATEMENT", ":", "policy_documents", ".", "append", "(", "{", "'PolicyName'", ":", "execution_role", ".", "logical_id", "+", "'Policy'", "+", "str", "(", "index", ")", ",", "'PolicyDocument'", ":", "policy_entry", ".", "data", "}", ")", "elif", "policy_entry", ".", "type", "is", "PolicyTypes", ".", "MANAGED_POLICY", ":", "# There are three options:", "# Managed Policy Name (string): Try to convert to Managed Policy ARN", "# Managed Policy Arn (string): Insert it directly into the list", "# Intrinsic Function (dict): Insert it directly into the list", "#", "# When you insert into managed_policy_arns list, de-dupe to prevent same ARN from showing up twice", "#", "policy_arn", "=", "policy_entry", ".", "data", "if", "isinstance", "(", "policy_entry", ".", "data", ",", "string_types", ")", "and", "policy_entry", ".", "data", "in", "managed_policy_map", ":", "policy_arn", "=", "managed_policy_map", "[", "policy_entry", ".", "data", "]", "# De-Duplicate managed policy arns before inserting. Mainly useful", "# when customer specifies a managed policy which is already inserted", "# by SAM, such as AWSLambdaBasicExecutionRole", "if", "policy_arn", "not", "in", "managed_policy_arns", ":", "managed_policy_arns", ".", "append", "(", "policy_arn", ")", "else", ":", "# Policy Templates are not supported here in the \"core\"", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"Policy at index {} in the 'Policies' property is not valid\"", ".", "format", "(", "index", ")", ")", "execution_role", ".", "ManagedPolicyArns", "=", "list", "(", "managed_policy_arns", ")", "execution_role", ".", "Policies", "=", "policy_documents", "or", "None", "execution_role", ".", "PermissionsBoundary", "=", "self", ".", "PermissionsBoundary", "return", "execution_role" ]
Constructs a Lambda execution role based on this SAM function's Policies property. :returns: the generated IAM Role :rtype: model.iam.IAMRole
[ "Constructs", "a", "Lambda", "execution", "role", "based", "on", "this", "SAM", "function", "s", "Policies", "property", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L186-L246
train
Constructs a Lambda execution role based on this SAM function s Policies property.
Pu7Z6IJCgH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KLA6,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(0b11110 + 0o22) + chr(3612 - 3501) + '\062' + chr(0b100101 + 0o21) + chr(693 - 641), 0o10), ehT0Px3KOsy9('\060' + chr(9517 - 9406) + chr(0b100011 + 0o17) + chr(52) + chr(0b10100 + 0o43), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101011 + 0o10) + chr(48) + chr(1841 - 1789), 0o10), ehT0Px3KOsy9(chr(958 - 910) + chr(111) + chr(588 - 537) + '\x34' + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(48) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + chr(0b11000 + 0o36) + chr(419 - 364), ord("\x08")), ehT0Px3KOsy9(chr(241 - 193) + chr(111) + '\063' + chr(51) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + chr(0b110010) + chr(55) + chr(510 - 457), 0b1000), ehT0Px3KOsy9(chr(1209 - 1161) + chr(0b1101111) + '\066' + '\062', ord("\x08")), ehT0Px3KOsy9('\060' + chr(9197 - 9086) + chr(0b100111 + 0o12) + chr(0b110010) + '\062', 40559 - 40551), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\x6f' + chr(259 - 209) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(0b1010011 + 0o34) + chr(2172 - 2122) + '\x32' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(985 - 936) + chr(2275 - 2222) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + chr(0b10001 + 0o41) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + chr(0b110001) + '\x33' + chr(0b110001), 31185 - 31177), ehT0Px3KOsy9(chr(0b110000) + chr(630 - 519) + chr(0b110001) + '\x33' + chr(750 - 701), 8), ehT0Px3KOsy9(chr(0b110000) + chr(3837 - 3726) + chr(0b110011) + '\062' + chr(271 - 217), 19937 - 19929), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + '\x33' + '\066' + chr(1444 - 1393), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(719 - 670) + chr(0b10100 + 0o41) + chr(2350 - 2297), 39044 - 39036), ehT0Px3KOsy9('\x30' + '\157' + '\066' + '\061', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(0b101011 + 0o13) + chr(0b110101), 38382 - 38374), ehT0Px3KOsy9('\x30' + chr(0b11101 + 0o122) + chr(0b100011 + 0o16) + '\x32' + chr(2583 - 2528), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011101 + 0o22) + '\x36' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(1946 - 1898) + chr(0b1101111) + chr(1260 - 1210) + '\067' + chr(0b110001), 12015 - 12007), ehT0Px3KOsy9('\060' + chr(8700 - 8589) + chr(49) + chr(0b101 + 0o60) + chr(0b10011 + 0o43), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(494 - 443) + '\065' + '\x35', 16825 - 16817), ehT0Px3KOsy9('\060' + chr(0b1100001 + 0o16) + chr(0b110010 + 0o0) + chr(1731 - 1679) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b10000 + 0o137) + '\x31' + chr(0b10101 + 0o40), 0o10), ehT0Px3KOsy9('\x30' + chr(8611 - 8500) + '\x32' + chr(0b110011) + chr(2130 - 2078), ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(111) + chr(0b110010) + chr(0b110111) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + chr(789 - 678) + '\063' + '\062' + chr(1512 - 1461), 0o10), ehT0Px3KOsy9(chr(1307 - 1259) + chr(644 - 533) + chr(0b110011) + '\x36' + chr(830 - 775), 8115 - 8107), ehT0Px3KOsy9(chr(953 - 905) + chr(0b1010101 + 0o32) + '\061' + chr(0b110000) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(111) + chr(0b110011) + chr(0b1010 + 0o50) + '\064', 37408 - 37400), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101011 + 0o6) + chr(2212 - 2164) + '\060', 30545 - 30537), ehT0Px3KOsy9('\060' + '\157' + chr(1244 - 1194) + '\x36' + '\064', 8), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(49) + '\x37' + chr(0b100010 + 0o20), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(0b110111) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(502 - 454) + chr(0b1010110 + 0o31) + chr(51) + chr(54) + chr(0b110011), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(2689 - 2637), 51985 - 51977)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110101) + chr(1916 - 1868), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x9a'), '\x64' + chr(8906 - 8805) + '\x63' + '\157' + chr(100) + '\x65')(chr(0b1001010 + 0o53) + chr(11629 - 11513) + chr(0b1100110) + chr(45) + chr(1549 - 1493)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def AJbNJIr5bsyX(oVre8I6UXc3b, A0jYarkTOby2): ISYkzCis8uho = K6sPpCvESmlV(oVre8I6UXc3b.NpZr66MdBhVG + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6\xc8\xa8\x83'), chr(0b1100100) + chr(101) + chr(0b1010100 + 0o17) + '\x6f' + chr(0b1100100) + chr(101))(chr(117) + '\164' + chr(102) + chr(0b101101) + '\x38'), attributes=oVre8I6UXc3b.get_passthrough_resource_attributes()) ISYkzCis8uho.pmEax42mwUrC = PeoCicDlCySq.lambda_assume_role_policy() XzTt3zGfhOS9 = [CuA6J2AA1iJi.generate_aws_managed_policy_arn(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc7\xc2\xb6\x90.\x14\xb8\x90@=z\xf1GR\x0e\n\x9a\x92\x00S\x916r\xd8\x1d\x84\xc0H\xe4\xda\xb0\x825\xbd/\xda(\x16\x9fa'), chr(0b1100100) + chr(0b1001011 + 0o32) + '\x63' + chr(0b1101111) + chr(0b1110 + 0o126) + '\x65')(chr(9620 - 9503) + chr(0b1110100) + '\146' + chr(0b101101) + chr(0b100011 + 0o25)))] if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0\xd5\xa5\x85.\x19\xba'), '\144' + '\145' + chr(0b110000 + 0o63) + chr(111) + chr(0b11 + 0o141) + chr(0b1100101))('\x75' + '\164' + chr(10331 - 10229) + chr(45) + chr(691 - 635))): xafqLlk3kkUe(XzTt3zGfhOS9, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5\xd7\xb4\x83)\x13'), '\144' + chr(0b1100101) + chr(0b11000 + 0o113) + chr(0b1101111) + chr(4712 - 4612) + chr(101))(chr(0b101 + 0o160) + '\x74' + '\146' + chr(590 - 545) + chr(0b111000)))(xafqLlk3kkUe(CuA6J2AA1iJi, xafqLlk3kkUe(SXOLrMavuUCe(b"\xd3\xc2\xaa\x835\x16\xa9\xd8m3a\xe77~87\xb7\x94\x08U\xaa'_\xd5\x07\x8e\xdaR\xfd\xcd\xbd"), chr(8519 - 8419) + chr(101) + '\143' + chr(0b1001001 + 0o46) + '\x64' + chr(0b1100101))(chr(0b110001 + 0o104) + '\x74' + '\146' + chr(45) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b"\xf5\xf0\x97\xbe5\x16\xa4\xea@;b\xf1'}5 \x97\x90\x0eT\x86$"), chr(100) + '\145' + chr(0b1001000 + 0o33) + '\157' + chr(0b1000 + 0o134) + chr(4013 - 3912))(chr(0b1110101) + chr(0b101 + 0o157) + '\x66' + chr(45) + '\x38'))) aPGD38ExPbsX = d8XWLwSMJ1m_({xafqLlk3kkUe(SXOLrMavuUCe(b'\xe4\xc8\xa8\x8f$\x1e\xb8\xce'), '\144' + chr(0b1100001 + 0o4) + chr(0b1100011) + chr(0b1011101 + 0o22) + chr(2919 - 2819) + '\145')('\165' + chr(116) + '\146' + chr(45) + chr(56)): oVre8I6UXc3b.Policies}, policy_template_processor=None) E569CrKExQ5K = [] if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf0\xc2\xa5\x82\x0b\x12\xa9\xc9W G\xe1\rf<'), chr(2582 - 2482) + chr(0b100000 + 0o105) + chr(2471 - 2372) + chr(0b100010 + 0o115) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\146' + '\x2d' + chr(56))): xafqLlk3kkUe(E569CrKExQ5K, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5\xd7\xb4\x83)\x13'), '\144' + chr(101) + chr(99) + chr(0b110110 + 0o71) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b0 + 0o146) + chr(0b100100 + 0o11) + chr(56)))(xafqLlk3kkUe(PeoCicDlCySq, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd0\xc2\xa5\x82\x18\x1b\xb8\xc9F7d\xcb\x19f<,\xb3\xac\x1d^\x99>S\xc0'), chr(0b110011 + 0o61) + chr(5921 - 5820) + chr(0b1100011) + chr(232 - 121) + chr(100) + chr(0b11111 + 0o106))('\165' + '\164' + chr(0b1011001 + 0o15) + chr(45) + chr(0b111000)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd0\xc2\xa5\x82\x18\x1b\xb8\xc9F7d\xcb\x19f<,\xb3\xac\x1d^\x99>S\xc01\x8c\xc0y\xf5\xd0\xbd\x84'), chr(0b110101 + 0o57) + chr(0b10110 + 0o117) + chr(0b11 + 0o140) + chr(5414 - 5303) + chr(100) + chr(0b0 + 0o145))(chr(117) + '\x74' + chr(102) + chr(1586 - 1541) + '\070'))[xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf0\xc2\xa5\x82\x0b\x12\xa9\xc9W G\xe1\rf<'), chr(100) + chr(0b1100101) + chr(4542 - 4443) + chr(11031 - 10920) + '\x64' + '\145')(chr(0b1110101) + chr(0b101011 + 0o111) + chr(102) + chr(1452 - 1407) + chr(1234 - 1178)))[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0\xde\xb4\x83'), chr(100) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b10111 + 0o115) + chr(101))('\x75' + '\x74' + '\x66' + chr(0b101101) + chr(56))]], xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf0\xc2\xa5\x82\x0b\x12\xa9\xc9W G\xe1\rf<'), '\x64' + chr(101) + '\x63' + chr(0b1100010 + 0o15) + chr(545 - 445) + '\145')('\165' + chr(116) + chr(9145 - 9043) + chr(460 - 415) + '\x38'))[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0\xc6\xb6\x81"\x03\x9c\xcf\\'), chr(0b1100100) + chr(0b1100010 + 0o3) + chr(99) + chr(0b111001 + 0o66) + chr(7218 - 7118) + '\x65')(chr(117) + '\x74' + chr(4115 - 4013) + chr(0b1101 + 0o40) + chr(56))])) for (XdowRbJKZWL9, W8gif_57JI2i) in YlkZvXL8qwsX(xafqLlk3kkUe(aPGD38ExPbsX, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3\xc2\xb0'), chr(0b1011000 + 0o14) + '\145' + chr(99) + '\x6f' + '\144' + '\x65')(chr(117) + chr(4737 - 4621) + chr(8730 - 8628) + chr(0b11001 + 0o24) + chr(0b111000)))()): if xafqLlk3kkUe(W8gif_57JI2i, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3\xca\x95\x8b>\x12\x8a\xff_\x07f\xe2'), '\144' + '\x65' + chr(1001 - 902) + chr(0b1101111) + chr(0b1000111 + 0o35) + '\145')(chr(0b1100100 + 0o21) + chr(0b1110100) + chr(0b1011101 + 0o11) + chr(694 - 649) + '\070')) is xafqLlk3kkUe(YDHMfN5EeoKo, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe4\xe8\x88\xaf\x04.\x82\xeef\x13B\xd1%V\x17\r'), '\144' + chr(6083 - 5982) + chr(0b1100011) + '\157' + chr(0b10110 + 0o116) + '\x65')(chr(117) + '\x74' + chr(102) + '\x2d' + chr(56))): xafqLlk3kkUe(E569CrKExQ5K, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5\xd7\xb4\x83)\x13'), chr(100) + chr(0b1000 + 0o135) + chr(0b1100011) + chr(5861 - 5750) + chr(8863 - 8763) + '\x65')(chr(0b1110101) + '\x74' + '\x66' + chr(56 - 11) + chr(2245 - 2189)))({xafqLlk3kkUe(SXOLrMavuUCe(b'\xe4\xc8\xa8\x8f$\x0e\x93\xdc_7'), chr(100) + chr(101) + '\143' + chr(4095 - 3984) + '\144' + '\x65')(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(45) + '\x38'): xafqLlk3kkUe(ISYkzCis8uho, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa\xd7\x9e\x94qA\x90\xd9p:@\xd3'), chr(3351 - 3251) + chr(101) + '\143' + chr(111) + '\x64' + chr(101))(chr(11570 - 11453) + '\x74' + chr(0b1011100 + 0o12) + chr(0b100000 + 0o15) + chr(56))) + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe4\xc8\xa8\x8f$\x0e'), chr(0b100110 + 0o76) + chr(2701 - 2600) + chr(99) + chr(0b1101111) + chr(2634 - 2534) + chr(101))(chr(1037 - 920) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b100 + 0o64)) + M8_cKLkHVB2V(XdowRbJKZWL9), xafqLlk3kkUe(SXOLrMavuUCe(b"\xe4\xc8\xa8\x8f$\x0e\x99\xd2Q'{\xf1\x06g"), chr(0b111111 + 0o45) + chr(0b110111 + 0o56) + chr(0b1100011) + chr(111) + chr(0b1011100 + 0o10) + chr(0b1100101))(chr(4459 - 4342) + '\164' + '\x66' + '\055' + '\070'): xafqLlk3kkUe(W8gif_57JI2i, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1\xeb\xaa\x8c7A\x99\x8bW4P\xdc'), chr(100) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(0b10101 + 0o117) + chr(6549 - 6448))(chr(0b1110101) + chr(12412 - 12296) + chr(0b111 + 0o137) + chr(45) + '\070'))}) elif xafqLlk3kkUe(W8gif_57JI2i, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3\xca\x95\x8b>\x12\x8a\xff_\x07f\xe2'), chr(294 - 194) + chr(8280 - 8179) + chr(99) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(117) + chr(0b1110100) + chr(102) + chr(0b101101 + 0o0) + '\070')) is xafqLlk3kkUe(YDHMfN5EeoKo, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9\xe6\x8a\xa7\x002\x99\xe2b\x1dZ\xdd+J'), '\144' + chr(101) + '\143' + chr(11383 - 11272) + chr(100) + chr(7046 - 6945))(chr(0b1000001 + 0o64) + chr(0b1110100) + chr(7536 - 7434) + chr(0b100011 + 0o12) + chr(0b111000))): eXAM2R1xev5X = W8gif_57JI2i.ULnjp6D6efFH if PlSM16l2KDPD(xafqLlk3kkUe(W8gif_57JI2i, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1\xeb\xaa\x8c7A\x99\x8bW4P\xdc'), '\144' + '\x65' + chr(0b1100011) + '\x6f' + '\144' + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(283 - 227))), sInLJQno9SRQ) and xafqLlk3kkUe(W8gif_57JI2i, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1\xeb\xaa\x8c7A\x99\x8bW4P\xdc'), chr(100) + chr(0b1100101) + chr(99) + chr(0b1101111) + '\144' + chr(101))('\165' + chr(6011 - 5895) + chr(102) + chr(520 - 475) + chr(0b100010 + 0o26))) in A0jYarkTOby2: eXAM2R1xev5X = A0jYarkTOby2[W8gif_57JI2i.ULnjp6D6efFH] if eXAM2R1xev5X not in XzTt3zGfhOS9: xafqLlk3kkUe(XzTt3zGfhOS9, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5\xd7\xb4\x83)\x13'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(6136 - 6025) + chr(0b10001 + 0o123) + chr(0b1100101))(chr(117) + chr(1603 - 1487) + chr(0b1011001 + 0o15) + chr(1917 - 1872) + '\070'))(eXAM2R1xev5X) else: raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa\xd7\x9e\x94qA\x90\xd9p:@\xd3'), '\x64' + chr(101) + chr(1069 - 970) + '\157' + chr(0b1100100) + chr(0b100101 + 0o100))('\165' + chr(0b1110100) + '\x66' + chr(85 - 40) + '\070')), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe4\xc8\xa8\x8f$\x0e\xfd\xdcFr\x7f\xfa\x0cv!y\xad\x8eMX\x9bwD\xd1\x0b\xcd\x84]\xf3\xd3\xba\x94(\xb13\x93Z\t\x81k\xc4\xc2\xb6\x92>W\xb4\xce\x12<y\xe0He85\xbf\x97'), '\x64' + '\145' + chr(0b11010 + 0o111) + '\157' + chr(7713 - 7613) + chr(0b1100101))('\165' + chr(0b1110100) + chr(4679 - 4577) + chr(1831 - 1786) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2\x93\xb6\x89\x0f\x16\x8e\x8eb"s\xfe'), chr(100) + chr(7369 - 7268) + '\x63' + chr(10507 - 10396) + chr(100) + '\x65')(chr(5145 - 5028) + chr(0b1110100) + '\146' + chr(118 - 73) + '\x38'))(XdowRbJKZWL9)) ISYkzCis8uho.JxXXBjYzLlbf = YyaZ4tpXu4lf(XzTt3zGfhOS9) ISYkzCis8uho.cblPhPff7O3x = E569CrKExQ5K or None ISYkzCis8uho.swR5ep5lbTSz = oVre8I6UXc3b.swR5ep5lbTSz return ISYkzCis8uho
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
_validate_dlq
def _validate_dlq(self): """Validates whether the DeadLetterQueue LogicalId is validation :raise: InvalidResourceException """ # Validate required logical ids valid_dlq_types = str(list(self.dead_letter_queue_policy_actions.keys())) if not self.DeadLetterQueue.get('Type') or not self.DeadLetterQueue.get('TargetArn'): raise InvalidResourceException(self.logical_id, "'DeadLetterQueue' requires Type and TargetArn properties to be specified" .format(valid_dlq_types)) # Validate required Types if not self.DeadLetterQueue['Type'] in self.dead_letter_queue_policy_actions: raise InvalidResourceException(self.logical_id, "'DeadLetterQueue' requires Type of {}".format(valid_dlq_types))
python
def _validate_dlq(self): """Validates whether the DeadLetterQueue LogicalId is validation :raise: InvalidResourceException """ # Validate required logical ids valid_dlq_types = str(list(self.dead_letter_queue_policy_actions.keys())) if not self.DeadLetterQueue.get('Type') or not self.DeadLetterQueue.get('TargetArn'): raise InvalidResourceException(self.logical_id, "'DeadLetterQueue' requires Type and TargetArn properties to be specified" .format(valid_dlq_types)) # Validate required Types if not self.DeadLetterQueue['Type'] in self.dead_letter_queue_policy_actions: raise InvalidResourceException(self.logical_id, "'DeadLetterQueue' requires Type of {}".format(valid_dlq_types))
[ "def", "_validate_dlq", "(", "self", ")", ":", "# Validate required logical ids", "valid_dlq_types", "=", "str", "(", "list", "(", "self", ".", "dead_letter_queue_policy_actions", ".", "keys", "(", ")", ")", ")", "if", "not", "self", ".", "DeadLetterQueue", ".", "get", "(", "'Type'", ")", "or", "not", "self", ".", "DeadLetterQueue", ".", "get", "(", "'TargetArn'", ")", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"'DeadLetterQueue' requires Type and TargetArn properties to be specified\"", ".", "format", "(", "valid_dlq_types", ")", ")", "# Validate required Types", "if", "not", "self", ".", "DeadLetterQueue", "[", "'Type'", "]", "in", "self", ".", "dead_letter_queue_policy_actions", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"'DeadLetterQueue' requires Type of {}\"", ".", "format", "(", "valid_dlq_types", ")", ")" ]
Validates whether the DeadLetterQueue LogicalId is validation :raise: InvalidResourceException
[ "Validates", "whether", "the", "DeadLetterQueue", "LogicalId", "is", "validation", ":", "raise", ":", "InvalidResourceException" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L248-L262
train
Validates whether the DeadLetterQueue LogicalId is validation
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,qqrh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fv8UVFey,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(478 - 428) + chr(2112 - 2057) + chr(0b101001 + 0o13), ord("\x08")), ehT0Px3KOsy9(chr(1688 - 1640) + chr(111) + '\062' + '\062' + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b10111 + 0o130) + chr(0b101111 + 0o4) + '\x33' + chr(776 - 723), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2086 - 2037) + '\x35' + chr(0b100011 + 0o23), 0b1000), ehT0Px3KOsy9('\060' + chr(3015 - 2904) + chr(1201 - 1150) + '\067' + chr(0b100100 + 0o17), 0b1000), ehT0Px3KOsy9(chr(713 - 665) + '\x6f' + chr(50) + chr(55) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(559 - 511) + '\157' + chr(0b110001) + '\065' + '\x36', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1 + 0o60) + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110110) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000001 + 0o56) + chr(2139 - 2084) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10000 + 0o41) + chr(0b110100) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(11241 - 11130) + chr(0b110011) + chr(0b1001 + 0o47) + '\066', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1010 + 0o145) + chr(54) + chr(2084 - 2032), 8), ehT0Px3KOsy9(chr(1444 - 1396) + chr(0b1101111) + '\062' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(4191 - 4080) + chr(51) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1111 + 0o140) + '\x33' + '\x37' + '\x33', 8), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\x6f' + '\062' + chr(51) + chr(0b110100 + 0o3), 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(9640 - 9529) + chr(49) + chr(54) + chr(0b100111 + 0o13), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110110) + chr(52), 8), ehT0Px3KOsy9(chr(1634 - 1586) + chr(0b1101111) + chr(51) + chr(0b110101) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101111 + 0o2) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(953 - 905) + '\x6f' + chr(840 - 791) + chr(0b101110 + 0o7) + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + chr(2638 - 2586) + chr(0b1 + 0o62), 0b1000), ehT0Px3KOsy9(chr(412 - 364) + chr(0b1101111) + '\x35' + chr(55), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + '\x30' + chr(0b1001 + 0o51), ord("\x08")), ehT0Px3KOsy9(chr(1882 - 1834) + chr(7029 - 6918) + chr(1294 - 1245) + chr(0b110011) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + '\064' + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(2255 - 2207) + chr(0b1101111) + '\x31' + '\065' + '\x32', 54737 - 54729), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(691 - 639) + chr(0b110110), 12394 - 12386), ehT0Px3KOsy9('\060' + chr(1606 - 1495) + chr(55) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101011 + 0o4) + chr(197 - 147) + chr(0b1100 + 0o51) + chr(1906 - 1855), 0o10), ehT0Px3KOsy9(chr(1814 - 1766) + chr(111) + '\x37' + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + chr(1884 - 1833) + chr(0b110000) + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10000 + 0o137) + '\x31' + '\x36' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(1127 - 1079) + chr(0b1101111) + chr(1367 - 1318) + '\066' + chr(53), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b101011 + 0o11), 63799 - 63791), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(0b10100 + 0o42), 28842 - 28834), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b1000 + 0o51) + '\x35' + chr(837 - 789), 51626 - 51618), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + chr(2222 - 2171) + chr(1319 - 1269) + chr(2151 - 2097), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1000 + 0o55) + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x92'), chr(0b1100100) + chr(0b101111 + 0o66) + chr(6490 - 6391) + chr(0b1101111) + chr(100) + chr(101))(chr(6428 - 6311) + chr(0b1001011 + 0o51) + chr(0b1100110) + chr(0b101101) + chr(645 - 589)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Iqey_uY7Kvkk(oVre8I6UXc3b): Gk9mjz6qX2RX = M8_cKLkHVB2V(YyaZ4tpXu4lf(oVre8I6UXc3b.dead_letter_queue_policy_actions.keys())) if not xafqLlk3kkUe(oVre8I6UXc3b.DeadLetterQueue, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\xf2\xa9'), '\x64' + '\x65' + chr(0b1100011) + chr(0b111111 + 0o60) + chr(100) + '\145')(chr(3007 - 2890) + chr(0b1110100) + chr(0b1100110) + chr(849 - 804) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8\xee\xad\x0b'), chr(0b1100100) + chr(0b111111 + 0o46) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(101))('\x75' + chr(13350 - 13234) + chr(0b111010 + 0o54) + chr(0b10100 + 0o31) + chr(2452 - 2396))) or not xafqLlk3kkUe(oVre8I6UXc3b.DeadLetterQueue, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\xf2\xa9'), chr(100) + '\145' + '\x63' + '\x6f' + '\144' + '\145')('\x75' + chr(0b1110100) + chr(4496 - 4394) + '\055' + chr(160 - 104)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8\xf6\xaf\t\x9e\xca/xZ'), '\144' + chr(0b1100000 + 0o5) + chr(8566 - 8467) + '\x6f' + '\x64' + chr(0b1100101))('\165' + '\x74' + chr(0b1100110) + '\055' + chr(2973 - 2917))): raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf2\xe7\x87\x1c\xcd\x88#nvW2\x81'), chr(100) + '\x65' + '\143' + chr(0b1101111) + chr(0b1100100) + '\145')('\165' + chr(2174 - 2058) + '\x66' + '\055' + '\070')), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\x9b\xd3\xb8\x0f\x9f\xf2\x0b~@Z\x16\x97Awo\x9e\xb8RF\x8az\x1bJ]'+\xc2G\x13\x96]\x8bY\xaa\x10U@o\x1a\xb1\xd9\xe3\x9c\x1c\x95\x9e\x1ex[O\x01\xb4@{\x7f\x88\xbf\x06[\xcfi\x0b\x03\\2=\x81z\x0c\x8f]\xcf"), '\144' + '\145' + chr(99) + chr(0b1101111) + chr(6000 - 5900) + '\145')(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xea\xa3\xaf\x01\xb3\xdf=9dO\x01\xac'), '\144' + chr(7353 - 7252) + chr(0b1100011) + chr(0b1 + 0o156) + chr(100) + '\145')(chr(0b111 + 0o156) + chr(0b1110100) + chr(0b1100110) + chr(0b1101 + 0o40) + '\x38'))(Gk9mjz6qX2RX)) if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\xf2\xbc\n\xb7\xdb\x1a~QM5\xb3Qg\x7f'), '\144' + chr(1243 - 1142) + chr(0b1000 + 0o133) + chr(0b1101111) + chr(100) + '\x65')('\165' + chr(116) + chr(0b1100110) + '\x2d' + chr(0b111000)))[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8\xee\xad\x0b'), chr(0b100011 + 0o101) + '\145' + '\x63' + chr(830 - 719) + '\144' + chr(0b11101 + 0o110))(chr(0b1110101) + '\x74' + chr(4517 - 4415) + chr(0b11 + 0o52) + '\x38')] in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\xf2\xbc\n\xa4\xd2\x0b~@Z\x16\x99Eg\x7f\x8e\xfa-D\x80g\x07@V\x1d9\x81g\x03\x89V\xd8'), '\x64' + chr(101) + '\x63' + '\x6f' + '\x64' + chr(0b1001000 + 0o35))(chr(0b1110101) + chr(0b1110100) + chr(6102 - 6000) + chr(564 - 519) + '\x38')): raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf2\xe7\x87\x1c\xcd\x88#nvW2\x81'), chr(0b11100 + 0o110) + chr(0b1100101) + chr(99) + '\x6f' + chr(5088 - 4988) + chr(0b1100101))(chr(0b111011 + 0o72) + chr(116) + chr(102) + '\055' + chr(0b100001 + 0o27))), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\x9b\xd3\xb8\x0f\x9f\xf2\x0b~@Z\x16\x97Awo\x9e\xb8RF\x8az\x1bJ]'+\xc2G\x13\x96]\x8bW\xa2T\x0ei"), '\x64' + chr(0b1100101) + chr(0b1100011) + '\157' + '\x64' + '\x65')(chr(8568 - 8451) + chr(116) + '\x66' + chr(193 - 148) + chr(0b101110 + 0o12)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xea\xa3\xaf\x01\xb3\xdf=9dO\x01\xac'), chr(100) + '\x65' + chr(0b1110 + 0o125) + chr(2565 - 2454) + '\x64' + chr(7985 - 7884))(chr(0b1110101) + chr(11170 - 11054) + '\x66' + chr(830 - 785) + chr(56)))(Gk9mjz6qX2RX))
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
_generate_event_resources
def _generate_event_resources(self, lambda_function, execution_role, event_resources, lambda_alias=None): """Generates and returns the resources associated with this function's events. :param model.lambda_.LambdaFunction lambda_function: generated Lambda function :param iam.IAMRole execution_role: generated Lambda execution role :param implicit_api: Global Implicit API resource where the implicit APIs get attached to, if necessary :param implicit_api_stage: Global implicit API stage resource where implicit APIs get attached to, if necessary :param event_resources: All the event sources associated with this Lambda function :param model.lambda_.LambdaAlias lambda_alias: Optional Lambda Alias resource if we want to connect the event sources to this alias :returns: a list containing the function's event resources :rtype: list """ resources = [] if self.Events: for logical_id, event_dict in self.Events.items(): try: eventsource = self.event_resolver.resolve_resource_type(event_dict).from_dict( lambda_function.logical_id + logical_id, event_dict, logical_id) except TypeError as e: raise InvalidEventException(logical_id, "{}".format(e)) kwargs = { # When Alias is provided, connect all event sources to the alias and *not* the function 'function': lambda_alias or lambda_function, 'role': execution_role, } for name, resource in event_resources[logical_id].items(): kwargs[name] = resource resources += eventsource.to_cloudformation(**kwargs) return resources
python
def _generate_event_resources(self, lambda_function, execution_role, event_resources, lambda_alias=None): """Generates and returns the resources associated with this function's events. :param model.lambda_.LambdaFunction lambda_function: generated Lambda function :param iam.IAMRole execution_role: generated Lambda execution role :param implicit_api: Global Implicit API resource where the implicit APIs get attached to, if necessary :param implicit_api_stage: Global implicit API stage resource where implicit APIs get attached to, if necessary :param event_resources: All the event sources associated with this Lambda function :param model.lambda_.LambdaAlias lambda_alias: Optional Lambda Alias resource if we want to connect the event sources to this alias :returns: a list containing the function's event resources :rtype: list """ resources = [] if self.Events: for logical_id, event_dict in self.Events.items(): try: eventsource = self.event_resolver.resolve_resource_type(event_dict).from_dict( lambda_function.logical_id + logical_id, event_dict, logical_id) except TypeError as e: raise InvalidEventException(logical_id, "{}".format(e)) kwargs = { # When Alias is provided, connect all event sources to the alias and *not* the function 'function': lambda_alias or lambda_function, 'role': execution_role, } for name, resource in event_resources[logical_id].items(): kwargs[name] = resource resources += eventsource.to_cloudformation(**kwargs) return resources
[ "def", "_generate_event_resources", "(", "self", ",", "lambda_function", ",", "execution_role", ",", "event_resources", ",", "lambda_alias", "=", "None", ")", ":", "resources", "=", "[", "]", "if", "self", ".", "Events", ":", "for", "logical_id", ",", "event_dict", "in", "self", ".", "Events", ".", "items", "(", ")", ":", "try", ":", "eventsource", "=", "self", ".", "event_resolver", ".", "resolve_resource_type", "(", "event_dict", ")", ".", "from_dict", "(", "lambda_function", ".", "logical_id", "+", "logical_id", ",", "event_dict", ",", "logical_id", ")", "except", "TypeError", "as", "e", ":", "raise", "InvalidEventException", "(", "logical_id", ",", "\"{}\"", ".", "format", "(", "e", ")", ")", "kwargs", "=", "{", "# When Alias is provided, connect all event sources to the alias and *not* the function", "'function'", ":", "lambda_alias", "or", "lambda_function", ",", "'role'", ":", "execution_role", ",", "}", "for", "name", ",", "resource", "in", "event_resources", "[", "logical_id", "]", ".", "items", "(", ")", ":", "kwargs", "[", "name", "]", "=", "resource", "resources", "+=", "eventsource", ".", "to_cloudformation", "(", "*", "*", "kwargs", ")", "return", "resources" ]
Generates and returns the resources associated with this function's events. :param model.lambda_.LambdaFunction lambda_function: generated Lambda function :param iam.IAMRole execution_role: generated Lambda execution role :param implicit_api: Global Implicit API resource where the implicit APIs get attached to, if necessary :param implicit_api_stage: Global implicit API stage resource where implicit APIs get attached to, if necessary :param event_resources: All the event sources associated with this Lambda function :param model.lambda_.LambdaAlias lambda_alias: Optional Lambda Alias resource if we want to connect the event sources to this alias :returns: a list containing the function's event resources :rtype: list
[ "Generates", "and", "returns", "the", "resources", "associated", "with", "this", "function", "s", "events", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L276-L309
train
Generates and returns the event resources associated with this function s events.
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,hr2Qaoiv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NT,_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(1880 - 1832) + '\157' + chr(50) + '\x35' + chr(1832 - 1784), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10000 + 0o46) + chr(0b1001 + 0o53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(501 - 450) + chr(0b110000) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000011 + 0o54) + chr(54) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b110011 + 0o74) + chr(1842 - 1793) + chr(0b11110 + 0o24), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(595 - 547) + '\067', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2023 - 1974) + '\x34', 12480 - 12472), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101101 + 0o7) + chr(0b100 + 0o55), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + '\x36' + chr(0b1010 + 0o46), 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(2262 - 2151) + '\x33' + chr(0b110000) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1010111 + 0o30) + chr(0b110 + 0o54) + '\067' + '\x35', 37080 - 37072), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(1211 - 1157) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2739 - 2684) + chr(0b10111 + 0o31), ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(2466 - 2355) + chr(0b110 + 0o56) + chr(0b110010 + 0o5), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(0b110000 + 0o3) + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x37' + chr(0b11100 + 0o31), 41791 - 41783), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(0b100 + 0o62) + chr(1775 - 1725), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100 + 0o55), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1000101 + 0o52) + chr(0b110011) + chr(51) + chr(2194 - 2146), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(3204 - 3093) + '\x36' + '\065', 8), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(11774 - 11663) + chr(0b110010) + chr(2279 - 2231) + chr(51), 0b1000), ehT0Px3KOsy9(chr(2029 - 1981) + chr(0b101101 + 0o102) + chr(0b110010) + chr(119 - 71) + chr(52), 16042 - 16034), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(0b11100 + 0o25) + chr(2803 - 2748), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1000010 + 0o55) + chr(51) + chr(0b101 + 0o55) + '\x31', 0b1000), ehT0Px3KOsy9(chr(1198 - 1150) + chr(111) + chr(0b1110 + 0o46) + '\x31', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1 + 0o60) + '\x32' + '\x32', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b110110) + chr(48), 23320 - 23312), ehT0Px3KOsy9(chr(929 - 881) + '\x6f' + chr(51) + chr(0b110110) + chr(0b10000 + 0o42), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + '\x37', 53840 - 53832), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + chr(51) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(816 - 768) + chr(111) + chr(51) + chr(0b10110 + 0o36) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100 + 0o55) + chr(899 - 849) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b11010 + 0o125) + '\062' + chr(1386 - 1331) + chr(0b0 + 0o66), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(0b110110) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + chr(0b1011 + 0o46) + chr(54) + chr(0b10001 + 0o41), 0o10), ehT0Px3KOsy9(chr(969 - 921) + chr(0b1101111) + chr(0b110010) + '\x34' + chr(0b110001), 5133 - 5125), ehT0Px3KOsy9(chr(48) + chr(0b1101000 + 0o7) + '\061' + chr(0b110101) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b110001 + 0o76) + chr(0b10 + 0o61) + chr(0b10010 + 0o40) + chr(2902 - 2848), 18225 - 18217)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110101) + chr(0b1001 + 0o47), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x86'), chr(9870 - 9770) + chr(6388 - 6287) + chr(0b1100011) + '\157' + chr(0b101000 + 0o74) + chr(2499 - 2398))(chr(6773 - 6656) + chr(0b1110100) + '\146' + chr(45) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def NauX_K8TlXZQ(oVre8I6UXc3b, TyX845NjZzYy, ISYkzCis8uho, eIfSGDpBbXqy, x4pgu5PA4WQW=None): z4Xs9XhDbg00 = [] if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xedB\xa1[~\xf4'), '\144' + chr(0b110000 + 0o65) + '\143' + chr(0b100010 + 0o115) + '\144' + '\x65')('\165' + chr(116) + chr(102) + '\x2d' + chr(0b111000))): for (NpZr66MdBhVG, uu5ZwuyX4yeX) in xafqLlk3kkUe(oVre8I6UXc3b.Events, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6N\xb2PC\xdd?hl#\x89\x84'), chr(100) + chr(2188 - 2087) + chr(0b1100011) + chr(111) + '\x64' + '\x65')(chr(0b101011 + 0o112) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b111000)))(): try: CfOxu0N0YTLI = oVre8I6UXc3b.event_resolver.resolve_resource_type(uu5ZwuyX4yeX).from_dict(TyX845NjZzYy.NpZr66MdBhVG + NpZr66MdBhVG, uu5ZwuyX4yeX, NpZr66MdBhVG) except sznFqDbNBHlx as GlnVAPeT6CUe: raise eXWqlSUlGxPF(NpZr66MdBhVG, xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3I'), chr(755 - 655) + chr(101) + '\x63' + chr(11171 - 11060) + chr(100) + '\145')(chr(0b101010 + 0o113) + '\x74' + chr(3659 - 3557) + '\x2d' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xfe\x00\xb6ZB\xe6_\x12P\x00\xa4\xd7'), chr(0b1100100) + chr(0b1100001 + 0o4) + chr(6132 - 6033) + '\157' + '\144' + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b1011011 + 0o13) + chr(911 - 866) + chr(56)))(GlnVAPeT6CUe)) M8EIoTs2GJXE = {xafqLlk3kkUe(SXOLrMavuUCe(b'\xceA\xaaV~\xeecO'), chr(0b1011111 + 0o5) + chr(101) + chr(99) + chr(0b1101111) + chr(0b100011 + 0o101) + chr(101))(chr(0b1110101) + chr(0b100011 + 0o121) + chr(339 - 237) + '\x2d' + chr(0b111000)): x4pgu5PA4WQW or TyX845NjZzYy, xafqLlk3kkUe(SXOLrMavuUCe(b'\xda[\xa8P'), chr(0b1100100) + '\145' + chr(0b11 + 0o140) + '\157' + chr(100) + chr(8628 - 8527))(chr(117) + chr(2105 - 1989) + '\146' + chr(0b101101) + chr(56)): ISYkzCis8uho} for (AIvJRzLdDfgF, o9IPj2MJBBod) in xafqLlk3kkUe(eIfSGDpBbXqy[NpZr66MdBhVG], xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6N\xb2PC\xdd?hl#\x89\x84'), chr(0b110010 + 0o62) + '\x65' + chr(7133 - 7034) + chr(0b1101111) + chr(9362 - 9262) + chr(101))('\x75' + chr(116) + chr(0b10110 + 0o120) + chr(317 - 272) + chr(56)))(): M8EIoTs2GJXE[AIvJRzLdDfgF] = o9IPj2MJBBod z4Xs9XhDbg00 += CfOxu0N0YTLI.to_cloudformation(**M8EIoTs2GJXE) return z4Xs9XhDbg00
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
_construct_version
def _construct_version(self, function, intrinsics_resolver): """Constructs a Lambda Version resource that will be auto-published when CodeUri of the function changes. Old versions will not be deleted without a direct reference from the CloudFormation template. :param model.lambda_.LambdaFunction function: Lambda function object that is being connected to a version :param model.intrinsics.resolver.IntrinsicsResolver intrinsics_resolver: Class that can help resolve references to parameters present in CodeUri. It is a common usecase to set S3Key of Code to be a template parameter. Need to resolve the values otherwise we will never detect a change in Code dict :return: Lambda function Version resource """ code_dict = function.Code if not code_dict: raise ValueError("Lambda function code must be a valid non-empty dictionary") if not intrinsics_resolver: raise ValueError("intrinsics_resolver is required for versions creation") # Resolve references to template parameters before creating hash. This will *not* resolve all intrinsics # because we cannot resolve runtime values like Arn of a resource. For purposes of detecting changes, this # is good enough. Here is why: # # When using intrinsic functions there are two cases when has must change: # - Value of the template parameter changes # - (or) LogicalId of a referenced resource changes ie. !GetAtt NewResource.Arn # # Later case will already change the hash because some value in the Code dictionary changes. We handle the # first case by resolving references to template parameters. It is okay even if these references are # present inside another intrinsic such as !Join. The resolver will replace the reference with the parameter's # value and keep all other parts of !Join identical. This will still trigger a change in the hash. code_dict = intrinsics_resolver.resolve_parameter_refs(code_dict) # Construct the LogicalID of Lambda version by appending 10 characters of SHA of CodeUri. This is necessary # to trigger creation of a new version every time code location changes. Since logicalId changes, CloudFormation # will drop the old version and create a new one for us. We set a DeletionPolicy on the version resource to # prevent CloudFormation from actually deleting the underlying version resource # # SHA Collisions: For purposes of triggering a new update, we are concerned about just the difference previous # and next hashes. The chances that two subsequent hashes collide is fairly low. prefix = "{id}Version".format(id=self.logical_id) logical_id = logical_id_generator.LogicalIdGenerator(prefix, code_dict).gen() attributes = self.get_passthrough_resource_attributes() if attributes is None: attributes = {} attributes["DeletionPolicy"] = "Retain" lambda_version = LambdaVersion(logical_id=logical_id, attributes=attributes) lambda_version.FunctionName = function.get_runtime_attr('name') lambda_version.Description = self.VersionDescription return lambda_version
python
def _construct_version(self, function, intrinsics_resolver): """Constructs a Lambda Version resource that will be auto-published when CodeUri of the function changes. Old versions will not be deleted without a direct reference from the CloudFormation template. :param model.lambda_.LambdaFunction function: Lambda function object that is being connected to a version :param model.intrinsics.resolver.IntrinsicsResolver intrinsics_resolver: Class that can help resolve references to parameters present in CodeUri. It is a common usecase to set S3Key of Code to be a template parameter. Need to resolve the values otherwise we will never detect a change in Code dict :return: Lambda function Version resource """ code_dict = function.Code if not code_dict: raise ValueError("Lambda function code must be a valid non-empty dictionary") if not intrinsics_resolver: raise ValueError("intrinsics_resolver is required for versions creation") # Resolve references to template parameters before creating hash. This will *not* resolve all intrinsics # because we cannot resolve runtime values like Arn of a resource. For purposes of detecting changes, this # is good enough. Here is why: # # When using intrinsic functions there are two cases when has must change: # - Value of the template parameter changes # - (or) LogicalId of a referenced resource changes ie. !GetAtt NewResource.Arn # # Later case will already change the hash because some value in the Code dictionary changes. We handle the # first case by resolving references to template parameters. It is okay even if these references are # present inside another intrinsic such as !Join. The resolver will replace the reference with the parameter's # value and keep all other parts of !Join identical. This will still trigger a change in the hash. code_dict = intrinsics_resolver.resolve_parameter_refs(code_dict) # Construct the LogicalID of Lambda version by appending 10 characters of SHA of CodeUri. This is necessary # to trigger creation of a new version every time code location changes. Since logicalId changes, CloudFormation # will drop the old version and create a new one for us. We set a DeletionPolicy on the version resource to # prevent CloudFormation from actually deleting the underlying version resource # # SHA Collisions: For purposes of triggering a new update, we are concerned about just the difference previous # and next hashes. The chances that two subsequent hashes collide is fairly low. prefix = "{id}Version".format(id=self.logical_id) logical_id = logical_id_generator.LogicalIdGenerator(prefix, code_dict).gen() attributes = self.get_passthrough_resource_attributes() if attributes is None: attributes = {} attributes["DeletionPolicy"] = "Retain" lambda_version = LambdaVersion(logical_id=logical_id, attributes=attributes) lambda_version.FunctionName = function.get_runtime_attr('name') lambda_version.Description = self.VersionDescription return lambda_version
[ "def", "_construct_version", "(", "self", ",", "function", ",", "intrinsics_resolver", ")", ":", "code_dict", "=", "function", ".", "Code", "if", "not", "code_dict", ":", "raise", "ValueError", "(", "\"Lambda function code must be a valid non-empty dictionary\"", ")", "if", "not", "intrinsics_resolver", ":", "raise", "ValueError", "(", "\"intrinsics_resolver is required for versions creation\"", ")", "# Resolve references to template parameters before creating hash. This will *not* resolve all intrinsics", "# because we cannot resolve runtime values like Arn of a resource. For purposes of detecting changes, this", "# is good enough. Here is why:", "#", "# When using intrinsic functions there are two cases when has must change:", "# - Value of the template parameter changes", "# - (or) LogicalId of a referenced resource changes ie. !GetAtt NewResource.Arn", "#", "# Later case will already change the hash because some value in the Code dictionary changes. We handle the", "# first case by resolving references to template parameters. It is okay even if these references are", "# present inside another intrinsic such as !Join. The resolver will replace the reference with the parameter's", "# value and keep all other parts of !Join identical. This will still trigger a change in the hash.", "code_dict", "=", "intrinsics_resolver", ".", "resolve_parameter_refs", "(", "code_dict", ")", "# Construct the LogicalID of Lambda version by appending 10 characters of SHA of CodeUri. This is necessary", "# to trigger creation of a new version every time code location changes. Since logicalId changes, CloudFormation", "# will drop the old version and create a new one for us. We set a DeletionPolicy on the version resource to", "# prevent CloudFormation from actually deleting the underlying version resource", "#", "# SHA Collisions: For purposes of triggering a new update, we are concerned about just the difference previous", "# and next hashes. The chances that two subsequent hashes collide is fairly low.", "prefix", "=", "\"{id}Version\"", ".", "format", "(", "id", "=", "self", ".", "logical_id", ")", "logical_id", "=", "logical_id_generator", ".", "LogicalIdGenerator", "(", "prefix", ",", "code_dict", ")", ".", "gen", "(", ")", "attributes", "=", "self", ".", "get_passthrough_resource_attributes", "(", ")", "if", "attributes", "is", "None", ":", "attributes", "=", "{", "}", "attributes", "[", "\"DeletionPolicy\"", "]", "=", "\"Retain\"", "lambda_version", "=", "LambdaVersion", "(", "logical_id", "=", "logical_id", ",", "attributes", "=", "attributes", ")", "lambda_version", ".", "FunctionName", "=", "function", ".", "get_runtime_attr", "(", "'name'", ")", "lambda_version", ".", "Description", "=", "self", ".", "VersionDescription", "return", "lambda_version" ]
Constructs a Lambda Version resource that will be auto-published when CodeUri of the function changes. Old versions will not be deleted without a direct reference from the CloudFormation template. :param model.lambda_.LambdaFunction function: Lambda function object that is being connected to a version :param model.intrinsics.resolver.IntrinsicsResolver intrinsics_resolver: Class that can help resolve references to parameters present in CodeUri. It is a common usecase to set S3Key of Code to be a template parameter. Need to resolve the values otherwise we will never detect a change in Code dict :return: Lambda function Version resource
[ "Constructs", "a", "Lambda", "Version", "resource", "that", "will", "be", "auto", "-", "published", "when", "CodeUri", "of", "the", "function", "changes", ".", "Old", "versions", "will", "not", "be", "deleted", "without", "a", "direct", "reference", "from", "the", "CloudFormation", "template", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L321-L371
train
Constructs a Lambda Version resource that will be auto - published when CodeUri of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,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(0b10101 + 0o33) + chr(0b1011 + 0o144) + '\061' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1101111) + chr(0b1110 + 0o45) + chr(55) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b110001 + 0o1) + chr(0b11001 + 0o33), ord("\x08")), ehT0Px3KOsy9(chr(1112 - 1064) + chr(0b1101111) + chr(0b110 + 0o53) + '\065' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + '\062' + '\x34' + '\x30', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b0 + 0o61) + chr(55) + '\x37', 37334 - 37326), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(2266 - 2215) + chr(1194 - 1144), 57161 - 57153), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b11101 + 0o122) + '\x33' + chr(54) + '\x36', 0o10), ehT0Px3KOsy9('\060' + chr(0b1010001 + 0o36) + chr(49) + '\x32' + '\062', 0o10), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(9933 - 9822) + chr(0b110011) + chr(54) + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + chr(5609 - 5498) + chr(0b110001) + '\x30' + chr(53), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\157' + '\061' + chr(0b11010 + 0o32), 0b1000), ehT0Px3KOsy9(chr(1344 - 1296) + chr(0b100001 + 0o116) + chr(51) + chr(52) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(1951 - 1903) + '\x6f' + '\062', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + '\x32' + chr(706 - 654), 39338 - 39330), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + '\x36' + chr(0b110110), 8), ehT0Px3KOsy9(chr(697 - 649) + '\x6f' + chr(51) + chr(2217 - 2168) + chr(0b100011 + 0o17), 0o10), ehT0Px3KOsy9(chr(286 - 238) + '\x6f' + chr(1280 - 1229) + '\x32' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1000 + 0o51) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(0b110100) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(54) + chr(54), 32837 - 32829), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(0b11 + 0o56) + '\x37', 0b1000), ehT0Px3KOsy9(chr(488 - 440) + chr(0b1101111) + chr(0b1 + 0o63) + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(2221 - 2170) + chr(0b110110) + chr(53), 0o10), ehT0Px3KOsy9(chr(900 - 852) + '\x6f' + '\063' + chr(51) + chr(698 - 648), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(1113 - 1063) + chr(54), 0b1000), ehT0Px3KOsy9(chr(736 - 688) + chr(0b111001 + 0o66) + chr(448 - 398) + '\x32' + '\061', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5807 - 5696) + chr(0b110111) + chr(0b110011), 60461 - 60453), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1000001 + 0o56) + chr(0b110 + 0o56) + chr(0b101000 + 0o14), 4884 - 4876), ehT0Px3KOsy9('\060' + chr(1324 - 1213) + chr(0b101 + 0o54) + chr(0b101111 + 0o3) + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + '\x34' + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101011 + 0o104) + '\061' + '\x34' + chr(0b0 + 0o60), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(50) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(1153 - 1105) + chr(0b1101100 + 0o3) + chr(49) + chr(0b1001 + 0o47), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(53) + chr(0b1001 + 0o53), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(0b100001 + 0o25) + chr(0b100011 + 0o17), 0o10), ehT0Px3KOsy9('\060' + chr(0b101101 + 0o102) + chr(314 - 263) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + chr(48) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(1143 - 1092) + chr(51), 0b1000), ehT0Px3KOsy9(chr(151 - 103) + '\x6f' + chr(51) + '\x31' + '\063', 11448 - 11440)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b111011 + 0o64) + 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) + chr(0b10 + 0o143) + chr(0b1100011) + '\157' + chr(100) + chr(101))(chr(13013 - 12896) + chr(0b1110100) + chr(0b101001 + 0o75) + chr(0b101100 + 0o1) + chr(1125 - 1069)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def rjo38zyNFtvI(oVre8I6UXc3b, bBC93MgSHzUB, M8xEnnSGIF9g): Z624rDzxGYVY = bBC93MgSHzUB.qsFcgZaZK0sp if not Z624rDzxGYVY: raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b"G\x9a9\r\xc4\x1e\xba\x90'\x9f&x\x8cm\xba\xd6\xa9\xbfn\x03V\xe2W\x86\xae6\xf3^\x042\xc1\x16\xb6dE\xd69\xea\xf4\xa5&\x9e9\x1f\xd4\x06\xba\x92;\x921e\x8al\xb5\x84\xb3"), chr(100) + '\145' + '\x63' + chr(111) + chr(0b110101 + 0o57) + chr(0b1000101 + 0o40))(chr(0b1100101 + 0o20) + '\x74' + chr(4253 - 4151) + '\055' + '\070')) if not M8xEnnSGIF9g: raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'b\x95 \x1d\xc9\x11\xe9\x9f1\x82\x1a~\x80q\xbb\x9a\xbc\xb5xF\x1f\xfc\x02\x87\xbfg\xe4RV6\x85@\xb1g^\x92o\xe1\xe9\xb8b\x94:\x1c\x80\x1c\xe8\x933\x85,c\x8b'), chr(8413 - 8313) + chr(101) + '\143' + chr(0b1101111) + chr(1919 - 1819) + chr(242 - 141))(chr(3085 - 2968) + chr(0b1110100) + chr(2487 - 2385) + chr(0b1101 + 0o40) + '\x38')) Z624rDzxGYVY = M8xEnnSGIF9g.resolve_parameter_refs(Z624rDzxGYVY) K1Ha0XjJTAE7 = xafqLlk3kkUe(SXOLrMavuUCe(b'p\x920\x12\xf6\x1a\xe8\x85;\x9e+'), chr(100) + chr(0b1100101) + '\143' + chr(7208 - 7097) + chr(100) + chr(0b1100101))('\165' + chr(116) + chr(0b1100110) + '\055' + chr(56)).V4roHaS3Ppej(id=oVre8I6UXc3b.NpZr66MdBhVG) NpZr66MdBhVG = LH9cA0AXOw_a.LogicalIdGenerator(K1Ha0XjJTAE7, Z624rDzxGYVY).gen() QxDLTga8Ce_W = oVre8I6UXc3b.get_passthrough_resource_attributes() if QxDLTga8Ce_W is None: QxDLTga8Ce_W = {} QxDLTga8Ce_W[xafqLlk3kkUe(SXOLrMavuUCe(b'O\x9e8\n\xd4\x16\xf5\x98\x02\x9e)e\x86{'), '\x64' + chr(7719 - 7618) + '\143' + '\157' + chr(5145 - 5045) + chr(0b101 + 0o140))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(1968 - 1923) + chr(64 - 8))] = xafqLlk3kkUe(SXOLrMavuUCe(b'Y\x9e \x0e\xc9\x11'), '\144' + '\x65' + chr(2912 - 2813) + '\x6f' + chr(8036 - 7936) + chr(0b1000010 + 0o43))(chr(117) + '\164' + '\146' + chr(45) + '\x38') ihcWhVXbHDhq = zNSioO3oC9Hi(logical_id=NpZr66MdBhVG, attributes=QxDLTga8Ce_W) ihcWhVXbHDhq.qUoaUMQeQIKB = bBC93MgSHzUB.get_runtime_attr(xafqLlk3kkUe(SXOLrMavuUCe(b'e\x9a9\n'), chr(0b101111 + 0o65) + chr(2912 - 2811) + chr(3727 - 3628) + chr(0b1101111) + chr(0b1111 + 0o125) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(1175 - 1073) + '\055' + chr(1447 - 1391))) ihcWhVXbHDhq.Gg5N_G5JhGDN = oVre8I6UXc3b.VersionDescription return ihcWhVXbHDhq
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
_construct_alias
def _construct_alias(self, name, function, version): """Constructs a Lambda Alias for the given function and pointing to the given version :param string name: Name of the alias :param model.lambda_.LambdaFunction function: Lambda function object to associate the alias with :param model.lambda_.LambdaVersion version: Lambda version object to associate the alias with :return: Lambda alias object :rtype model.lambda_.LambdaAlias """ if not name: raise InvalidResourceException(self.logical_id, "Alias name is required to create an alias") logical_id = "{id}Alias{suffix}".format(id=function.logical_id, suffix=name) alias = LambdaAlias(logical_id=logical_id, attributes=self.get_passthrough_resource_attributes()) alias.Name = name alias.FunctionName = function.get_runtime_attr('name') alias.FunctionVersion = version.get_runtime_attr("version") return alias
python
def _construct_alias(self, name, function, version): """Constructs a Lambda Alias for the given function and pointing to the given version :param string name: Name of the alias :param model.lambda_.LambdaFunction function: Lambda function object to associate the alias with :param model.lambda_.LambdaVersion version: Lambda version object to associate the alias with :return: Lambda alias object :rtype model.lambda_.LambdaAlias """ if not name: raise InvalidResourceException(self.logical_id, "Alias name is required to create an alias") logical_id = "{id}Alias{suffix}".format(id=function.logical_id, suffix=name) alias = LambdaAlias(logical_id=logical_id, attributes=self.get_passthrough_resource_attributes()) alias.Name = name alias.FunctionName = function.get_runtime_attr('name') alias.FunctionVersion = version.get_runtime_attr("version") return alias
[ "def", "_construct_alias", "(", "self", ",", "name", ",", "function", ",", "version", ")", ":", "if", "not", "name", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"Alias name is required to create an alias\"", ")", "logical_id", "=", "\"{id}Alias{suffix}\"", ".", "format", "(", "id", "=", "function", ".", "logical_id", ",", "suffix", "=", "name", ")", "alias", "=", "LambdaAlias", "(", "logical_id", "=", "logical_id", ",", "attributes", "=", "self", ".", "get_passthrough_resource_attributes", "(", ")", ")", "alias", ".", "Name", "=", "name", "alias", ".", "FunctionName", "=", "function", ".", "get_runtime_attr", "(", "'name'", ")", "alias", ".", "FunctionVersion", "=", "version", ".", "get_runtime_attr", "(", "\"version\"", ")", "return", "alias" ]
Constructs a Lambda Alias for the given function and pointing to the given version :param string name: Name of the alias :param model.lambda_.LambdaFunction function: Lambda function object to associate the alias with :param model.lambda_.LambdaVersion version: Lambda version object to associate the alias with :return: Lambda alias object :rtype model.lambda_.LambdaAlias
[ "Constructs", "a", "Lambda", "Alias", "for", "the", "given", "function", "and", "pointing", "to", "the", "given", "version" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L373-L392
train
Constructs a Lambda alias for the given function and pointing to the given version.
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,F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XYo9a1WNS,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(0b101110 + 0o2) + '\157' + chr(50) + '\061' + chr(49), 55128 - 55120), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(1189 - 1136) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + '\x32' + chr(52), 65149 - 65141), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(0b101001 + 0o11) + chr(2597 - 2545), 8), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\x6f' + chr(51) + '\064', 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + chr(55) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(570 - 459) + '\062' + '\x32' + chr(52), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(857 - 804) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\157' + chr(0b110001) + '\x37' + '\x31', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(0b110011) + '\061', 0b1000), ehT0Px3KOsy9(chr(293 - 245) + chr(6340 - 6229) + chr(2640 - 2587) + chr(52), 0o10), ehT0Px3KOsy9(chr(1403 - 1355) + chr(0b1011100 + 0o23) + chr(721 - 671) + '\x34' + chr(54), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3523 - 3412) + chr(50) + '\066' + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + '\067' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(0b110001) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + '\x36' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(1538 - 1490) + '\157' + '\x31' + '\065' + chr(0b101101 + 0o5), 0o10), ehT0Px3KOsy9(chr(790 - 742) + '\157' + chr(0b110011) + chr(0b101100 + 0o10) + chr(0b101100 + 0o6), 48553 - 48545), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101010 + 0o14), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\064' + chr(0b1111 + 0o44), 0b1000), ehT0Px3KOsy9(chr(980 - 932) + chr(0b1101111) + '\061' + chr(0b110100) + '\x33', 0b1000), ehT0Px3KOsy9(chr(371 - 323) + chr(942 - 831) + '\x33' + chr(53) + chr(56 - 8), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101110 + 0o3) + '\x35' + chr(633 - 582), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(53) + '\x34', 11821 - 11813), ehT0Px3KOsy9(chr(1354 - 1306) + chr(0b1101111) + chr(0b110001) + chr(0b110111) + '\x37', 62173 - 62165), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + '\061' + chr(0b11001 + 0o32), 0b1000), ehT0Px3KOsy9(chr(304 - 256) + chr(542 - 431) + '\063' + chr(51) + chr(54), 29037 - 29029), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(53) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(390 - 340) + chr(0b110100) + chr(0b100001 + 0o21), 64310 - 64302), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1000110 + 0o51) + chr(0b100110 + 0o14) + chr(1526 - 1477) + '\x34', 55732 - 55724), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100100 + 0o13) + chr(468 - 419) + chr(1056 - 1006) + '\060', 7685 - 7677), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(2135 - 2080) + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(0b110110) + chr(50), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(0b11010 + 0o31) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(561 - 513) + chr(111) + chr(49) + chr(0b110000) + chr(64 - 14), 46351 - 46343), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + chr(166 - 117) + '\x33' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(5476 - 5365) + chr(49) + chr(0b10000 + 0o40) + chr(526 - 471), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100011 + 0o114) + chr(0b110001) + '\x32' + chr(0b11101 + 0o23), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(130 - 82) + '\x35', 0b1000), ehT0Px3KOsy9(chr(366 - 318) + '\x6f' + '\063' + chr(0b10111 + 0o33) + chr(52), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b111110 + 0o61) + chr(95 - 42) + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7'), chr(9117 - 9017) + chr(934 - 833) + chr(0b1100011) + chr(0b1101111) + chr(0b110000 + 0o64) + chr(101))(chr(2272 - 2155) + chr(116) + '\146' + chr(138 - 93) + chr(561 - 505)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def iQdjAtPhtL5k(oVre8I6UXc3b, AIvJRzLdDfgF, bBC93MgSHzUB, cpMfQ_4_Vb7C): if not AIvJRzLdDfgF: raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc7\x1c\xce\xe6*\x08\xd9M;\xf1z\xe1'), chr(100) + '\145' + '\x63' + chr(2512 - 2401) + chr(0b100000 + 0o104) + chr(101))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(45) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8\x00\xfd\xf5o\x1e\xfaH\x14\xfc\x0c\xcf\xc2[;\x92\x1b\x97oQ\x06\x8cK\x98\x10\xab\xbd\x1b\xc7\xed$\x19\xd2\xb8,z&<\xac\xb5\xfa'), '\x64' + chr(4534 - 4433) + '\143' + chr(0b1101111) + chr(100) + '\145')(chr(117) + '\164' + '\x66' + '\055' + '\x38')) NpZr66MdBhVG = xafqLlk3kkUe(SXOLrMavuUCe(b'\xf2\x05\xf0\xe9]R\xfdH\n\xe2_\xd3\xd7\x1d \x8f\x17'), chr(0b1101 + 0o127) + chr(101) + chr(99) + '\x6f' + chr(100) + chr(4247 - 4146))(chr(0b100111 + 0o116) + '\x74' + chr(0b10100 + 0o122) + '\x2d' + chr(0b111000)).V4roHaS3Ppej(id=bBC93MgSHzUB.NpZr66MdBhVG, suffix=AIvJRzLdDfgF) RJ1pgC_UBwkP = YwQMIjuPLEIy(logical_id=NpZr66MdBhVG, attributes=oVre8I6UXc3b.get_passthrough_resource_attributes()) RJ1pgC_UBwkP.i0VlBfTP2Syn = AIvJRzLdDfgF RJ1pgC_UBwkP.qUoaUMQeQIKB = bBC93MgSHzUB.get_runtime_attr(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe7\r\xf9\xf1'), '\144' + chr(0b110011 + 0o62) + chr(0b1001 + 0o132) + '\157' + '\x64' + chr(0b1000010 + 0o43))(chr(7502 - 7385) + chr(0b1101000 + 0o14) + '\x66' + '\x2d' + '\070')) RJ1pgC_UBwkP.Cenr8RnzQkkg = cpMfQ_4_Vb7C.get_runtime_attr(xafqLlk3kkUe(SXOLrMavuUCe(b'\xff\t\xe6\xe7uQ\xfa'), chr(100) + '\x65' + chr(99) + chr(111) + chr(100) + '\x65')(chr(117) + '\164' + chr(0b1001101 + 0o31) + chr(0b10111 + 0o26) + chr(56))) return RJ1pgC_UBwkP
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
SamApi.to_cloudformation
def to_cloudformation(self, **kwargs): """Returns the API Gateway RestApi, Deployment, and Stage to which this SAM Api corresponds. :param dict kwargs: already-converted resources that may need to be modified when converting this \ macro to pure CloudFormation :returns: a list of vanilla CloudFormation Resources, to which this Function expands :rtype: list """ resources = [] api_generator = ApiGenerator(self.logical_id, self.CacheClusterEnabled, self.CacheClusterSize, self.Variables, self.depends_on, self.DefinitionBody, self.DefinitionUri, self.Name, self.StageName, endpoint_configuration=self.EndpointConfiguration, method_settings=self.MethodSettings, binary_media=self.BinaryMediaTypes, minimum_compression_size=self.MinimumCompressionSize, cors=self.Cors, auth=self.Auth, gateway_responses=self.GatewayResponses, access_log_setting=self.AccessLogSetting, canary_setting=self.CanarySetting, tracing_enabled=self.TracingEnabled, resource_attributes=self.resource_attributes, passthrough_resource_attributes=self.get_passthrough_resource_attributes()) rest_api, deployment, stage, permissions = api_generator.to_cloudformation() resources.extend([rest_api, deployment, stage]) resources.extend(permissions) return resources
python
def to_cloudformation(self, **kwargs): """Returns the API Gateway RestApi, Deployment, and Stage to which this SAM Api corresponds. :param dict kwargs: already-converted resources that may need to be modified when converting this \ macro to pure CloudFormation :returns: a list of vanilla CloudFormation Resources, to which this Function expands :rtype: list """ resources = [] api_generator = ApiGenerator(self.logical_id, self.CacheClusterEnabled, self.CacheClusterSize, self.Variables, self.depends_on, self.DefinitionBody, self.DefinitionUri, self.Name, self.StageName, endpoint_configuration=self.EndpointConfiguration, method_settings=self.MethodSettings, binary_media=self.BinaryMediaTypes, minimum_compression_size=self.MinimumCompressionSize, cors=self.Cors, auth=self.Auth, gateway_responses=self.GatewayResponses, access_log_setting=self.AccessLogSetting, canary_setting=self.CanarySetting, tracing_enabled=self.TracingEnabled, resource_attributes=self.resource_attributes, passthrough_resource_attributes=self.get_passthrough_resource_attributes()) rest_api, deployment, stage, permissions = api_generator.to_cloudformation() resources.extend([rest_api, deployment, stage]) resources.extend(permissions) return resources
[ "def", "to_cloudformation", "(", "self", ",", "*", "*", "kwargs", ")", ":", "resources", "=", "[", "]", "api_generator", "=", "ApiGenerator", "(", "self", ".", "logical_id", ",", "self", ".", "CacheClusterEnabled", ",", "self", ".", "CacheClusterSize", ",", "self", ".", "Variables", ",", "self", ".", "depends_on", ",", "self", ".", "DefinitionBody", ",", "self", ".", "DefinitionUri", ",", "self", ".", "Name", ",", "self", ".", "StageName", ",", "endpoint_configuration", "=", "self", ".", "EndpointConfiguration", ",", "method_settings", "=", "self", ".", "MethodSettings", ",", "binary_media", "=", "self", ".", "BinaryMediaTypes", ",", "minimum_compression_size", "=", "self", ".", "MinimumCompressionSize", ",", "cors", "=", "self", ".", "Cors", ",", "auth", "=", "self", ".", "Auth", ",", "gateway_responses", "=", "self", ".", "GatewayResponses", ",", "access_log_setting", "=", "self", ".", "AccessLogSetting", ",", "canary_setting", "=", "self", ".", "CanarySetting", ",", "tracing_enabled", "=", "self", ".", "TracingEnabled", ",", "resource_attributes", "=", "self", ".", "resource_attributes", ",", "passthrough_resource_attributes", "=", "self", ".", "get_passthrough_resource_attributes", "(", ")", ")", "rest_api", ",", "deployment", ",", "stage", ",", "permissions", "=", "api_generator", ".", "to_cloudformation", "(", ")", "resources", ".", "extend", "(", "[", "rest_api", ",", "deployment", ",", "stage", "]", ")", "resources", ".", "extend", "(", "permissions", ")", "return", "resources" ]
Returns the API Gateway RestApi, Deployment, and Stage to which this SAM Api corresponds. :param dict kwargs: already-converted resources that may need to be modified when converting this \ macro to pure CloudFormation :returns: a list of vanilla CloudFormation Resources, to which this Function expands :rtype: list
[ "Returns", "the", "API", "Gateway", "RestApi", "Deployment", "and", "Stage", "to", "which", "this", "SAM", "Api", "corresponds", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L456-L493
train
Returns the API Gateway RestApi Deployment and Stage to which this SAM Api corresponds.
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' + chr(0b1101111) + chr(0b100 + 0o57) + chr(0b110000) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101110 + 0o101) + chr(50) + chr(0b1001 + 0o55) + chr(339 - 288), 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b11101 + 0o122) + '\062' + '\x32' + '\x37', 20658 - 20650), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(111) + chr(0b110110) + chr(0b1100 + 0o52), 46246 - 46238), ehT0Px3KOsy9(chr(1695 - 1647) + chr(111) + chr(0b0 + 0o62), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(49) + '\x30', 13953 - 13945), ehT0Px3KOsy9(chr(1413 - 1365) + chr(111) + chr(0b110001) + '\x31' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\x6f' + '\063' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(111) + '\063' + '\x30' + chr(359 - 310), 14979 - 14971), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11 + 0o56) + chr(2221 - 2169) + chr(821 - 768), 0o10), ehT0Px3KOsy9('\x30' + chr(0b110001 + 0o76) + '\061' + chr(2218 - 2165) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(1760 - 1706) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101011 + 0o4) + chr(333 - 283) + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(8114 - 8003) + chr(1427 - 1377) + '\063' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6435 - 6324) + '\x31' + chr(1111 - 1061) + '\064', 59124 - 59116), ehT0Px3KOsy9(chr(48) + chr(0b1001011 + 0o44) + '\x36' + chr(1716 - 1667), 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + '\061' + chr(55) + '\x34', 0o10), ehT0Px3KOsy9('\060' + chr(0b1010011 + 0o34) + chr(49) + '\x30' + chr(0b11010 + 0o26), 19176 - 19168), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1 + 0o62) + chr(2729 - 2675) + chr(1826 - 1777), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(801 - 752) + chr(49) + chr(2108 - 2060), 0o10), ehT0Px3KOsy9(chr(612 - 564) + chr(0b1101111) + chr(0b110010) + '\067' + chr(55), 26077 - 26069), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1101111) + chr(0b1 + 0o61) + chr(1858 - 1808) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(2979 - 2924) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + chr(3085 - 2974) + chr(0b110010) + chr(1796 - 1747), 34681 - 34673), ehT0Px3KOsy9(chr(1304 - 1256) + '\157' + chr(0b110010) + chr(50) + chr(1588 - 1534), 61418 - 61410), ehT0Px3KOsy9(chr(695 - 647) + chr(0b1101111) + chr(1544 - 1493) + '\x30' + chr(0b101001 + 0o7), 48742 - 48734), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(2563 - 2452) + chr(0b10110 + 0o34) + chr(0b110000) + chr(51), 62381 - 62373), ehT0Px3KOsy9(chr(949 - 901) + chr(0b1011110 + 0o21) + chr(2378 - 2327) + '\x35' + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10101 + 0o34) + chr(0b110110) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(327 - 216) + chr(50) + '\062' + chr(0b1100 + 0o47), 46648 - 46640), ehT0Px3KOsy9(chr(307 - 259) + chr(0b11 + 0o154) + chr(0b110110) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\x6f' + chr(0b1000 + 0o53) + '\x36' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(673 - 625) + chr(10260 - 10149) + chr(51) + chr(0b100010 + 0o24) + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101100 + 0o5) + chr(2132 - 2081), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(0b110111) + chr(0b110000 + 0o4), 0b1000), ehT0Px3KOsy9('\060' + chr(0b111100 + 0o63) + chr(51) + chr(0b10010 + 0o45) + chr(0b110000), 8), ehT0Px3KOsy9(chr(48) + chr(0b1000101 + 0o52) + chr(0b1011 + 0o50) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(1789 - 1678) + '\x32' + chr(0b10111 + 0o34) + '\067', 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(340 - 291) + '\065' + chr(51), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b111010 + 0o65) + chr(0b10000 + 0o45) + chr(1899 - 1851), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xea'), chr(0b1000111 + 0o35) + chr(101) + chr(0b11 + 0o140) + '\x6f' + '\144' + chr(0b1100101))(chr(13069 - 12952) + chr(8415 - 8299) + chr(0b1001010 + 0o34) + chr(0b101101) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def NpIm0Ph3ybvM(oVre8I6UXc3b, **M8EIoTs2GJXE): z4Xs9XhDbg00 = [] xemrOJgPRnxF = H7J9J9VdA3sH(oVre8I6UXc3b.NpZr66MdBhVG, oVre8I6UXc3b.sTRaBxaX7uma, oVre8I6UXc3b.bx51LNChmmAb, oVre8I6UXc3b.B4UP3bPuJwoE, oVre8I6UXc3b.oayEYOknteBp, oVre8I6UXc3b.DefinitionBody, oVre8I6UXc3b.DefinitionUri, oVre8I6UXc3b.i0VlBfTP2Syn, oVre8I6UXc3b.UBd8m151fyes, endpoint_configuration=oVre8I6UXc3b.cmyeg6qy4vUa, method_settings=oVre8I6UXc3b.dzu6W3TCi9dY, binary_media=oVre8I6UXc3b.wCNzsayNNjP8, minimum_compression_size=oVre8I6UXc3b.M4WfvpvHpByE, cors=oVre8I6UXc3b.Cors, auth=oVre8I6UXc3b.Auth, gateway_responses=oVre8I6UXc3b.GatewayResponses, access_log_setting=oVre8I6UXc3b.bgqKu5KPufqu, canary_setting=oVre8I6UXc3b.QGY0EAHcILLB, tracing_enabled=oVre8I6UXc3b.SDUih2gtvtmh, resource_attributes=oVre8I6UXc3b.x7ddN_ki5nGn, passthrough_resource_attributes=oVre8I6UXc3b.get_passthrough_resource_attributes()) (zxUfyoBahbWI, Gh86J6oCA0R0, VRrhsVxQMv59, Rm5AxuvmuBEr) = xemrOJgPRnxF.to_cloudformation() xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa1\xcb\xe3Sl\xac'), '\x64' + '\x65' + '\x63' + chr(0b1101111) + chr(0b1000111 + 0o35) + chr(101))('\x75' + chr(2903 - 2787) + chr(0b1101 + 0o131) + chr(1260 - 1215) + chr(2585 - 2529)))([zxUfyoBahbWI, Gh86J6oCA0R0, VRrhsVxQMv59]) xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa1\xcb\xe3Sl\xac'), chr(0b1000011 + 0o41) + chr(0b1100101) + '\143' + chr(1988 - 1877) + chr(7089 - 6989) + chr(0b1100101))('\x75' + chr(4558 - 4442) + '\146' + chr(45) + chr(56)))(Rm5AxuvmuBEr) return z4Xs9XhDbg00
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
SamApplication._construct_nested_stack
def _construct_nested_stack(self): """Constructs a AWS::CloudFormation::Stack resource """ nested_stack = NestedStack(self.logical_id, depends_on=self.depends_on, attributes=self.get_passthrough_resource_attributes()) nested_stack.Parameters = self.Parameters nested_stack.NotificationArns = self.NotificationArns application_tags = self._get_application_tags() nested_stack.Tags = self._construct_tag_list(self.Tags, application_tags) nested_stack.TimeoutInMinutes = self.TimeoutInMinutes nested_stack.TemplateURL = self.TemplateUrl if self.TemplateUrl else "" return nested_stack
python
def _construct_nested_stack(self): """Constructs a AWS::CloudFormation::Stack resource """ nested_stack = NestedStack(self.logical_id, depends_on=self.depends_on, attributes=self.get_passthrough_resource_attributes()) nested_stack.Parameters = self.Parameters nested_stack.NotificationArns = self.NotificationArns application_tags = self._get_application_tags() nested_stack.Tags = self._construct_tag_list(self.Tags, application_tags) nested_stack.TimeoutInMinutes = self.TimeoutInMinutes nested_stack.TemplateURL = self.TemplateUrl if self.TemplateUrl else "" return nested_stack
[ "def", "_construct_nested_stack", "(", "self", ")", ":", "nested_stack", "=", "NestedStack", "(", "self", ".", "logical_id", ",", "depends_on", "=", "self", ".", "depends_on", ",", "attributes", "=", "self", ".", "get_passthrough_resource_attributes", "(", ")", ")", "nested_stack", ".", "Parameters", "=", "self", ".", "Parameters", "nested_stack", ".", "NotificationArns", "=", "self", ".", "NotificationArns", "application_tags", "=", "self", ".", "_get_application_tags", "(", ")", "nested_stack", ".", "Tags", "=", "self", ".", "_construct_tag_list", "(", "self", ".", "Tags", ",", "application_tags", ")", "nested_stack", ".", "TimeoutInMinutes", "=", "self", ".", "TimeoutInMinutes", "nested_stack", ".", "TemplateURL", "=", "self", ".", "TemplateUrl", "if", "self", ".", "TemplateUrl", "else", "\"\"", "return", "nested_stack" ]
Constructs a AWS::CloudFormation::Stack resource
[ "Constructs", "a", "AWS", "::", "CloudFormation", "::", "Stack", "resource" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L583-L595
train
Constructs a nested stack for this 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_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9Flfz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M2Z,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(111) + '\061' + chr(49) + chr(733 - 680), 0b1000), ehT0Px3KOsy9(chr(2110 - 2062) + chr(0b101011 + 0o104) + chr(924 - 873) + '\064' + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(0b1000101 + 0o52) + '\x33' + '\x31' + chr(0b110 + 0o61), 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\x6f' + '\063' + '\x34' + chr(0b110001), 13324 - 13316), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(2271 - 2160) + chr(49) + chr(0b110111) + chr(0b101001 + 0o7), 0b1000), ehT0Px3KOsy9('\060' + chr(0b110101 + 0o72) + chr(0b110001) + chr(51) + '\066', 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + chr(0b110 + 0o54) + '\064' + chr(1249 - 1200), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b101111 + 0o100) + '\x33' + chr(0b110110) + chr(615 - 560), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b1 + 0o61) + '\x34' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(8707 - 8596) + chr(51) + '\x36' + chr(0b1101 + 0o50), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + '\060' + chr(1503 - 1448), 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(1861 - 1750) + chr(50) + chr(2275 - 2220) + '\060', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(0b10 + 0o63) + chr(2234 - 2182), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1000 + 0o147) + '\063' + chr(48) + chr(1840 - 1788), 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + chr(0b10111 + 0o33) + chr(0b101 + 0o54) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11111 + 0o22) + chr(0b110101) + chr(49), 31734 - 31726), ehT0Px3KOsy9('\060' + '\157' + chr(0b1101 + 0o46) + '\x37' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\x6f' + '\x33' + chr(1362 - 1311), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(11333 - 11222) + chr(51) + chr(0b100101 + 0o22) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + chr(1212 - 1162) + '\x31' + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b101110 + 0o4) + chr(2579 - 2527), 31549 - 31541), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(2485 - 2430) + '\067', 0o10), ehT0Px3KOsy9('\x30' + chr(11091 - 10980) + '\x31' + chr(0b110111) + chr(53), 0o10), ehT0Px3KOsy9(chr(550 - 502) + chr(0b11101 + 0o122) + chr(428 - 378) + chr(0b1010 + 0o52) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + chr(660 - 606) + chr(0b110000), 53240 - 53232), ehT0Px3KOsy9(chr(579 - 531) + '\x6f' + chr(0b1111 + 0o44) + '\060' + chr(1307 - 1252), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + '\x36' + chr(1599 - 1545), 20681 - 20673), ehT0Px3KOsy9(chr(2299 - 2251) + chr(0b1100 + 0o143) + chr(0b110010) + '\x35' + '\066', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(0b110111) + '\065', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100 + 0o57) + '\x34' + chr(0b11100 + 0o26), 22529 - 22521), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + '\x33' + '\060', 0o10), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\157' + chr(0b11100 + 0o27) + chr(0b110001) + chr(384 - 333), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b1000 + 0o54) + chr(898 - 850), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + '\061' + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(1170 - 1122) + '\157' + '\x32' + chr(54) + chr(1271 - 1221), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b101 + 0o152) + chr(1081 - 1031) + chr(649 - 601) + chr(0b11101 + 0o26), 27076 - 27068), ehT0Px3KOsy9(chr(1788 - 1740) + chr(0b1101111) + chr(0b110010) + chr(1361 - 1308) + chr(52), 8), ehT0Px3KOsy9(chr(48) + chr(0b1001010 + 0o45) + chr(199 - 150) + chr(0b1101 + 0o45) + chr(2836 - 2781), 12693 - 12685), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + chr(391 - 340) + chr(1384 - 1331), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1743 - 1694) + chr(52), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\065' + chr(0b11110 + 0o22), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'c'), chr(0b1100100) + chr(0b1010110 + 0o17) + chr(99) + chr(111) + chr(0b1100100) + chr(4730 - 4629))('\x75' + chr(116) + '\146' + '\055' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def PouxLm8M1kFh(oVre8I6UXc3b): XqPbPSNf9NnG = SI9qufy4ni0Q(oVre8I6UXc3b.NpZr66MdBhVG, depends_on=oVre8I6UXc3b.oayEYOknteBp, attributes=oVre8I6UXc3b.get_passthrough_resource_attributes()) XqPbPSNf9NnG.dxzjHB_F1JOW = oVre8I6UXc3b.dxzjHB_F1JOW XqPbPSNf9NnG.jcRwBSAeGwli = oVre8I6UXc3b.jcRwBSAeGwli bs1Js1QvziV5 = oVre8I6UXc3b._get_application_tags() XqPbPSNf9NnG.xQN6xY3huZ18 = oVre8I6UXc3b._construct_tag_list(oVre8I6UXc3b.xQN6xY3huZ18, bs1Js1QvziV5) XqPbPSNf9NnG.VUmX3Pdr2mnB = oVre8I6UXc3b.VUmX3Pdr2mnB XqPbPSNf9NnG.ecIEfzGeLBrX = oVre8I6UXc3b.TemplateUrl if oVre8I6UXc3b.TemplateUrl else xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b100111 + 0o75) + chr(4697 - 4596) + chr(0b1100011) + '\x6f' + '\x64' + chr(0b110110 + 0o57))(chr(4396 - 4279) + chr(7546 - 7430) + chr(102) + '\055' + '\070') return XqPbPSNf9NnG
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
SamApplication._get_application_tags
def _get_application_tags(self): """Adds tags to the stack if this resource is using the serverless app repo """ application_tags = {} if isinstance(self.Location, dict): if (self.APPLICATION_ID_KEY in self.Location.keys() and self.Location[self.APPLICATION_ID_KEY] is not None): application_tags[self._SAR_APP_KEY] = self.Location[self.APPLICATION_ID_KEY] if (self.SEMANTIC_VERSION_KEY in self.Location.keys() and self.Location[self.SEMANTIC_VERSION_KEY] is not None): application_tags[self._SAR_SEMVER_KEY] = self.Location[self.SEMANTIC_VERSION_KEY] return application_tags
python
def _get_application_tags(self): """Adds tags to the stack if this resource is using the serverless app repo """ application_tags = {} if isinstance(self.Location, dict): if (self.APPLICATION_ID_KEY in self.Location.keys() and self.Location[self.APPLICATION_ID_KEY] is not None): application_tags[self._SAR_APP_KEY] = self.Location[self.APPLICATION_ID_KEY] if (self.SEMANTIC_VERSION_KEY in self.Location.keys() and self.Location[self.SEMANTIC_VERSION_KEY] is not None): application_tags[self._SAR_SEMVER_KEY] = self.Location[self.SEMANTIC_VERSION_KEY] return application_tags
[ "def", "_get_application_tags", "(", "self", ")", ":", "application_tags", "=", "{", "}", "if", "isinstance", "(", "self", ".", "Location", ",", "dict", ")", ":", "if", "(", "self", ".", "APPLICATION_ID_KEY", "in", "self", ".", "Location", ".", "keys", "(", ")", "and", "self", ".", "Location", "[", "self", ".", "APPLICATION_ID_KEY", "]", "is", "not", "None", ")", ":", "application_tags", "[", "self", ".", "_SAR_APP_KEY", "]", "=", "self", ".", "Location", "[", "self", ".", "APPLICATION_ID_KEY", "]", "if", "(", "self", ".", "SEMANTIC_VERSION_KEY", "in", "self", ".", "Location", ".", "keys", "(", ")", "and", "self", ".", "Location", "[", "self", ".", "SEMANTIC_VERSION_KEY", "]", "is", "not", "None", ")", ":", "application_tags", "[", "self", ".", "_SAR_SEMVER_KEY", "]", "=", "self", ".", "Location", "[", "self", ".", "SEMANTIC_VERSION_KEY", "]", "return", "application_tags" ]
Adds tags to the stack if this resource is using the serverless app repo
[ "Adds", "tags", "to", "the", "stack", "if", "this", "resource", "is", "using", "the", "serverless", "app", "repo" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L597-L608
train
Adds tags to the stack if this resource is using the serverless app repo
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb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h,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(10762 - 10651) + chr(51) + chr(2600 - 2549), 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + chr(0b101000 + 0o13) + chr(0b110010) + chr(896 - 848), 0o10), ehT0Px3KOsy9(chr(357 - 309) + chr(0b1000011 + 0o54) + chr(0b110011) + chr(2282 - 2231) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\x6f' + chr(0b110001) + chr(0b110000 + 0o1) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\x6f' + chr(51) + '\064' + chr(1601 - 1552), 64040 - 64032), ehT0Px3KOsy9(chr(905 - 857) + chr(0b1100011 + 0o14) + chr(54) + chr(51), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(677 - 629), 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\157' + chr(54), 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + '\062' + '\064' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(53) + chr(924 - 873), 62379 - 62371), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(2366 - 2313) + chr(54), 32232 - 32224), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\157' + '\x33' + '\x33' + '\065', 0b1000), ehT0Px3KOsy9(chr(1075 - 1027) + chr(111) + chr(0b110001) + '\x34' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(1295 - 1247) + chr(0b100001 + 0o116) + chr(0b101010 + 0o7) + chr(944 - 890) + chr(2404 - 2351), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(561 - 507) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + '\061' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + chr(0b1110 + 0o43) + chr(689 - 638) + '\x30', 23996 - 23988), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(0b100 + 0o60) + chr(1466 - 1413), 50853 - 50845), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(0b110000) + '\x31', 16126 - 16118), ehT0Px3KOsy9(chr(48) + chr(3212 - 3101) + chr(0b101001 + 0o10) + chr(0b100111 + 0o15) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b10011 + 0o134) + '\063' + chr(0b1000 + 0o52) + chr(1491 - 1437), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(50) + chr(802 - 754), 0o10), ehT0Px3KOsy9(chr(152 - 104) + chr(5421 - 5310) + chr(0b110001) + '\x31' + chr(2891 - 2837), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + '\064' + '\062', 64449 - 64441), ehT0Px3KOsy9('\060' + chr(10311 - 10200) + '\063' + '\x31' + chr(53), 0b1000), ehT0Px3KOsy9(chr(1377 - 1329) + '\x6f' + '\x33' + '\x35' + chr(0b100100 + 0o23), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9537 - 9426) + chr(2387 - 2337) + chr(2043 - 1993) + '\067', 0o10), ehT0Px3KOsy9(chr(2017 - 1969) + '\157' + chr(0b110010) + chr(51) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101101 + 0o5) + chr(1999 - 1947) + '\065', 8), ehT0Px3KOsy9(chr(816 - 768) + '\x6f' + chr(49) + chr(1383 - 1330) + chr(49), 40655 - 40647), ehT0Px3KOsy9(chr(1863 - 1815) + '\157' + '\063' + chr(0b110110) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(52) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(55) + chr(48), 0o10), ehT0Px3KOsy9(chr(1176 - 1128) + '\157' + chr(0b1 + 0o63) + chr(55), 13076 - 13068), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b110001) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(207 - 155) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2073 - 2022) + chr(0b110100) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(11729 - 11618) + chr(0b110010) + chr(50) + chr(0b110000), 8), ehT0Px3KOsy9(chr(48) + chr(0b101101 + 0o102) + chr(0b10000 + 0o43) + '\062' + chr(0b110010 + 0o5), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10001 + 0o42) + chr(549 - 495) + chr(815 - 760), 59137 - 59129)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\065' + chr(48), 23930 - 23922)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'5'), chr(100) + chr(0b10001 + 0o124) + chr(99) + chr(3873 - 3762) + '\144' + chr(0b1100101))('\x75' + chr(0b11110 + 0o126) + '\x66' + '\x2d' + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def KehQIKn4wQuG(oVre8I6UXc3b): bs1Js1QvziV5 = {} if PlSM16l2KDPD(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'W\xbf\xb9,\x95Zwh'), chr(0b1011111 + 0o5) + '\x65' + '\143' + '\x6f' + '\x64' + chr(101))(chr(0b1110101) + chr(3062 - 2946) + chr(102) + '\055' + chr(1857 - 1801))), wLqBDw8l0eIm): if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'Z\x80\x8a\x01\xa8pYR\xedd\xe0\x82)1\xea\x04\x1d\xfc'), chr(100) + chr(0b1100101) + chr(7930 - 7831) + chr(0b1001111 + 0o40) + chr(4474 - 4374) + chr(0b1100101))('\x75' + '\164' + chr(102) + chr(45) + chr(0b111000))) in xafqLlk3kkUe(oVre8I6UXc3b.Location, xafqLlk3kkUe(SXOLrMavuUCe(b'p\xb5\xa3>'), '\x64' + '\x65' + chr(0b101 + 0o136) + chr(0b1100111 + 0o10) + chr(7506 - 7406) + chr(0b1100101))(chr(117) + chr(2200 - 2084) + chr(5205 - 5103) + chr(1311 - 1266) + chr(0b10000 + 0o50)))() and xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'W\xbf\xb9,\x95Zwh'), chr(0b1001001 + 0o33) + chr(101) + chr(3125 - 3026) + chr(111) + chr(0b1100100) + chr(0b1100101))('\x75' + '\x74' + '\x66' + '\x2d' + '\x38'))[xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'Z\x80\x8a\x01\xa8pYR\xedd\xe0\x82)1\xea\x04\x1d\xfc'), '\144' + chr(0b1100101) + chr(6915 - 6816) + chr(12087 - 11976) + chr(0b100011 + 0o101) + chr(1771 - 1670))(chr(10413 - 10296) + '\x74' + '\146' + chr(45) + chr(0b1110 + 0o52)))] is not None: bs1Js1QvziV5[oVre8I6UXc3b.DMbDt8wBPzs8] = oVre8I6UXc3b.Location[oVre8I6UXc3b.APPLICATION_ID_KEY] if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'H\x95\x97\x0c\xafgQE\xfb}\xeb\x8f3<\xfa\x01\x07\xee\x04<'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(0b1101111) + '\x64' + chr(3999 - 3898))(chr(0b110001 + 0o104) + '\164' + chr(0b1100110) + chr(582 - 537) + chr(0b111000))) in xafqLlk3kkUe(oVre8I6UXc3b.Location, xafqLlk3kkUe(SXOLrMavuUCe(b'p\xb5\xa3>'), chr(100) + chr(0b1001101 + 0o30) + chr(99) + '\157' + chr(4185 - 4085) + chr(0b1100101))(chr(0b111101 + 0o70) + chr(0b110110 + 0o76) + '\146' + chr(0b0 + 0o55) + '\x38'))() and xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'W\xbf\xb9,\x95Zwh'), chr(0b1100100) + chr(0b1011000 + 0o15) + chr(0b10110 + 0o115) + '\x6f' + chr(0b1100100) + chr(0b1100101))('\165' + chr(0b11110 + 0o126) + chr(0b110011 + 0o63) + chr(0b101101) + '\x38'))[xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'H\x95\x97\x0c\xafgQE\xfb}\xeb\x8f3<\xfa\x01\x07\xee\x04<'), chr(6665 - 6565) + chr(101) + chr(0b1100000 + 0o3) + chr(670 - 559) + '\144' + chr(0b1000001 + 0o44))('\165' + chr(0b1011110 + 0o26) + chr(102) + '\x2d' + '\070'))] is not None: bs1Js1QvziV5[oVre8I6UXc3b.yZFOzEGI4bZj] = oVre8I6UXc3b.Location[oVre8I6UXc3b.SEMANTIC_VERSION_KEY] return bs1Js1QvziV5
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
SamLayerVersion.to_cloudformation
def to_cloudformation(self, **kwargs): """Returns the Lambda layer to which this SAM Layer corresponds. :param dict kwargs: already-converted resources that may need to be modified when converting this \ macro to pure CloudFormation :returns: a list of vanilla CloudFormation Resources, to which this Function expands :rtype: list """ resources = [] # Append any CFN resources: intrinsics_resolver = kwargs["intrinsics_resolver"] resources.append(self._construct_lambda_layer(intrinsics_resolver)) return resources
python
def to_cloudformation(self, **kwargs): """Returns the Lambda layer to which this SAM Layer corresponds. :param dict kwargs: already-converted resources that may need to be modified when converting this \ macro to pure CloudFormation :returns: a list of vanilla CloudFormation Resources, to which this Function expands :rtype: list """ resources = [] # Append any CFN resources: intrinsics_resolver = kwargs["intrinsics_resolver"] resources.append(self._construct_lambda_layer(intrinsics_resolver)) return resources
[ "def", "to_cloudformation", "(", "self", ",", "*", "*", "kwargs", ")", ":", "resources", "=", "[", "]", "# Append any CFN resources:", "intrinsics_resolver", "=", "kwargs", "[", "\"intrinsics_resolver\"", "]", "resources", ".", "append", "(", "self", ".", "_construct_lambda_layer", "(", "intrinsics_resolver", ")", ")", "return", "resources" ]
Returns the Lambda layer to which this SAM Layer corresponds. :param dict kwargs: already-converted resources that may need to be modified when converting this \ macro to pure CloudFormation :returns: a list of vanilla CloudFormation Resources, to which this Function expands :rtype: list
[ "Returns", "the", "Lambda", "layer", "to", "which", "this", "SAM", "Layer", "corresponds", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L628-L642
train
Returns the Lambda layer to which this Function corresponds.
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,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LkHVB2V,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(9882 - 9771) + chr(49) + chr(2293 - 2238) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000101 + 0o52) + chr(0b110010) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000110 + 0o51) + '\x32' + chr(2115 - 2063) + chr(236 - 187), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + '\x33' + chr(0b10010 + 0o40) + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b110111), 45970 - 45962), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\065' + '\067', 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(111) + chr(936 - 887) + '\063' + chr(0b11110 + 0o27), 0o10), ehT0Px3KOsy9('\060' + chr(1634 - 1523) + chr(713 - 662) + chr(1745 - 1696) + chr(0b110110), 31774 - 31766), ehT0Px3KOsy9(chr(808 - 760) + chr(0b1101010 + 0o5) + '\x37' + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(2241 - 2186) + chr(1090 - 1039), 8), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + '\x33' + chr(2536 - 2485) + '\060', 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\157' + '\061' + chr(0b1100 + 0o44) + chr(0b11001 + 0o30), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + '\062' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(677 - 629) + chr(111) + chr(50) + chr(0b100110 + 0o21) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + chr(1591 - 1538) + chr(0b1010 + 0o54), 0o10), ehT0Px3KOsy9(chr(262 - 214) + chr(0b1101111) + '\x32' + chr(51) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(822 - 772) + '\067' + chr(0b110110), 45894 - 45886), ehT0Px3KOsy9('\x30' + chr(111) + chr(78 - 29) + '\064' + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b100 + 0o63) + chr(1630 - 1581), 10245 - 10237), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1 + 0o57), 0o10), ehT0Px3KOsy9(chr(1178 - 1130) + chr(8102 - 7991) + chr(0b110010) + chr(0b110110) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1663 - 1552) + chr(51) + chr(0b110100) + chr(1385 - 1333), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1538 - 1488) + chr(0b100000 + 0o22) + chr(0b10110 + 0o32), 7508 - 7500), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(887 - 776) + chr(53), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(1845 - 1796) + '\x37' + chr(0b101010 + 0o6), 8474 - 8466), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(0b11 + 0o64) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + chr(0b1 + 0o61) + chr(0b101110 + 0o6) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(4954 - 4843) + '\x31' + chr(0b110010 + 0o0) + chr(0b100000 + 0o20), 37326 - 37318), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(0b110010 + 0o4) + chr(121 - 68), 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + chr(2152 - 2103) + chr(0b1000 + 0o50) + chr(2089 - 2041), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11001 + 0o32) + chr(2244 - 2190) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(52) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1245 - 1193) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(111) + chr(1572 - 1523) + chr(55) + chr(0b110000), 8), ehT0Px3KOsy9('\060' + chr(8210 - 8099) + chr(2307 - 2258) + chr(50) + chr(0b110001 + 0o3), 0b1000), ehT0Px3KOsy9('\060' + chr(0b111110 + 0o61) + chr(0b1101 + 0o44) + chr(0b101110 + 0o6) + chr(50), 37626 - 37618), ehT0Px3KOsy9('\060' + chr(0b1101111 + 0o0) + chr(933 - 882) + '\061', 0o10), ehT0Px3KOsy9(chr(1617 - 1569) + '\157' + '\x31' + chr(415 - 366) + chr(0b101110 + 0o11), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + '\063' + chr(0b1010 + 0o55), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + '\065' + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'U'), chr(0b1100100) + chr(0b10111 + 0o116) + '\x63' + '\157' + chr(100) + '\x65')(chr(0b1110101) + chr(11447 - 11331) + '\x66' + chr(45) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def NpIm0Ph3ybvM(oVre8I6UXc3b, **M8EIoTs2GJXE): z4Xs9XhDbg00 = [] M8xEnnSGIF9g = M8EIoTs2GJXE[xafqLlk3kkUe(SXOLrMavuUCe(b'\x12x\xd5\xa1v\x81.\xa7Xu$\xaa$\xe1\xd0\x82\xed\xdb\x11'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\157' + chr(0b1100100) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(4220 - 4118) + '\x2d' + chr(0b100001 + 0o27))] xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1af\xd1\xb6q\x8b'), chr(0b1100100) + '\x65' + chr(0b1010001 + 0o22) + '\x6f' + chr(4771 - 4671) + chr(0b1100100 + 0o1))(chr(0b1110101) + chr(2944 - 2828) + chr(102) + chr(0b101011 + 0o2) + chr(0b11100 + 0o34)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'$u\xce\xbdl\x9b/\xbbXr$\xb4 \xff\xdd\x8a\xfa\xe1\x0fXy\xd1\x96'), chr(100) + chr(0b1100101) + chr(2191 - 2092) + '\x6f' + '\144' + chr(101))(chr(117) + chr(0b1110100) + '\146' + chr(0b101101) + chr(2785 - 2729)))(M8xEnnSGIF9g)) return z4Xs9XhDbg00
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
SamLayerVersion._construct_lambda_layer
def _construct_lambda_layer(self, intrinsics_resolver): """Constructs and returns the Lambda function. :returns: a list containing the Lambda function and execution role resources :rtype: list """ # Resolve intrinsics if applicable: self.LayerName = self._resolve_string_parameter(intrinsics_resolver, self.LayerName, 'LayerName') self.LicenseInfo = self._resolve_string_parameter(intrinsics_resolver, self.LicenseInfo, 'LicenseInfo') self.Description = self._resolve_string_parameter(intrinsics_resolver, self.Description, 'Description') self.RetentionPolicy = self._resolve_string_parameter(intrinsics_resolver, self.RetentionPolicy, 'RetentionPolicy') retention_policy_value = self._get_retention_policy_value() attributes = self.get_passthrough_resource_attributes() if attributes is None: attributes = {} attributes['DeletionPolicy'] = retention_policy_value old_logical_id = self.logical_id new_logical_id = logical_id_generator.LogicalIdGenerator(old_logical_id, self.to_dict()).gen() self.logical_id = new_logical_id lambda_layer = LambdaLayerVersion(self.logical_id, depends_on=self.depends_on, attributes=attributes) # Changing the LayerName property: when a layer is published, it is given an Arn # example: arn:aws:lambda:us-west-2:123456789012:layer:MyLayer:1 # where MyLayer is the LayerName property if it exists; otherwise, it is the # LogicalId of this resource. Since a LayerVersion is an immutable resource, when # CloudFormation updates this resource, it will ALWAYS create a new version then # delete the old version if the logical ids match. What this does is change the # logical id of every layer (so a `DeletionPolicy: Retain` can work) and set the # LayerName property of the layer so that the Arn will still always be the same # with the exception of an incrementing version number. if not self.LayerName: self.LayerName = old_logical_id lambda_layer.LayerName = self.LayerName lambda_layer.Description = self.Description lambda_layer.Content = construct_s3_location_object(self.ContentUri, self.logical_id, 'ContentUri') lambda_layer.CompatibleRuntimes = self.CompatibleRuntimes lambda_layer.LicenseInfo = self.LicenseInfo return lambda_layer
python
def _construct_lambda_layer(self, intrinsics_resolver): """Constructs and returns the Lambda function. :returns: a list containing the Lambda function and execution role resources :rtype: list """ # Resolve intrinsics if applicable: self.LayerName = self._resolve_string_parameter(intrinsics_resolver, self.LayerName, 'LayerName') self.LicenseInfo = self._resolve_string_parameter(intrinsics_resolver, self.LicenseInfo, 'LicenseInfo') self.Description = self._resolve_string_parameter(intrinsics_resolver, self.Description, 'Description') self.RetentionPolicy = self._resolve_string_parameter(intrinsics_resolver, self.RetentionPolicy, 'RetentionPolicy') retention_policy_value = self._get_retention_policy_value() attributes = self.get_passthrough_resource_attributes() if attributes is None: attributes = {} attributes['DeletionPolicy'] = retention_policy_value old_logical_id = self.logical_id new_logical_id = logical_id_generator.LogicalIdGenerator(old_logical_id, self.to_dict()).gen() self.logical_id = new_logical_id lambda_layer = LambdaLayerVersion(self.logical_id, depends_on=self.depends_on, attributes=attributes) # Changing the LayerName property: when a layer is published, it is given an Arn # example: arn:aws:lambda:us-west-2:123456789012:layer:MyLayer:1 # where MyLayer is the LayerName property if it exists; otherwise, it is the # LogicalId of this resource. Since a LayerVersion is an immutable resource, when # CloudFormation updates this resource, it will ALWAYS create a new version then # delete the old version if the logical ids match. What this does is change the # logical id of every layer (so a `DeletionPolicy: Retain` can work) and set the # LayerName property of the layer so that the Arn will still always be the same # with the exception of an incrementing version number. if not self.LayerName: self.LayerName = old_logical_id lambda_layer.LayerName = self.LayerName lambda_layer.Description = self.Description lambda_layer.Content = construct_s3_location_object(self.ContentUri, self.logical_id, 'ContentUri') lambda_layer.CompatibleRuntimes = self.CompatibleRuntimes lambda_layer.LicenseInfo = self.LicenseInfo return lambda_layer
[ "def", "_construct_lambda_layer", "(", "self", ",", "intrinsics_resolver", ")", ":", "# Resolve intrinsics if applicable:", "self", ".", "LayerName", "=", "self", ".", "_resolve_string_parameter", "(", "intrinsics_resolver", ",", "self", ".", "LayerName", ",", "'LayerName'", ")", "self", ".", "LicenseInfo", "=", "self", ".", "_resolve_string_parameter", "(", "intrinsics_resolver", ",", "self", ".", "LicenseInfo", ",", "'LicenseInfo'", ")", "self", ".", "Description", "=", "self", ".", "_resolve_string_parameter", "(", "intrinsics_resolver", ",", "self", ".", "Description", ",", "'Description'", ")", "self", ".", "RetentionPolicy", "=", "self", ".", "_resolve_string_parameter", "(", "intrinsics_resolver", ",", "self", ".", "RetentionPolicy", ",", "'RetentionPolicy'", ")", "retention_policy_value", "=", "self", ".", "_get_retention_policy_value", "(", ")", "attributes", "=", "self", ".", "get_passthrough_resource_attributes", "(", ")", "if", "attributes", "is", "None", ":", "attributes", "=", "{", "}", "attributes", "[", "'DeletionPolicy'", "]", "=", "retention_policy_value", "old_logical_id", "=", "self", ".", "logical_id", "new_logical_id", "=", "logical_id_generator", ".", "LogicalIdGenerator", "(", "old_logical_id", ",", "self", ".", "to_dict", "(", ")", ")", ".", "gen", "(", ")", "self", ".", "logical_id", "=", "new_logical_id", "lambda_layer", "=", "LambdaLayerVersion", "(", "self", ".", "logical_id", ",", "depends_on", "=", "self", ".", "depends_on", ",", "attributes", "=", "attributes", ")", "# Changing the LayerName property: when a layer is published, it is given an Arn", "# example: arn:aws:lambda:us-west-2:123456789012:layer:MyLayer:1", "# where MyLayer is the LayerName property if it exists; otherwise, it is the", "# LogicalId of this resource. Since a LayerVersion is an immutable resource, when", "# CloudFormation updates this resource, it will ALWAYS create a new version then", "# delete the old version if the logical ids match. What this does is change the", "# logical id of every layer (so a `DeletionPolicy: Retain` can work) and set the", "# LayerName property of the layer so that the Arn will still always be the same", "# with the exception of an incrementing version number.", "if", "not", "self", ".", "LayerName", ":", "self", ".", "LayerName", "=", "old_logical_id", "lambda_layer", ".", "LayerName", "=", "self", ".", "LayerName", "lambda_layer", ".", "Description", "=", "self", ".", "Description", "lambda_layer", ".", "Content", "=", "construct_s3_location_object", "(", "self", ".", "ContentUri", ",", "self", ".", "logical_id", ",", "'ContentUri'", ")", "lambda_layer", ".", "CompatibleRuntimes", "=", "self", ".", "CompatibleRuntimes", "lambda_layer", ".", "LicenseInfo", "=", "self", ".", "LicenseInfo", "return", "lambda_layer" ]
Constructs and returns the Lambda function. :returns: a list containing the Lambda function and execution role resources :rtype: list
[ "Constructs", "and", "returns", "the", "Lambda", "function", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L644-L688
train
Constructs and returns 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,FXUco0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a1WNS,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' + '\157' + '\066' + chr(333 - 281), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + '\060' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b0 + 0o157) + chr(1295 - 1244) + chr(50) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + '\x34' + chr(0b10011 + 0o43), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001111 + 0o40) + chr(0b110001) + '\063' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(2184 - 2136) + chr(0b1101111) + '\063' + '\060' + chr(1882 - 1832), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11010 + 0o30) + '\x37' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101111) + '\063' + chr(513 - 458) + '\x37', 0o10), ehT0Px3KOsy9(chr(2129 - 2081) + '\x6f' + '\x32' + chr(127 - 79) + chr(465 - 413), 40810 - 40802), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b1001 + 0o50) + '\x30' + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(0b110000) + '\x37', 0b1000), ehT0Px3KOsy9(chr(115 - 67) + chr(3581 - 3470) + chr(2770 - 2716) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + chr(134 - 83) + '\062' + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1010 + 0o50) + chr(55) + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1 + 0o156) + chr(51) + chr(0b110110) + chr(55), 2728 - 2720), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b10111 + 0o130) + chr(0b110101) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + '\061' + chr(0b110000) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + chr(0b10110 + 0o35) + chr(0b100000 + 0o23), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101100 + 0o5) + '\x34' + '\x30', 32005 - 31997), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(54) + chr(51), 0o10), ehT0Px3KOsy9('\060' + chr(3272 - 3161) + chr(1021 - 966) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(805 - 757) + chr(0b101010 + 0o105) + chr(0b10100 + 0o37) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10100 + 0o36) + '\065' + '\x32', 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(6185 - 6074) + '\x32' + chr(0b101010 + 0o15) + '\x33', 50686 - 50678), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2235 - 2185) + chr(0b110100 + 0o1) + chr(52), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(2060 - 2011) + '\x37' + chr(1508 - 1454), 0o10), ehT0Px3KOsy9(chr(236 - 188) + '\x6f' + chr(50) + chr(0b1101 + 0o52) + chr(0b100100 + 0o15), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x34' + chr(0b11 + 0o61), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3875 - 3764) + chr(49) + '\065' + chr(52), 0b1000), ehT0Px3KOsy9(chr(938 - 890) + chr(111) + chr(586 - 536) + chr(0b110011) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + chr(0b110011) + '\x32' + chr(50), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(0b110010) + chr(0b1111 + 0o46), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1001000 + 0o47) + chr(50) + chr(50) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(51) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\157' + chr(204 - 153) + chr(0b110110) + '\064', 28394 - 28386), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11 + 0o57) + chr(0b110001) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(519 - 465) + '\067', 8), ehT0Px3KOsy9(chr(2053 - 2005) + chr(0b1101111) + chr(0b110011) + '\062' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b111101 + 0o62) + '\061' + '\066' + '\062', 8823 - 8815), ehT0Px3KOsy9('\x30' + chr(0b11001 + 0o126) + chr(0b110110) + chr(0b110110), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1100100 + 0o13) + '\x35' + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a'), chr(579 - 479) + chr(2219 - 2118) + '\x63' + chr(111) + chr(0b1000010 + 0o42) + chr(0b101101 + 0o70))(chr(897 - 780) + chr(116) + chr(0b100111 + 0o77) + chr(1312 - 1267) + chr(1194 - 1138)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ZDEHpjm1BzJv(oVre8I6UXc3b, M8xEnnSGIF9g): oVre8I6UXc3b.jeNXY7wfbwG0 = oVre8I6UXc3b._resolve_string_parameter(M8xEnnSGIF9g, oVre8I6UXc3b.jeNXY7wfbwG0, xafqLlk3kkUe(SXOLrMavuUCe(b'x\xe3\xad\xc3+\x8c\xdb\x92\xe1'), chr(0b10010 + 0o122) + chr(0b1001101 + 0o30) + chr(6431 - 6332) + chr(0b1011 + 0o144) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b1011101 + 0o11) + chr(45) + chr(2938 - 2882))) oVre8I6UXc3b.T41LnMJcPf8o = oVre8I6UXc3b._resolve_string_parameter(M8xEnnSGIF9g, oVre8I6UXc3b.T41LnMJcPf8o, xafqLlk3kkUe(SXOLrMavuUCe(b'x\xeb\xb7\xc37\xb1\xdf\xb6\xea!\xe8'), chr(0b1100100) + chr(2038 - 1937) + chr(99) + '\x6f' + '\144' + '\x65')('\x75' + chr(899 - 783) + chr(9361 - 9259) + chr(327 - 282) + chr(0b111000))) oVre8I6UXc3b.Gg5N_G5JhGDN = oVre8I6UXc3b._resolve_string_parameter(M8xEnnSGIF9g, oVre8I6UXc3b.Gg5N_G5JhGDN, xafqLlk3kkUe(SXOLrMavuUCe(b'p\xe7\xa7\xc5+\xab\xca\x8b\xed(\xe9'), chr(100) + chr(0b1100101) + chr(9301 - 9202) + '\x6f' + chr(0b1100100) + chr(0b1100101))('\x75' + chr(116) + '\146' + '\x2d' + chr(0b111000))) oVre8I6UXc3b.BKJolo6Dl5xO = oVre8I6UXc3b._resolve_string_parameter(M8xEnnSGIF9g, oVre8I6UXc3b.BKJolo6Dl5xO, xafqLlk3kkUe(SXOLrMavuUCe(b'f\xe7\xa0\xc37\xb6\xd3\x90\xea\x17\xe8^\xbb\xdb\x8e'), '\144' + chr(0b1010 + 0o133) + '\x63' + '\157' + chr(0b10101 + 0o117) + chr(101))(chr(0b1110101) + chr(0b100 + 0o160) + chr(0b10001 + 0o125) + chr(0b101101) + '\x38')) CL01BU8sRNAt = oVre8I6UXc3b._get_retention_policy_value() QxDLTga8Ce_W = oVre8I6UXc3b.get_passthrough_resource_attributes() if QxDLTga8Ce_W is None: QxDLTga8Ce_W = {} QxDLTga8Ce_W[xafqLlk3kkUe(SXOLrMavuUCe(b'p\xe7\xb8\xc3-\xab\xd5\x91\xd4(\xeb[\xb1\xc1'), chr(0b1000100 + 0o40) + chr(101) + chr(99) + chr(0b1101111) + '\x64' + '\145')(chr(12261 - 12144) + '\x74' + '\x66' + '\055' + '\x38')] = CL01BU8sRNAt UnAellA9ITGu = oVre8I6UXc3b.NpZr66MdBhVG BSPsCof_3wg3 = LH9cA0AXOw_a.LogicalIdGenerator(UnAellA9ITGu, oVre8I6UXc3b.to_dict()).gen() oVre8I6UXc3b.NpZr66MdBhVG = BSPsCof_3wg3 uEBfuCMuX6Va = WuXtkjnqNljV(oVre8I6UXc3b.NpZr66MdBhVG, depends_on=oVre8I6UXc3b.oayEYOknteBp, attributes=QxDLTga8Ce_W) if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'^\xe7\x9a\xfe\x00\xf5\xcd\x99\xe60\xc0\x02'), chr(9153 - 9053) + '\x65' + '\143' + chr(8596 - 8485) + chr(0b1001001 + 0o33) + chr(8728 - 8627))(chr(0b101001 + 0o114) + chr(7731 - 7615) + chr(2981 - 2879) + chr(45) + '\070')): oVre8I6UXc3b.jeNXY7wfbwG0 = UnAellA9ITGu uEBfuCMuX6Va.jeNXY7wfbwG0 = oVre8I6UXc3b.jeNXY7wfbwG0 uEBfuCMuX6Va.Gg5N_G5JhGDN = oVre8I6UXc3b.Gg5N_G5JhGDN uEBfuCMuX6Va.RIb09SD4yCSF = HYZxL6n0oQsh(oVre8I6UXc3b.ContentUri, oVre8I6UXc3b.NpZr66MdBhVG, xafqLlk3kkUe(SXOLrMavuUCe(b'w\xed\xba\xd2<\xac\xce\xaa\xf6.'), chr(0b1010110 + 0o16) + chr(101) + chr(898 - 799) + chr(0b1101111) + chr(0b1001101 + 0o27) + chr(101))(chr(0b1110101) + '\164' + '\146' + chr(45) + chr(56))) uEBfuCMuX6Va._Z0LE4Qt30cQ = oVre8I6UXc3b._Z0LE4Qt30cQ uEBfuCMuX6Va.T41LnMJcPf8o = oVre8I6UXc3b.T41LnMJcPf8o return uEBfuCMuX6Va
awslabs/serverless-application-model
samtranslator/model/sam_resources.py
SamLayerVersion._get_retention_policy_value
def _get_retention_policy_value(self): """ Sets the deletion policy on this resource. The default is 'Retain'. :return: value for the DeletionPolicy attribute. """ if self.RetentionPolicy is None or self.RetentionPolicy.lower() == self.RETAIN.lower(): return self.RETAIN elif self.RetentionPolicy.lower() == self.DELETE.lower(): return self.DELETE elif self.RetentionPolicy.lower() not in self.retention_policy_options: raise InvalidResourceException(self.logical_id, "'{}' must be one of the following options: {}." .format('RetentionPolicy', [self.RETAIN, self.DELETE]))
python
def _get_retention_policy_value(self): """ Sets the deletion policy on this resource. The default is 'Retain'. :return: value for the DeletionPolicy attribute. """ if self.RetentionPolicy is None or self.RetentionPolicy.lower() == self.RETAIN.lower(): return self.RETAIN elif self.RetentionPolicy.lower() == self.DELETE.lower(): return self.DELETE elif self.RetentionPolicy.lower() not in self.retention_policy_options: raise InvalidResourceException(self.logical_id, "'{}' must be one of the following options: {}." .format('RetentionPolicy', [self.RETAIN, self.DELETE]))
[ "def", "_get_retention_policy_value", "(", "self", ")", ":", "if", "self", ".", "RetentionPolicy", "is", "None", "or", "self", ".", "RetentionPolicy", ".", "lower", "(", ")", "==", "self", ".", "RETAIN", ".", "lower", "(", ")", ":", "return", "self", ".", "RETAIN", "elif", "self", ".", "RetentionPolicy", ".", "lower", "(", ")", "==", "self", ".", "DELETE", ".", "lower", "(", ")", ":", "return", "self", ".", "DELETE", "elif", "self", ".", "RetentionPolicy", ".", "lower", "(", ")", "not", "in", "self", ".", "retention_policy_options", ":", "raise", "InvalidResourceException", "(", "self", ".", "logical_id", ",", "\"'{}' must be one of the following options: {}.\"", ".", "format", "(", "'RetentionPolicy'", ",", "[", "self", ".", "RETAIN", ",", "self", ".", "DELETE", "]", ")", ")" ]
Sets the deletion policy on this resource. The default is 'Retain'. :return: value for the DeletionPolicy attribute.
[ "Sets", "the", "deletion", "policy", "on", "this", "resource", ".", "The", "default", "is", "Retain", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/sam_resources.py#L690-L704
train
Returns the value for the DeletionPolicy 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_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,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(0b101100 + 0o4) + chr(111) + chr(0b110011) + chr(0b110101) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(1570 - 1522) + chr(111) + '\x33' + chr(0b110100) + chr(0b110000), 22235 - 22227), ehT0Px3KOsy9(chr(48) + chr(2717 - 2606) + '\x33' + '\x34' + chr(0b1000 + 0o53), 0o10), ehT0Px3KOsy9('\060' + chr(4930 - 4819) + '\x31' + '\x32' + chr(0b1001 + 0o47), 0b1000), ehT0Px3KOsy9(chr(48) + chr(5229 - 5118) + chr(1296 - 1245), 19130 - 19122), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(7974 - 7863) + chr(50) + '\x37' + chr(0b110100), 51617 - 51609), ehT0Px3KOsy9(chr(1751 - 1703) + chr(111) + chr(51) + chr(51) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + chr(0b11110 + 0o24) + chr(55) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100100 + 0o13) + chr(55) + chr(0b11011 + 0o30), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\061' + '\067' + chr(1389 - 1334), 0o10), ehT0Px3KOsy9(chr(1620 - 1572) + '\x6f' + chr(0b101111 + 0o2) + chr(850 - 799) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + '\x35' + '\066', 8), ehT0Px3KOsy9(chr(48) + chr(3839 - 3728) + chr(51) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\157' + '\062' + chr(0b1010 + 0o53) + '\x35', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + chr(51) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110100) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10000 + 0o41) + chr(55) + chr(0b1010 + 0o55), 8), ehT0Px3KOsy9(chr(2139 - 2091) + '\157' + '\061' + chr(2696 - 2642) + '\066', 59239 - 59231), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + chr(0b1110 + 0o44) + chr(0b100011 + 0o23) + '\067', 0o10), ehT0Px3KOsy9(chr(48) + chr(7522 - 7411) + chr(0b110 + 0o54) + '\x36' + chr(616 - 562), 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b110001 + 0o76) + chr(49) + '\x33' + chr(0b100100 + 0o16), 8), ehT0Px3KOsy9('\x30' + chr(0b111 + 0o150) + '\x32' + chr(0b101001 + 0o12), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(2002 - 1891) + chr(292 - 243) + chr(0b110101) + chr(0b1101 + 0o44), 28887 - 28879), ehT0Px3KOsy9(chr(1601 - 1553) + '\x6f' + chr(0b1110 + 0o44) + chr(54) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + chr(0b1001 + 0o52) + '\x35' + '\060', 49283 - 49275), ehT0Px3KOsy9(chr(0b110000) + chr(11233 - 11122) + chr(0b110011) + chr(0b100 + 0o55) + chr(531 - 477), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(53) + chr(294 - 246), 30742 - 30734), ehT0Px3KOsy9(chr(1900 - 1852) + chr(0b1101111) + chr(0b110010) + '\067' + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011 + 0o0) + chr(0b101101 + 0o12) + chr(1861 - 1806), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(51) + '\061', 8), ehT0Px3KOsy9(chr(1071 - 1023) + chr(0b1101111) + chr(0b110110) + '\064', 25248 - 25240), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + '\x31', 4041 - 4033), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10110 + 0o34) + chr(0b1 + 0o66) + chr(52), 8), ehT0Px3KOsy9(chr(0b110000) + chr(11459 - 11348) + '\064' + '\x34', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10111 + 0o33) + '\x34' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(0b11 + 0o61) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(720 - 672) + '\x6f' + chr(1636 - 1587) + chr(0b110001) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(137 - 89) + chr(0b1000100 + 0o53) + chr(0b100011 + 0o17) + chr(351 - 302) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + chr(1406 - 1356) + chr(0b111 + 0o51) + '\x34', 35967 - 35959), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101101 + 0o2) + '\063' + chr(0b1001 + 0o54) + chr(0b110 + 0o55), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2132 - 2079) + chr(0b10001 + 0o37), 54098 - 54090)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0'), chr(100) + chr(2883 - 2782) + chr(0b1100011) + chr(3817 - 3706) + chr(7719 - 7619) + '\x65')('\x75' + chr(0b1000100 + 0o60) + '\146' + chr(1831 - 1786) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Jh45twwlx3Pc(oVre8I6UXc3b): if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xac\xab\xa9?o\xd3\xe9\xfcWJ!\xa1'), '\x64' + chr(101) + '\143' + chr(0b1000000 + 0o57) + chr(0b1011110 + 0o6) + '\145')(chr(117) + '\164' + chr(102) + chr(0b101101) + chr(56))) is None or xafqLlk3kkUe(oVre8I6UXc3b.RetentionPolicy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x8f\x945q'), chr(0b10101 + 0o117) + chr(0b1010101 + 0o20) + chr(99) + chr(0b1101111 + 0o0) + chr(3525 - 3425) + chr(0b1000110 + 0o37))(chr(117) + '\164' + '\146' + chr(0b101101) + chr(1464 - 1408)))() == xafqLlk3kkUe(oVre8I6UXc3b.RETAIN, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x8f\x945q'), chr(0b1100100) + chr(8012 - 7911) + chr(0b1100011) + chr(0b100101 + 0o112) + '\x64' + '\145')(chr(117) + '\x74' + chr(0b1000111 + 0o37) + chr(0b101101) + '\x38'))(): return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xa5\xb7\x11J\xf2'), chr(0b1100100) + '\145' + chr(99) + '\x6f' + chr(0b1011110 + 0o6) + chr(0b1100101))(chr(0b1110101) + chr(12859 - 12743) + chr(4922 - 4820) + chr(0b1000 + 0o45) + chr(0b111000))) elif xafqLlk3kkUe(oVre8I6UXc3b.RetentionPolicy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x8f\x945q'), chr(0b110100 + 0o60) + chr(101) + chr(0b1001111 + 0o24) + '\x6f' + chr(0b11010 + 0o112) + '\x65')(chr(11072 - 10955) + chr(5061 - 4945) + chr(102) + '\055' + '\070'))() == xafqLlk3kkUe(oVre8I6UXc3b.DELETE, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x8f\x945q'), chr(0b110101 + 0o57) + '\145' + '\143' + chr(0b1101111) + chr(2882 - 2782) + chr(2553 - 2452))(chr(0b1100100 + 0o21) + chr(0b1110100) + chr(102) + '\x2d' + '\x38'))(): return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa\xa5\xaf\x15W\xf9'), chr(0b1100000 + 0o4) + chr(0b1100101) + '\x63' + '\x6f' + chr(0b1001111 + 0o25) + chr(101))(chr(117) + chr(5136 - 5020) + chr(0b1100110) + chr(0b101101) + '\070')) elif xafqLlk3kkUe(oVre8I6UXc3b.RetentionPolicy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x8f\x945q'), '\144' + chr(101) + chr(5503 - 5404) + chr(0b1000111 + 0o50) + chr(0b1001111 + 0o25) + chr(0b1100101))('\x75' + chr(4202 - 4086) + chr(10080 - 9978) + chr(1527 - 1482) + '\x38'))() not in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9c\x85\x975m\xc8\xb6\xd7U )\x81w\xc49\\ \x19\xc7\xc23|\x07\xc3'), chr(0b1001111 + 0o25) + chr(1768 - 1667) + chr(106 - 7) + chr(8886 - 8775) + '\144' + chr(0b110001 + 0o64))(chr(117) + '\x74' + chr(0b1110 + 0o130) + '\x2d' + chr(56))): raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0\x90\xb9"5\x8a\x92\xdcy\x17\x0f\xa9'), chr(0b1100100 + 0o0) + chr(0b10 + 0o143) + chr(0b1100011) + chr(0b10011 + 0o134) + '\x64' + chr(495 - 394))('\165' + chr(0b1010000 + 0o44) + chr(102) + '\x2d' + chr(0b101 + 0o63))), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9\x9b\x9ew#\xd1\xaa\xcbO_;\x8b;\xc24@_\x19\xd1\x96.{\x0c\x90\x8e\xa1\x04\xd5\x90.]\x7f\xdb\x04\xce\x95>\xe0\xeb\x85\x9d\xda\xc3+~\x92'), chr(0b1100100) + chr(101) + chr(0b10010 + 0o121) + '\x6f' + chr(0b1100100) + chr(101))('\x75' + chr(7982 - 7866) + chr(102) + chr(755 - 710) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8\xd4\x91?K\xdd\x8c\x8bk\x0f<\x84'), chr(3365 - 3265) + chr(101) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(101))(chr(0b1 + 0o164) + chr(0b1110100) + chr(102) + chr(45) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\x85\x975m\xc8\xb6\xd7U/6\x82r\xce#'), chr(0b1100100) + '\145' + '\x63' + chr(0b1101111) + chr(0b1100100) + '\x65')('\x75' + '\x74' + '\x66' + '\055' + chr(1344 - 1288)), [xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xa5\xb7\x11J\xf2'), '\144' + chr(0b1000110 + 0o37) + chr(7366 - 7267) + chr(0b1011 + 0o144) + '\x64' + chr(0b1100101))(chr(117) + '\x74' + chr(102) + '\x2d' + chr(97 - 41))), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa\xa5\xaf\x15W\xf9'), '\144' + '\x65' + chr(0b1000001 + 0o42) + chr(1191 - 1080) + chr(0b1010011 + 0o21) + '\x65')('\165' + chr(0b1110100) + chr(9330 - 9228) + '\x2d' + chr(2695 - 2639)))]))
awslabs/serverless-application-model
examples/apps/lex-order-flowers-python/lambda_function.py
order_flowers
def order_flowers(intent_request): """ Performs dialog management and fulfillment for ordering flowers. Beyond fulfillment, the implementation of this intent demonstrates the use of the elicitSlot dialog action in slot validation and re-prompting. """ flower_type = get_slots(intent_request)["FlowerType"] date = get_slots(intent_request)["PickupDate"] time = get_slots(intent_request)["PickupTime"] source = intent_request['invocationSource'] if source == 'DialogCodeHook': # Perform basic validation on the supplied input slots. # Use the elicitSlot dialog action to re-prompt for the first violation detected. slots = get_slots(intent_request) validation_result = validate_order_flowers(flower_type, date, time) if not validation_result['isValid']: slots[validation_result['violatedSlot']] = None return elicit_slot(intent_request['sessionAttributes'], intent_request['currentIntent']['name'], slots, validation_result['violatedSlot'], validation_result['message']) # Pass the price of the flowers back through session attributes to be used in various prompts defined # on the bot model. output_session_attributes = intent_request['sessionAttributes'] if flower_type is not None: output_session_attributes['Price'] = len(flower_type) * 5 # Elegant pricing model return delegate(output_session_attributes, get_slots(intent_request)) # Order the flowers, and rely on the goodbye message of the bot to define the message to the end user. # In a real bot, this would likely involve a call to a backend service. return close(intent_request['sessionAttributes'], 'Fulfilled', {'contentType': 'PlainText', 'content': 'Thanks, your order for {} has been placed and will be ready for pickup by {} on {}'.format(flower_type, time, date)})
python
def order_flowers(intent_request): """ Performs dialog management and fulfillment for ordering flowers. Beyond fulfillment, the implementation of this intent demonstrates the use of the elicitSlot dialog action in slot validation and re-prompting. """ flower_type = get_slots(intent_request)["FlowerType"] date = get_slots(intent_request)["PickupDate"] time = get_slots(intent_request)["PickupTime"] source = intent_request['invocationSource'] if source == 'DialogCodeHook': # Perform basic validation on the supplied input slots. # Use the elicitSlot dialog action to re-prompt for the first violation detected. slots = get_slots(intent_request) validation_result = validate_order_flowers(flower_type, date, time) if not validation_result['isValid']: slots[validation_result['violatedSlot']] = None return elicit_slot(intent_request['sessionAttributes'], intent_request['currentIntent']['name'], slots, validation_result['violatedSlot'], validation_result['message']) # Pass the price of the flowers back through session attributes to be used in various prompts defined # on the bot model. output_session_attributes = intent_request['sessionAttributes'] if flower_type is not None: output_session_attributes['Price'] = len(flower_type) * 5 # Elegant pricing model return delegate(output_session_attributes, get_slots(intent_request)) # Order the flowers, and rely on the goodbye message of the bot to define the message to the end user. # In a real bot, this would likely involve a call to a backend service. return close(intent_request['sessionAttributes'], 'Fulfilled', {'contentType': 'PlainText', 'content': 'Thanks, your order for {} has been placed and will be ready for pickup by {} on {}'.format(flower_type, time, date)})
[ "def", "order_flowers", "(", "intent_request", ")", ":", "flower_type", "=", "get_slots", "(", "intent_request", ")", "[", "\"FlowerType\"", "]", "date", "=", "get_slots", "(", "intent_request", ")", "[", "\"PickupDate\"", "]", "time", "=", "get_slots", "(", "intent_request", ")", "[", "\"PickupTime\"", "]", "source", "=", "intent_request", "[", "'invocationSource'", "]", "if", "source", "==", "'DialogCodeHook'", ":", "# Perform basic validation on the supplied input slots.", "# Use the elicitSlot dialog action to re-prompt for the first violation detected.", "slots", "=", "get_slots", "(", "intent_request", ")", "validation_result", "=", "validate_order_flowers", "(", "flower_type", ",", "date", ",", "time", ")", "if", "not", "validation_result", "[", "'isValid'", "]", ":", "slots", "[", "validation_result", "[", "'violatedSlot'", "]", "]", "=", "None", "return", "elicit_slot", "(", "intent_request", "[", "'sessionAttributes'", "]", ",", "intent_request", "[", "'currentIntent'", "]", "[", "'name'", "]", ",", "slots", ",", "validation_result", "[", "'violatedSlot'", "]", ",", "validation_result", "[", "'message'", "]", ")", "# Pass the price of the flowers back through session attributes to be used in various prompts defined", "# on the bot model.", "output_session_attributes", "=", "intent_request", "[", "'sessionAttributes'", "]", "if", "flower_type", "is", "not", "None", ":", "output_session_attributes", "[", "'Price'", "]", "=", "len", "(", "flower_type", ")", "*", "5", "# Elegant pricing model", "return", "delegate", "(", "output_session_attributes", ",", "get_slots", "(", "intent_request", ")", ")", "# Order the flowers, and rely on the goodbye message of the bot to define the message to the end user.", "# In a real bot, this would likely involve a call to a backend service.", "return", "close", "(", "intent_request", "[", "'sessionAttributes'", "]", ",", "'Fulfilled'", ",", "{", "'contentType'", ":", "'PlainText'", ",", "'content'", ":", "'Thanks, your order for {} has been placed and will be ready for pickup by {} on {}'", ".", "format", "(", "flower_type", ",", "time", ",", "date", ")", "}", ")" ]
Performs dialog management and fulfillment for ordering flowers. Beyond fulfillment, the implementation of this intent demonstrates the use of the elicitSlot dialog action in slot validation and re-prompting.
[ "Performs", "dialog", "management", "and", "fulfillment", "for", "ordering", "flowers", ".", "Beyond", "fulfillment", "the", "implementation", "of", "this", "intent", "demonstrates", "the", "use", "of", "the", "elicitSlot", "dialog", "action", "in", "slot", "validation", "and", "re", "-", "prompting", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/lex-order-flowers-python/lambda_function.py#L119-L158
train
This function orders the flowers in the order of the input slots.
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,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GD68sBIs,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(0b110100 + 0o73) + chr(0b110001) + '\x34' + chr(0b110010), 1336 - 1328), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + '\x36' + chr(610 - 557), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + '\x31' + chr(0b0 + 0o67) + chr(0b10111 + 0o32), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(11635 - 11524) + chr(650 - 600) + '\063' + chr(1390 - 1337), 0b1000), ehT0Px3KOsy9(chr(2255 - 2207) + '\157' + '\x36' + chr(54), 15745 - 15737), ehT0Px3KOsy9(chr(571 - 523) + '\157' + chr(0b110010) + chr(0b110010) + chr(50), 19247 - 19239), ehT0Px3KOsy9(chr(48) + '\157' + '\x36', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\063' + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\x30' + '\066', 3812 - 3804), ehT0Px3KOsy9(chr(1872 - 1824) + '\x6f' + chr(51) + chr(0b100110 + 0o15), ord("\x08")), ehT0Px3KOsy9(chr(318 - 270) + '\157' + chr(0b11110 + 0o24) + chr(0b101110 + 0o5) + '\x32', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1565 - 1511) + chr(1294 - 1242), 0b1000), ehT0Px3KOsy9(chr(1239 - 1191) + '\x6f' + chr(1009 - 954) + chr(0b11100 + 0o24), 38229 - 38221), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(50) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(0b110010) + chr(2015 - 1961) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b110000 + 0o77) + chr(2157 - 2108) + '\065' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110 + 0o55) + '\x37' + chr(2214 - 2162), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101010 + 0o5) + '\x31' + chr(51) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(53) + chr(0b101 + 0o61), ord("\x08")), ehT0Px3KOsy9(chr(1590 - 1542) + chr(0b1000 + 0o147) + '\x32' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(1641 - 1593) + '\157' + chr(0b110000 + 0o3) + chr(2512 - 2458) + chr(53), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1 + 0o156) + '\062' + chr(0b10001 + 0o43) + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(1477 - 1426) + chr(840 - 788), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b110111 + 0o70) + '\065' + chr(51), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(49) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b10011 + 0o43) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\060' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(111) + chr(0b1001 + 0o51) + chr(2252 - 2198) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(52) + chr(0b11111 + 0o21), 31291 - 31283), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(52) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10010 + 0o44) + chr(0b110000), 64175 - 64167), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(111) + chr(0b110010) + chr(55), 62650 - 62642), ehT0Px3KOsy9(chr(48) + chr(0b1010101 + 0o32) + chr(385 - 336) + '\067' + chr(49), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\066' + chr(0b100000 + 0o25), 0b1000), ehT0Px3KOsy9(chr(1944 - 1896) + '\x6f' + '\x32' + '\x33' + '\x32', 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(0b110000 + 0o5) + '\060', 41847 - 41839), ehT0Px3KOsy9(chr(1589 - 1541) + '\x6f' + chr(0b110001) + '\x34' + chr(50), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(0b10101 + 0o35) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + '\066' + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101011 + 0o13), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(111) + chr(53) + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'L'), chr(9391 - 9291) + chr(0b1010 + 0o133) + chr(5251 - 5152) + '\157' + '\x64' + chr(101))('\165' + '\164' + chr(225 - 123) + '\x2d' + chr(0b110011 + 0o5)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def GrPqrXQg1LcB(wVJBdhyINndp): u3q8Ak0eScPO = li_6Ohlfs3sX(wVJBdhyINndp)[xafqLlk3kkUe(SXOLrMavuUCe(b'$\x19\x16\xeaS\xe0R`\xf6~'), chr(7609 - 7509) + '\x65' + '\143' + '\x6f' + chr(0b110111 + 0o55) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(0b1011111 + 0o7) + chr(0b101101) + '\x38')] J4aeFOr3sjPo = li_6Ohlfs3sX(wVJBdhyINndp)[xafqLlk3kkUe(SXOLrMavuUCe(b'2\x1c\x1a\xf6C\xe2Bx\xf2~'), '\144' + '\145' + chr(0b1100011) + '\x6f' + chr(3017 - 2917) + chr(0b1100101))(chr(117) + chr(0b11 + 0o161) + chr(2778 - 2676) + chr(411 - 366) + '\x38')] ltvhPP4VhXre = li_6Ohlfs3sX(wVJBdhyINndp)[xafqLlk3kkUe(SXOLrMavuUCe(b'2\x1c\x1a\xf6C\xe2Rp\xeb~'), '\x64' + '\145' + '\x63' + chr(5110 - 4999) + chr(100) + '\145')(chr(117) + chr(0b1110100) + '\146' + chr(45) + chr(664 - 608))] Qas9W3D0Xbzi = wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\x0b\x1b\x0f\xf2U\xf3rp\xe9u\xc9[M\xe3\xd0\x0b'), chr(0b1100100) + '\145' + chr(0b1100011) + '\x6f' + chr(6729 - 6629) + chr(0b1100101))(chr(0b1110101) + chr(7281 - 7165) + chr(0b1100110) + chr(1011 - 966) + chr(56))] if Qas9W3D0Xbzi == xafqLlk3kkUe(SXOLrMavuUCe(b'&\x1c\x18\xf1Y\xf5Ev\xe2~\xd2[W\xfa'), chr(0b1100100) + chr(101) + chr(0b1100011) + '\157' + '\144' + chr(0b1100101))(chr(0b1110101) + '\164' + chr(102) + chr(783 - 738) + chr(0b111000)): QaGWUapnTsux = li_6Ohlfs3sX(wVJBdhyINndp) pOQG8Y1kF7u4 = K5jr0qa0LJY0(u3q8Ak0eScPO, J4aeFOr3sjPo, ltvhPP4VhXre) if not pOQG8Y1kF7u4[xafqLlk3kkUe(SXOLrMavuUCe(b'\x0b\x06/\xfcZ\xfbb'), chr(100) + chr(8175 - 8074) + chr(0b1001 + 0o132) + chr(0b1011 + 0o144) + '\144' + chr(0b1010111 + 0o16))(chr(117) + '\164' + '\x66' + '\x2d' + chr(56))]: QaGWUapnTsux[pOQG8Y1kF7u4[xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\x1c\x16\xf1W\xe6c}\xd5w\xf5@'), chr(4158 - 4058) + chr(9453 - 9352) + '\143' + '\x6f' + '\144' + '\x65')(chr(0b11 + 0o162) + chr(116) + chr(102) + chr(45) + '\070')]] = None return ENs5xz0M8SiT(wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\x11\x10\n\xee_\xfdhX\xf2o\xe8]Z\xe4\xc7\x0b\x8f'), '\144' + '\x65' + chr(0b1000100 + 0o37) + chr(0b1010110 + 0o31) + chr(1222 - 1122) + chr(0b1100101))(chr(117) + chr(1603 - 1487) + chr(0b1001 + 0o135) + '\x2d' + chr(0b111000))], wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\x01\x00\x0b\xefS\xfcrP\xe8o\xffZL'), chr(0b110101 + 0o57) + '\x65' + chr(0b110110 + 0o55) + chr(4765 - 4654) + chr(0b1100100) + chr(3660 - 3559))(chr(117) + chr(0b1110100) + '\146' + chr(1160 - 1115) + '\x38')][xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\x14\x14\xf8'), chr(0b1100100) + '\x65' + chr(0b1011 + 0o130) + '\157' + '\x64' + '\145')(chr(13459 - 13342) + '\x74' + chr(102) + chr(0b1 + 0o54) + chr(0b110101 + 0o3))], QaGWUapnTsux, pOQG8Y1kF7u4[xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\x1c\x16\xf1W\xe6c}\xd5w\xf5@'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(111) + '\144' + chr(4558 - 4457))('\165' + chr(116) + '\146' + '\055' + chr(56))], pOQG8Y1kF7u4[xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f\x10\n\xeeW\xf5c'), chr(0b1100010 + 0o2) + '\145' + chr(9600 - 9501) + chr(0b1010 + 0o145) + chr(4224 - 4124) + chr(0b1100101))(chr(117) + '\164' + chr(0b1100110 + 0o0) + '\055' + '\070')]) E45heiPa87QS = wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\x11\x10\n\xee_\xfdhX\xf2o\xe8]Z\xe4\xc7\x0b\x8f'), chr(0b100101 + 0o77) + '\145' + chr(8990 - 8891) + chr(5309 - 5198) + chr(0b1100100) + chr(0b1100101))(chr(9905 - 9788) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(0b10 + 0o66))] if u3q8Ak0eScPO is not None: E45heiPa87QS[xafqLlk3kkUe(SXOLrMavuUCe(b'2\x07\x10\xfeS'), '\x64' + '\x65' + chr(0b1100011) + '\157' + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(0b11000 + 0o134) + chr(518 - 416) + chr(642 - 597) + '\070')] = c2A0yzQpDQB3(u3q8Ak0eScPO) * ehT0Px3KOsy9(chr(48) + '\157' + '\065', 23618 - 23610) return Mjt53xq6OyiN(E45heiPa87QS, li_6Ohlfs3sX(wVJBdhyINndp)) return MkcqzDT3iB5h(wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\x11\x10\n\xee_\xfdhX\xf2o\xe8]Z\xe4\xc7\x0b\x8f'), chr(100) + chr(0b1100101) + '\143' + chr(3468 - 3357) + chr(0b1111 + 0o125) + chr(101))(chr(0b1110101) + '\x74' + chr(102) + chr(831 - 786) + '\070')], xafqLlk3kkUe(SXOLrMavuUCe(b'$\x00\x15\xfb_\xfej|\xe2'), '\144' + chr(0b1100101) + chr(0b110101 + 0o56) + '\x6f' + chr(1372 - 1272) + '\x65')(chr(0b1110101) + '\x74' + chr(8590 - 8488) + chr(0b10011 + 0o32) + '\070'), {xafqLlk3kkUe(SXOLrMavuUCe(b'\x01\x1a\x17\xe9S\xfcrM\xffk\xff'), '\144' + chr(0b1100101) + chr(0b1100000 + 0o3) + chr(8567 - 8456) + chr(100) + '\145')('\x75' + chr(8090 - 7974) + chr(102) + chr(0b1001 + 0o44) + chr(1794 - 1738)): xafqLlk3kkUe(SXOLrMavuUCe(b'2\x19\x18\xf4X\xc6ca\xf2'), '\x64' + chr(101) + '\x63' + chr(0b1101111) + chr(0b1001010 + 0o32) + '\145')('\165' + chr(0b1110100) + chr(102) + '\055' + chr(0b1100 + 0o54)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x01\x1a\x17\xe9S\xfcr'), chr(0b1100100) + chr(9888 - 9787) + chr(0b1100011) + chr(111) + chr(100) + chr(0b111 + 0o136))('\165' + '\164' + chr(102) + '\x2d' + chr(1526 - 1470)): xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'6\x1d\x18\xf3]\xe1*9\xfft\xefF\x18\xfe\xc1\n\x99.\xcev\x9a\xd5\xfcP\xf5\xd4*\xd7\x13ERr\x1c[\xba\x98\x0e\xf4\x92c\x06U\x18\xf3R\xb2qp\xeaw\xbaV]\xb1\xc1\x0b\x9d8\x970\x93\xc8\xae\x0b\xf8\x9d!\xdd\x15\x15\x10u\x00\x15\xe1\x95B\xfa\x9f&\x19\x08'), chr(100) + '\145' + chr(0b100110 + 0o75) + chr(0b1101111) + '\x64' + '\x65')(chr(0b1110101) + '\x74' + chr(0b1100110) + '\055' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'4A\x0b\xf2~\xf3U*\xd6k\xff^'), '\x64' + chr(101) + chr(99) + '\x6f' + chr(1659 - 1559) + chr(0b110101 + 0o60))(chr(10064 - 9947) + chr(6120 - 6004) + chr(0b1100110) + '\x2d' + chr(0b110011 + 0o5)))(u3q8Ak0eScPO, ltvhPP4VhXre, J4aeFOr3sjPo)})
awslabs/serverless-application-model
examples/apps/lex-order-flowers-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 == 'OrderFlowers': return order_flowers(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 == 'OrderFlowers': return order_flowers(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", "==", "'OrderFlowers'", ":", "return", "order_flowers", "(", "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-order-flowers-python/lambda_function.py#L164-L177
train
Dispatches the intent request to the appropriate handlers.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLt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tLC,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(0b1100110 + 0o11) + '\x33' + chr(0b110111) + chr(2352 - 2300), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + '\x33' + '\x37', 17397 - 17389), ehT0Px3KOsy9('\060' + chr(0b1000000 + 0o57) + chr(51) + chr(0b10110 + 0o36) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1962 - 1911) + '\065' + chr(741 - 692), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11000 + 0o36) + chr(0b110010), 15921 - 15913), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + chr(0b10100 + 0o35) + chr(54) + chr(0b10010 + 0o37), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110101) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(1480 - 1432) + chr(0b1101111) + chr(52) + '\x35', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100011 + 0o14) + '\x32' + chr(0b110001 + 0o2) + '\x34', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\060' + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(2327 - 2274) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + chr(5477 - 5366) + chr(50), 0o10), ehT0Px3KOsy9(chr(521 - 473) + '\x6f' + '\062' + chr(1919 - 1864) + '\067', 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + chr(0b10010 + 0o37) + chr(0b110001) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(51) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\157' + chr(0b110011) + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3510 - 3399) + chr(51) + chr(122 - 71) + chr(0b101110 + 0o4), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + chr(50) + chr(50) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + '\065' + chr(2215 - 2164), 0b1000), ehT0Px3KOsy9(chr(1319 - 1271) + '\157' + '\x35' + '\x35', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(2378 - 2329) + chr(49) + chr(0b10011 + 0o40), 0b1000), ehT0Px3KOsy9(chr(566 - 518) + '\157' + chr(54) + chr(49), 51376 - 51368), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + '\063' + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + chr(2593 - 2482) + '\x31' + chr(55) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(850 - 800) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\066' + chr(0b101 + 0o61), 0o10), ehT0Px3KOsy9(chr(1348 - 1300) + '\157' + chr(51) + chr(54) + chr(0b110001), 19513 - 19505), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(0b11111 + 0o24) + '\x34', 8), ehT0Px3KOsy9('\060' + chr(0b111000 + 0o67) + '\061' + '\x35' + chr(2528 - 2476), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101010 + 0o105) + chr(49) + '\x33' + chr(55), 8), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(163 - 114), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(5811 - 5700) + chr(2061 - 2011) + chr(53) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(1871 - 1817) + chr(48), 57247 - 57239), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + chr(744 - 694) + '\x35' + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + chr(3465 - 3354) + '\063' + chr(0b110000) + chr(55), 57515 - 57507), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + '\063' + chr(2243 - 2191) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(52) + chr(0b0 + 0o66), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(2685 - 2630) + '\x32', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + '\x33' + chr(0b1000 + 0o54), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11100 + 0o25) + chr(0b11110 + 0o30) + chr(0b110011), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1001001 + 0o46) + '\x35' + chr(0b100 + 0o54), 59428 - 59420)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2'), '\144' + chr(0b110010 + 0o63) + chr(99) + chr(111) + '\144' + chr(101))(chr(117) + chr(0b1110100) + chr(536 - 434) + '\055' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def UlFo0iP69moK(wVJBdhyINndp): xafqLlk3kkUe(hdK8qOUhR6Or, xafqLlk3kkUe(SXOLrMavuUCe(b'\x98:\x81\x9cU'), '\144' + chr(0b10110 + 0o117) + chr(6578 - 6479) + chr(10898 - 10787) + '\x64' + chr(101))(chr(10098 - 9981) + chr(12454 - 12338) + '\146' + '\x2d' + chr(0b111000)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x986\x90\x99S\x05NM\xbc\xf1\\g\xcd\x01\xbb&\xa1\xee\x87\r"_\xec\x1f\xbe\x82\xbf\xfd\x01:4\xd1\xcd'), '\x64' + '\145' + chr(0b101011 + 0o70) + chr(3360 - 3249) + chr(100) + chr(3829 - 3728))(chr(0b1001001 + 0o54) + '\164' + '\x66' + '\x2d' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xaak\x91\x86z\x10~\x16\xcc\xf4Jh'), '\144' + '\145' + chr(9487 - 9388) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(6056 - 5939) + chr(116) + chr(1087 - 985) + chr(0b101101) + '\070'))(wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\x89,\x86\x9b{\x15'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + '\157' + '\x64' + chr(0b1100101))(chr(0b1010001 + 0o44) + chr(11988 - 11872) + '\x66' + '\x2d' + chr(485 - 429))], wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f*\x91\x9bW\x1fYl\xf2\xf0Jl\xcb'), chr(7609 - 7509) + chr(101) + '\143' + chr(0b100011 + 0o114) + '\144' + chr(101))(chr(0b1110101) + chr(0b1110100) + '\x66' + '\x2d' + '\070')][xafqLlk3kkUe(SXOLrMavuUCe(b'\x92>\x8e\x8c'), chr(100) + chr(101) + chr(0b111110 + 0o45) + '\x6f' + chr(100) + chr(0b1100101))('\x75' + chr(6321 - 6205) + chr(1525 - 1423) + chr(45) + chr(56))])) Vsx90fqDFHAs = wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f*\x91\x9bW\x1fYl\xf2\xf0Jl\xcb'), '\x64' + chr(0b1100101) + chr(99) + '\157' + chr(100) + chr(101))(chr(117) + chr(10294 - 10178) + '\146' + chr(0b10100 + 0o31) + chr(56))][xafqLlk3kkUe(SXOLrMavuUCe(b'\x92>\x8e\x8c'), chr(100) + chr(0b110100 + 0o61) + '\x63' + chr(2126 - 2015) + chr(0b1100100) + '\145')('\165' + chr(116) + '\x66' + chr(709 - 664) + chr(0b111000))] if Vsx90fqDFHAs == xafqLlk3kkUe(SXOLrMavuUCe(b'\xb3-\x87\x8c@7AJ\xeb\xe1]q'), chr(0b1011110 + 0o6) + chr(8334 - 8233) + '\143' + '\157' + chr(100) + '\x65')(chr(0b1101101 + 0o10) + '\164' + '\146' + chr(0b11011 + 0o22) + chr(0b111000)): return GrPqrXQg1LcB(wVJBdhyINndp) raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb51\x97\x8c\\\x05\rR\xf5\xf0G"\xd1)\xb2~\xfa'), chr(0b100111 + 0o75) + '\145' + '\x63' + '\x6f' + chr(100) + chr(3440 - 3339))(chr(117) + chr(3717 - 3601) + '\146' + chr(45) + '\x38') + Vsx90fqDFHAs + xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc1\x8c\x9d\x12\x02XU\xec\xeb]v\xda,'), chr(100) + chr(7248 - 7147) + chr(0b1100011) + '\x6f' + chr(0b1011001 + 0o13) + '\x65')(chr(0b1110101) + chr(116) + chr(0b1010000 + 0o26) + chr(45) + chr(56)))
awslabs/serverless-application-model
samtranslator/model/eventsources/push.py
PushEventSource._construct_permission
def _construct_permission(self, function, source_arn=None, source_account=None, suffix="", event_source_token=None): """Constructs the Lambda Permission resource allowing the source service to invoke the function this event source triggers. :returns: the permission resource :rtype: model.lambda_.LambdaPermission """ lambda_permission = LambdaPermission(self.logical_id + 'Permission' + suffix, attributes=function.get_passthrough_resource_attributes()) try: # Name will not be available for Alias resources function_name_or_arn = function.get_runtime_attr("name") except NotImplementedError: function_name_or_arn = function.get_runtime_attr("arn") lambda_permission.Action = 'lambda:invokeFunction' lambda_permission.FunctionName = function_name_or_arn lambda_permission.Principal = self.principal lambda_permission.SourceArn = source_arn lambda_permission.SourceAccount = source_account lambda_permission.EventSourceToken = event_source_token return lambda_permission
python
def _construct_permission(self, function, source_arn=None, source_account=None, suffix="", event_source_token=None): """Constructs the Lambda Permission resource allowing the source service to invoke the function this event source triggers. :returns: the permission resource :rtype: model.lambda_.LambdaPermission """ lambda_permission = LambdaPermission(self.logical_id + 'Permission' + suffix, attributes=function.get_passthrough_resource_attributes()) try: # Name will not be available for Alias resources function_name_or_arn = function.get_runtime_attr("name") except NotImplementedError: function_name_or_arn = function.get_runtime_attr("arn") lambda_permission.Action = 'lambda:invokeFunction' lambda_permission.FunctionName = function_name_or_arn lambda_permission.Principal = self.principal lambda_permission.SourceArn = source_arn lambda_permission.SourceAccount = source_account lambda_permission.EventSourceToken = event_source_token return lambda_permission
[ "def", "_construct_permission", "(", "self", ",", "function", ",", "source_arn", "=", "None", ",", "source_account", "=", "None", ",", "suffix", "=", "\"\"", ",", "event_source_token", "=", "None", ")", ":", "lambda_permission", "=", "LambdaPermission", "(", "self", ".", "logical_id", "+", "'Permission'", "+", "suffix", ",", "attributes", "=", "function", ".", "get_passthrough_resource_attributes", "(", ")", ")", "try", ":", "# Name will not be available for Alias resources", "function_name_or_arn", "=", "function", ".", "get_runtime_attr", "(", "\"name\"", ")", "except", "NotImplementedError", ":", "function_name_or_arn", "=", "function", ".", "get_runtime_attr", "(", "\"arn\"", ")", "lambda_permission", ".", "Action", "=", "'lambda:invokeFunction'", "lambda_permission", ".", "FunctionName", "=", "function_name_or_arn", "lambda_permission", ".", "Principal", "=", "self", ".", "principal", "lambda_permission", ".", "SourceArn", "=", "source_arn", "lambda_permission", ".", "SourceAccount", "=", "source_account", "lambda_permission", ".", "EventSourceToken", "=", "event_source_token", "return", "lambda_permission" ]
Constructs the Lambda Permission resource allowing the source service to invoke the function this event source triggers. :returns: the permission resource :rtype: model.lambda_.LambdaPermission
[ "Constructs", "the", "Lambda", "Permission", "resource", "allowing", "the", "source", "service", "to", "invoke", "the", "function", "this", "event", "source", "triggers", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/eventsources/push.py#L43-L66
train
Constructs the Lambda Permission resource allowing the source service to invoke the function this eventova triggers.
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,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2A0yzQpDQB3,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) + chr(0b110001) + chr(48) + chr(2040 - 1992), 19326 - 19318), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(0b110101) + chr(0b100110 + 0o15), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2306 - 2257) + chr(0b110010) + chr(0b11010 + 0o35), 18470 - 18462), ehT0Px3KOsy9('\060' + chr(7866 - 7755) + '\x33' + chr(875 - 826) + chr(54), 12188 - 12180), ehT0Px3KOsy9(chr(362 - 314) + chr(111) + chr(49) + '\060' + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b100000 + 0o117) + chr(2220 - 2171) + chr(0b100100 + 0o22) + chr(0b110100 + 0o0), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8067 - 7956) + '\x33' + chr(0b110101) + '\060', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1100001 + 0o16) + chr(0b110010) + chr(1301 - 1252) + chr(0b101 + 0o56), 47975 - 47967), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b10101 + 0o132) + chr(0b110001) + chr(52) + chr(0b110000 + 0o7), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + '\063' + '\x30' + chr(53), 0o10), ehT0Px3KOsy9('\x30' + chr(0b111001 + 0o66) + '\062' + chr(51), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(0b110101) + chr(0b10001 + 0o42), 0b1000), ehT0Px3KOsy9(chr(327 - 279) + chr(0b110001 + 0o76) + '\063' + chr(54) + chr(0b110110), 37030 - 37022), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + '\066' + chr(2275 - 2225), 0o10), ehT0Px3KOsy9(chr(48) + chr(10321 - 10210) + chr(0b110011) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + '\061' + chr(55) + '\063', 11705 - 11697), ehT0Px3KOsy9(chr(2286 - 2238) + chr(924 - 813) + chr(0b110011) + '\067', 21610 - 21602), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11001 + 0o31) + '\x34' + '\x33', 38977 - 38969), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(10957 - 10846) + '\062' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(755 - 707) + '\x6f' + chr(50) + chr(0b100100 + 0o21) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(111) + '\065' + chr(812 - 760), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1000101 + 0o52) + chr(50) + chr(0b111 + 0o51) + chr(0b101110 + 0o2), 0o10), ehT0Px3KOsy9(chr(1082 - 1034) + chr(111) + chr(0b110011) + chr(2732 - 2677) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(696 - 647) + chr(0b100011 + 0o16) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1 + 0o156) + chr(391 - 336) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + chr(0b0 + 0o61) + chr(0b1001 + 0o50) + chr(475 - 424), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(5784 - 5673) + chr(0b110010) + '\x36' + chr(0b110010), 8), ehT0Px3KOsy9('\060' + '\157' + chr(1348 - 1299), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101111 + 0o6) + chr(1770 - 1716), 0b1000), ehT0Px3KOsy9(chr(1513 - 1465) + '\x6f' + chr(0b110011) + '\x33' + chr(0b111 + 0o60), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x34' + chr(50), 0b1000), ehT0Px3KOsy9(chr(220 - 172) + chr(0b1101111) + chr(259 - 208) + chr(0b10011 + 0o42) + '\066', 36487 - 36479), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(50) + chr(0b1001 + 0o53), 0o10), ehT0Px3KOsy9(chr(1567 - 1519) + '\157' + chr(0b110001) + chr(898 - 843) + chr(1735 - 1680), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1101111) + '\x31' + chr(54) + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + chr(2339 - 2228) + '\062' + chr(55) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\067' + '\067', 8), ehT0Px3KOsy9('\x30' + chr(0b1011110 + 0o21) + '\062' + chr(0b110110) + chr(0b1000 + 0o51), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101 + 0o54) + '\x37' + '\063', 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(1282 - 1231) + chr(49) + '\x32', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(407 - 359) + chr(0b1011011 + 0o24) + chr(0b11000 + 0o35) + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'n'), '\144' + '\x65' + chr(3963 - 3864) + chr(0b100001 + 0o116) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(0b100111 + 0o6) + chr(2002 - 1946)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def dkq0aKBykJQf(oVre8I6UXc3b, bBC93MgSHzUB, hAQZmU1baMWF=None, fsuFTTiwSMgc=None, YhhkyMvxPIjH=xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b1100000 + 0o4) + chr(0b1100101) + '\143' + chr(0b110 + 0o151) + chr(100) + chr(0b1100101))(chr(9760 - 9643) + '\x74' + chr(6010 - 5908) + chr(45) + chr(0b111000)), XX0kzOMbkjAy=None): SoufSaQB0VC3 = wv7EHNcArnq0(oVre8I6UXc3b.NpZr66MdBhVG + xafqLlk3kkUe(SXOLrMavuUCe(b'\x10\x8e%\xa3)\x07\x9b\xe2\x08\xab'), '\144' + '\145' + '\143' + chr(2490 - 2379) + '\144' + chr(0b1100101))(chr(0b1110001 + 0o4) + '\164' + '\146' + chr(0b100110 + 0o7) + '\x38') + YhhkyMvxPIjH, attributes=bBC93MgSHzUB.get_passthrough_resource_attributes()) try: RSHRQNM59Rxy = bBC93MgSHzUB.get_runtime_attr(xafqLlk3kkUe(SXOLrMavuUCe(b'.\x8a:\xab'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(0b1101011 + 0o4) + '\x64' + '\x65')(chr(0b110 + 0o157) + '\164' + '\x66' + '\055' + chr(0b101100 + 0o14))) except _zJ24Vce7wp0: RSHRQNM59Rxy = bBC93MgSHzUB.get_runtime_attr(xafqLlk3kkUe(SXOLrMavuUCe(b'!\x999'), chr(0b1000110 + 0o36) + chr(0b111010 + 0o53) + '\x63' + '\x6f' + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(7449 - 7333) + '\146' + chr(0b10000 + 0o35) + chr(2595 - 2539))) SoufSaQB0VC3.YrIGcn2Z8x2z = xafqLlk3kkUe(SXOLrMavuUCe(b',\x8a:\xac$\x15\xd2\xe2\t\xb3|\x00\x93\xf4l\x15|\xd7\x7f\xc4B'), '\x64' + '\145' + chr(99) + chr(1862 - 1751) + chr(3926 - 3826) + chr(0b100110 + 0o77))('\165' + chr(116) + '\146' + chr(715 - 670) + chr(0b1110 + 0o52)) SoufSaQB0VC3.qUoaUMQeQIKB = RSHRQNM59Rxy SoufSaQB0VC3.vc4tBqos7OYW = oVre8I6UXc3b.principal SoufSaQB0VC3.zlNz9OZ1moSb = hAQZmU1baMWF SoufSaQB0VC3.HRMpx8SiXNe4 = fsuFTTiwSMgc SoufSaQB0VC3.Ixb3i6l4MI1R = XX0kzOMbkjAy return SoufSaQB0VC3
awslabs/serverless-application-model
samtranslator/model/eventsources/push.py
Schedule.to_cloudformation
def to_cloudformation(self, **kwargs): """Returns the CloudWatch Events Rule and Lambda Permission to which this Schedule event source corresponds. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to which this pull event expands :rtype: list """ function = kwargs.get('function') if not function: raise TypeError("Missing required keyword argument: function") resources = [] events_rule = EventsRule(self.logical_id) resources.append(events_rule) events_rule.ScheduleExpression = self.Schedule events_rule.Targets = [self._construct_target(function)] source_arn = events_rule.get_runtime_attr("arn") if CONDITION in function.resource_attributes: events_rule.set_resource_attribute(CONDITION, function.resource_attributes[CONDITION]) resources.append(self._construct_permission(function, source_arn=source_arn)) return resources
python
def to_cloudformation(self, **kwargs): """Returns the CloudWatch Events Rule and Lambda Permission to which this Schedule event source corresponds. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to which this pull event expands :rtype: list """ function = kwargs.get('function') if not function: raise TypeError("Missing required keyword argument: function") resources = [] events_rule = EventsRule(self.logical_id) resources.append(events_rule) events_rule.ScheduleExpression = self.Schedule events_rule.Targets = [self._construct_target(function)] source_arn = events_rule.get_runtime_attr("arn") if CONDITION in function.resource_attributes: events_rule.set_resource_attribute(CONDITION, function.resource_attributes[CONDITION]) resources.append(self._construct_permission(function, source_arn=source_arn)) return resources
[ "def", "to_cloudformation", "(", "self", ",", "*", "*", "kwargs", ")", ":", "function", "=", "kwargs", ".", "get", "(", "'function'", ")", "if", "not", "function", ":", "raise", "TypeError", "(", "\"Missing required keyword argument: function\"", ")", "resources", "=", "[", "]", "events_rule", "=", "EventsRule", "(", "self", ".", "logical_id", ")", "resources", ".", "append", "(", "events_rule", ")", "events_rule", ".", "ScheduleExpression", "=", "self", ".", "Schedule", "events_rule", ".", "Targets", "=", "[", "self", ".", "_construct_target", "(", "function", ")", "]", "source_arn", "=", "events_rule", ".", "get_runtime_attr", "(", "\"arn\"", ")", "if", "CONDITION", "in", "function", ".", "resource_attributes", ":", "events_rule", ".", "set_resource_attribute", "(", "CONDITION", ",", "function", ".", "resource_attributes", "[", "CONDITION", "]", ")", "resources", ".", "append", "(", "self", ".", "_construct_permission", "(", "function", ",", "source_arn", "=", "source_arn", ")", ")", "return", "resources" ]
Returns the CloudWatch Events Rule and Lambda Permission to which this Schedule event source corresponds. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to which this pull event expands :rtype: list
[ "Returns", "the", "CloudWatch", "Events", "Rule", "and", "Lambda", "Permission", "to", "which", "this", "Schedule", "event", "source", "corresponds", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/eventsources/push.py#L78-L103
train
Returns the CloudWatch Events Rule and Lambda Permission to which this pull event source corresponds.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF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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(0b1101111) + chr(919 - 868) + chr(0b1010 + 0o50) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(1249 - 1201) + '\x6f' + chr(381 - 330) + chr(54) + '\x35', 0b1000), ehT0Px3KOsy9(chr(2058 - 2010) + '\x6f' + chr(2132 - 2082) + chr(0b110000) + chr(0b1011 + 0o53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(48) + '\061', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + '\x30' + chr(52), 41854 - 41846), ehT0Px3KOsy9('\x30' + '\157' + '\063' + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100110 + 0o12), ord("\x08")), ehT0Px3KOsy9(chr(191 - 143) + chr(0b1101111) + '\x33' + chr(53) + chr(867 - 816), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(10701 - 10590) + chr(0b110001 + 0o4) + '\x33', 26791 - 26783), ehT0Px3KOsy9(chr(131 - 83) + chr(0b1101111) + chr(754 - 703) + '\x32' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(1893 - 1782) + chr(0b110001) + chr(725 - 676) + chr(0b100011 + 0o16), 0b1000), ehT0Px3KOsy9(chr(117 - 69) + chr(0b1011 + 0o144) + chr(49) + chr(54), 0b1000), ehT0Px3KOsy9(chr(2130 - 2082) + chr(5242 - 5131) + chr(50) + '\x31' + '\065', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(0b110011) + chr(53), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10011 + 0o41) + chr(0b101 + 0o61), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + '\062' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(207 - 159) + chr(6394 - 6283) + chr(0b110110) + chr(1396 - 1347), ord("\x08")), ehT0Px3KOsy9('\060' + chr(2625 - 2514) + '\x31' + chr(1942 - 1889) + chr(0b100 + 0o54), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\x32' + chr(0b110101), 43853 - 43845), ehT0Px3KOsy9(chr(2011 - 1963) + chr(0b11011 + 0o124) + chr(0b110011) + chr(0b110000 + 0o7), 6558 - 6550), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11110 + 0o24) + chr(48) + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(764 - 716) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(10277 - 10166) + chr(2577 - 2526) + chr(50) + chr(0b100111 + 0o20), 45699 - 45691), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(0b110001) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(111) + chr(49) + '\x32' + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\x6f' + chr(50) + chr(49) + chr(0b100101 + 0o13), 0b1000), ehT0Px3KOsy9(chr(171 - 123) + chr(10565 - 10454) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(956 - 908) + '\x6f' + chr(0b110010) + chr(0b1111 + 0o44) + '\060', 0o10), ehT0Px3KOsy9(chr(406 - 358) + chr(0b1101111) + '\x31' + chr(0b110000) + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + '\x33' + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(50) + chr(0b110000), 16049 - 16041), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(0b110011) + '\x32', 55378 - 55370), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\x32' + chr(926 - 875), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(264 - 213) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1010 + 0o54) + chr(52), 30675 - 30667), ehT0Px3KOsy9('\x30' + chr(6527 - 6416) + chr(0b110001) + '\061' + '\066', 12777 - 12769), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(111) + chr(0b0 + 0o62) + chr(449 - 397) + '\063', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110 + 0o54) + '\x33' + '\062', 0b1000), ehT0Px3KOsy9(chr(423 - 375) + chr(3109 - 2998) + '\061' + '\x36' + chr(0b110101), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + '\065' + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8'), '\144' + '\145' + chr(7247 - 7148) + '\157' + chr(2301 - 2201) + chr(5271 - 5170))(chr(8845 - 8728) + '\164' + chr(2843 - 2741) + '\055' + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def NpIm0Ph3ybvM(oVre8I6UXc3b, **M8EIoTs2GJXE): bBC93MgSHzUB = M8EIoTs2GJXE.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0\x80\xe8\xa2\xb0qo\x85'), '\144' + chr(0b11011 + 0o112) + '\143' + chr(0b1101111) + chr(0b110 + 0o136) + chr(101))(chr(0b1110101) + chr(116) + '\x66' + chr(1921 - 1876) + '\x38')) if not bBC93MgSHzUB: raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b"\x9b\x9c\xf5\xb2\xadvg\xcbY\xb18{\xe4\xafC3\x11\x030f\xf6\xec\xa5(t\xe9u\xff4454'&\x14(l\xcd\xf9\x01\xbf\x9a\xe8"), chr(5270 - 5170) + chr(0b1100101) + '\x63' + '\x6f' + '\x64' + '\145')(chr(117) + chr(116) + chr(0b1100110) + chr(45) + chr(56))) z4Xs9XhDbg00 = [] yLmQ3lSPL2kC = dFiClVKr1yBS(oVre8I6UXc3b.NpZr66MdBhVG) xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7\x85\xf6\xa4\xaa|'), chr(0b1100100) + chr(0b1000101 + 0o40) + '\x63' + '\157' + '\x64' + chr(9792 - 9691))(chr(0b1000010 + 0o63) + '\164' + chr(8449 - 8347) + chr(255 - 210) + chr(0b111000)))(yLmQ3lSPL2kC) yLmQ3lSPL2kC.yndRsw_Cor_s = oVre8I6UXc3b.Schedule yLmQ3lSPL2kC.rk0brKBauK0P = [oVre8I6UXc3b._construct_target(bBC93MgSHzUB)] hAQZmU1baMWF = yLmQ3lSPL2kC.get_runtime_attr(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7\x87\xe8'), '\x64' + chr(978 - 877) + '\x63' + '\x6f' + '\x64' + chr(0b1100101))(chr(117) + '\164' + '\146' + chr(45) + chr(0b111000))) if y7wKORCUVRd8 in xafqLlk3kkUe(bBC93MgSHzUB, xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xc2\xe2\xa5\x8aGk\x82\x1e\xba\x0e`'), '\x64' + chr(1821 - 1720) + '\143' + chr(111) + chr(100) + '\145')(chr(0b1110101) + chr(116) + '\x66' + chr(1769 - 1724) + '\x38')): xafqLlk3kkUe(yLmQ3lSPL2kC, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5\x90\xf2\x9e\xb6}s\x84^\xa6*k\xd2\xbcR#C\x017j\xf5\xe6'), '\x64' + '\145' + '\x63' + chr(111) + chr(100) + chr(0b1100101))('\165' + chr(0b10010 + 0o142) + '\x66' + chr(0b1010 + 0o43) + chr(56)))(y7wKORCUVRd8, xafqLlk3kkUe(bBC93MgSHzUB, xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xc2\xe2\xa5\x8aGk\x82\x1e\xba\x0e`'), '\x64' + chr(10131 - 10030) + chr(0b0 + 0o143) + chr(6439 - 6328) + chr(9798 - 9698) + '\145')('\165' + chr(0b1110 + 0o146) + chr(0b11101 + 0o111) + chr(0b101101) + '\x38'))[y7wKORCUVRd8]) xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7\x85\xf6\xa4\xaa|'), chr(0b1100100) + '\145' + chr(0b1011010 + 0o11) + chr(111) + '\144' + chr(101))(chr(181 - 64) + chr(1544 - 1428) + '\x66' + chr(1493 - 1448) + '\070'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x89\x96\xe9\xaf\xb7lr\x9eH\xa0\x16~\xe8\xafK>B\x1b<p\xef'), chr(100) + chr(140 - 39) + chr(4849 - 4750) + '\x6f' + chr(608 - 508) + '\145')(chr(2754 - 2637) + chr(0b1110100) + chr(0b1100110) + '\x2d' + chr(56)))(bBC93MgSHzUB, source_arn=hAQZmU1baMWF)) return z4Xs9XhDbg00
awslabs/serverless-application-model
samtranslator/model/eventsources/push.py
CloudWatchEvent._construct_target
def _construct_target(self, function): """Constructs the Target property for the CloudWatch Events Rule. :returns: the Target property :rtype: dict """ target = { 'Arn': function.get_runtime_attr("arn"), 'Id': self.logical_id + 'LambdaTarget' } if self.Input is not None: target['Input'] = self.Input if self.InputPath is not None: target['InputPath'] = self.InputPath return target
python
def _construct_target(self, function): """Constructs the Target property for the CloudWatch Events Rule. :returns: the Target property :rtype: dict """ target = { 'Arn': function.get_runtime_attr("arn"), 'Id': self.logical_id + 'LambdaTarget' } if self.Input is not None: target['Input'] = self.Input if self.InputPath is not None: target['InputPath'] = self.InputPath return target
[ "def", "_construct_target", "(", "self", ",", "function", ")", ":", "target", "=", "{", "'Arn'", ":", "function", ".", "get_runtime_attr", "(", "\"arn\"", ")", ",", "'Id'", ":", "self", ".", "logical_id", "+", "'LambdaTarget'", "}", "if", "self", ".", "Input", "is", "not", "None", ":", "target", "[", "'Input'", "]", "=", "self", ".", "Input", "if", "self", ".", "InputPath", "is", "not", "None", ":", "target", "[", "'InputPath'", "]", "=", "self", ".", "InputPath", "return", "target" ]
Constructs the Target property for the CloudWatch Events Rule. :returns: the Target property :rtype: dict
[ "Constructs", "the", "Target", "property", "for", "the", "CloudWatch", "Events", "Rule", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/eventsources/push.py#L159-L174
train
Constructs the CloudWatch Events Rule target property for the CloudWatch Events Rule.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,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g,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(2101 - 2053) + chr(0b1101111) + '\061' + '\x33' + chr(49), 0o10), ehT0Px3KOsy9('\x30' + chr(6190 - 6079) + chr(49) + chr(54) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(2248 - 2199) + chr(0b100101 + 0o14), 11029 - 11021), ehT0Px3KOsy9(chr(48) + chr(0b1100100 + 0o13) + chr(0b110011) + chr(52), 0o10), ehT0Px3KOsy9(chr(2042 - 1994) + chr(0b1001111 + 0o40) + chr(0b110001) + chr(0b110010) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + chr(0b110001 + 0o3) + chr(54), 394 - 386), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100110 + 0o14) + chr(48) + chr(0b11010 + 0o31), 0o10), ehT0Px3KOsy9('\x30' + chr(0b110101 + 0o72) + chr(1266 - 1217) + chr(0b110001) + chr(0b0 + 0o65), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1251 - 1202) + chr(0b100101 + 0o21) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1001101 + 0o42) + chr(49) + '\067' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\x6f' + chr(1617 - 1567) + chr(53) + chr(0b10011 + 0o43), 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(5699 - 5588) + '\061' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(339 - 291) + chr(0b1100010 + 0o15) + chr(49) + chr(0b101001 + 0o10) + '\062', 35964 - 35956), ehT0Px3KOsy9('\x30' + chr(111) + chr(52) + chr(0b101100 + 0o10), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\x36' + chr(0b1111 + 0o44), 5577 - 5569), ehT0Px3KOsy9(chr(48) + chr(11683 - 11572) + '\062' + chr(0b101111 + 0o5), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + '\x36' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(891 - 843) + '\157' + '\063' + chr(0b11111 + 0o26) + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(10392 - 10281) + chr(49) + chr(0b110101) + chr(0b11000 + 0o37), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(55 - 2) + chr(0b11001 + 0o31), 51370 - 51362), ehT0Px3KOsy9(chr(48) + chr(0b11100 + 0o123) + chr(0b11111 + 0o23) + '\x34' + '\x33', 0b1000), ehT0Px3KOsy9(chr(925 - 877) + chr(111) + chr(0b110011) + chr(0b110101), 7582 - 7574), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(0b100111 + 0o17) + chr(0b110011 + 0o4), 8), ehT0Px3KOsy9(chr(48) + chr(0b1100110 + 0o11) + '\067' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100000 + 0o21) + '\x36', 41575 - 41567), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + '\061' + chr(2858 - 2804), 0b1000), ehT0Px3KOsy9(chr(652 - 604) + chr(0b1101111) + chr(0b1101 + 0o46) + chr(0b10001 + 0o40) + chr(0b10000 + 0o47), 21879 - 21871), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + chr(0b110011) + chr(0b101010 + 0o14) + '\066', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(602 - 553) + chr(972 - 918) + chr(204 - 154), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\x34' + chr(0b110010), 37932 - 37924), ehT0Px3KOsy9('\x30' + chr(4951 - 4840) + '\062' + '\x32' + chr(77 - 22), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011111 + 0o20) + '\061' + '\066' + chr(0b11 + 0o61), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2028 - 1978) + chr(54) + chr(1274 - 1224), 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b110100 + 0o73) + chr(51) + chr(0b10111 + 0o36) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\x37' + chr(0b100110 + 0o21), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100011 + 0o20) + chr(0b110001) + chr(0b1111 + 0o41), 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\157' + '\x33' + '\x30' + '\x37', 45887 - 45879), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + '\061', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(839 - 789) + chr(48) + chr(49), 13616 - 13608)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + chr(0b110101) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'w'), chr(0b1111 + 0o125) + chr(101) + chr(0b1100011) + chr(0b1001110 + 0o41) + chr(2881 - 2781) + chr(0b1100101))(chr(7571 - 7454) + chr(0b1110100) + '\x66' + '\055' + chr(0b10010 + 0o46)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def QgqQBI_VcuVF(oVre8I6UXc3b, bBC93MgSHzUB): GR1581dR5rDS = {xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\x04\xa7'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(0b1011011 + 0o11) + '\145')(chr(0b1011001 + 0o34) + chr(116) + '\x66' + '\055' + chr(2601 - 2545)): bBC93MgSHzUB.get_runtime_attr(xafqLlk3kkUe(SXOLrMavuUCe(b'8\x04\xa7'), chr(0b1011001 + 0o13) + chr(3826 - 3725) + chr(99) + chr(0b10100 + 0o133) + '\x64' + chr(101))(chr(0b101000 + 0o115) + '\164' + chr(2667 - 2565) + chr(45) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\x10\x12'), '\144' + chr(0b10100 + 0o121) + chr(0b11110 + 0o105) + '\157' + chr(100) + chr(0b1100101))(chr(0b1001001 + 0o54) + chr(10589 - 10473) + chr(0b101101 + 0o71) + '\x2d' + chr(56)): oVre8I6UXc3b.NpZr66MdBhVG + xafqLlk3kkUe(SXOLrMavuUCe(b'\x15\x17\xa4~0g\xf2\xe2?\x16\x19\xda'), chr(4829 - 4729) + chr(101) + '\143' + '\157' + chr(0b100100 + 0o100) + chr(101))(chr(0b101001 + 0o114) + '\164' + chr(102) + chr(45) + chr(0b110101 + 0o3))} if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x10\x18\xb9i '), chr(0b1100100) + '\x65' + chr(99) + chr(0b0 + 0o157) + chr(0b1100100) + '\x65')(chr(12862 - 12745) + chr(12638 - 12522) + chr(8167 - 8065) + '\055' + '\x38')) is not None: GR1581dR5rDS[xafqLlk3kkUe(SXOLrMavuUCe(b'\x10\x18\xb9i '), '\144' + chr(0b1100101) + '\143' + '\x6f' + '\144' + chr(0b1001100 + 0o31))(chr(117) + '\x74' + chr(0b1010000 + 0o26) + chr(0b11001 + 0o24) + chr(56))] = oVre8I6UXc3b.Input if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x10\x18\xb9i V\xc7\xf7%'), '\144' + '\145' + '\143' + chr(0b1101111) + chr(0b1100100) + chr(0b101101 + 0o70))('\165' + chr(116) + chr(102) + chr(45) + chr(0b111000))) is not None: GR1581dR5rDS[xafqLlk3kkUe(SXOLrMavuUCe(b'\x10\x18\xb9i V\xc7\xf7%'), '\x64' + '\145' + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b111011 + 0o52))('\165' + chr(4349 - 4233) + '\146' + '\x2d' + '\070')] = oVre8I6UXc3b.InputPath return GR1581dR5rDS
awslabs/serverless-application-model
samtranslator/model/eventsources/push.py
S3.to_cloudformation
def to_cloudformation(self, **kwargs): """Returns the Lambda Permission resource allowing S3 to invoke the function this event source triggers. :param dict kwargs: S3 bucket resource :returns: a list of vanilla CloudFormation Resources, to which this S3 event expands :rtype: list """ function = kwargs.get('function') if not function: raise TypeError("Missing required keyword argument: function") if 'bucket' not in kwargs or kwargs['bucket'] is None: raise TypeError("Missing required keyword argument: bucket") if 'bucket_id' not in kwargs or kwargs['bucket_id'] is None: raise TypeError("Missing required keyword argument: bucket_id") bucket = kwargs['bucket'] bucket_id = kwargs['bucket_id'] resources = [] source_account = ref('AWS::AccountId') permission = self._construct_permission(function, source_account=source_account) if CONDITION in permission.resource_attributes: self._depend_on_lambda_permissions_using_tag(bucket, permission) else: self._depend_on_lambda_permissions(bucket, permission) resources.append(permission) # NOTE: `bucket` here is a dictionary representing the S3 Bucket resource in your SAM template. If there are # multiple S3 Events attached to the same bucket, we will update the Bucket resource with notification # configuration for each event. This is the reason why we continue to use existing bucket dict and append onto # it. # # NOTE: There is some fragile logic here where we will append multiple resources to output # SAM template but de-dupe them when merging into output CFN template. This is scary because the order of # merging is literally "last one wins", which works fine because we linearly loop through the template once. # The de-dupe happens inside `samtranslator.translator.Translator.translate` method when merging results of # to_cloudformation() to output template. self._inject_notification_configuration(function, bucket) resources.append(S3Bucket.from_dict(bucket_id, bucket)) return resources
python
def to_cloudformation(self, **kwargs): """Returns the Lambda Permission resource allowing S3 to invoke the function this event source triggers. :param dict kwargs: S3 bucket resource :returns: a list of vanilla CloudFormation Resources, to which this S3 event expands :rtype: list """ function = kwargs.get('function') if not function: raise TypeError("Missing required keyword argument: function") if 'bucket' not in kwargs or kwargs['bucket'] is None: raise TypeError("Missing required keyword argument: bucket") if 'bucket_id' not in kwargs or kwargs['bucket_id'] is None: raise TypeError("Missing required keyword argument: bucket_id") bucket = kwargs['bucket'] bucket_id = kwargs['bucket_id'] resources = [] source_account = ref('AWS::AccountId') permission = self._construct_permission(function, source_account=source_account) if CONDITION in permission.resource_attributes: self._depend_on_lambda_permissions_using_tag(bucket, permission) else: self._depend_on_lambda_permissions(bucket, permission) resources.append(permission) # NOTE: `bucket` here is a dictionary representing the S3 Bucket resource in your SAM template. If there are # multiple S3 Events attached to the same bucket, we will update the Bucket resource with notification # configuration for each event. This is the reason why we continue to use existing bucket dict and append onto # it. # # NOTE: There is some fragile logic here where we will append multiple resources to output # SAM template but de-dupe them when merging into output CFN template. This is scary because the order of # merging is literally "last one wins", which works fine because we linearly loop through the template once. # The de-dupe happens inside `samtranslator.translator.Translator.translate` method when merging results of # to_cloudformation() to output template. self._inject_notification_configuration(function, bucket) resources.append(S3Bucket.from_dict(bucket_id, bucket)) return resources
[ "def", "to_cloudformation", "(", "self", ",", "*", "*", "kwargs", ")", ":", "function", "=", "kwargs", ".", "get", "(", "'function'", ")", "if", "not", "function", ":", "raise", "TypeError", "(", "\"Missing required keyword argument: function\"", ")", "if", "'bucket'", "not", "in", "kwargs", "or", "kwargs", "[", "'bucket'", "]", "is", "None", ":", "raise", "TypeError", "(", "\"Missing required keyword argument: bucket\"", ")", "if", "'bucket_id'", "not", "in", "kwargs", "or", "kwargs", "[", "'bucket_id'", "]", "is", "None", ":", "raise", "TypeError", "(", "\"Missing required keyword argument: bucket_id\"", ")", "bucket", "=", "kwargs", "[", "'bucket'", "]", "bucket_id", "=", "kwargs", "[", "'bucket_id'", "]", "resources", "=", "[", "]", "source_account", "=", "ref", "(", "'AWS::AccountId'", ")", "permission", "=", "self", ".", "_construct_permission", "(", "function", ",", "source_account", "=", "source_account", ")", "if", "CONDITION", "in", "permission", ".", "resource_attributes", ":", "self", ".", "_depend_on_lambda_permissions_using_tag", "(", "bucket", ",", "permission", ")", "else", ":", "self", ".", "_depend_on_lambda_permissions", "(", "bucket", ",", "permission", ")", "resources", ".", "append", "(", "permission", ")", "# NOTE: `bucket` here is a dictionary representing the S3 Bucket resource in your SAM template. If there are", "# multiple S3 Events attached to the same bucket, we will update the Bucket resource with notification", "# configuration for each event. This is the reason why we continue to use existing bucket dict and append onto", "# it.", "#", "# NOTE: There is some fragile logic here where we will append multiple resources to output", "# SAM template but de-dupe them when merging into output CFN template. This is scary because the order of", "# merging is literally \"last one wins\", which works fine because we linearly loop through the template once.", "# The de-dupe happens inside `samtranslator.translator.Translator.translate` method when merging results of", "# to_cloudformation() to output template.", "self", ".", "_inject_notification_configuration", "(", "function", ",", "bucket", ")", "resources", ".", "append", "(", "S3Bucket", ".", "from_dict", "(", "bucket_id", ",", "bucket", ")", ")", "return", "resources" ]
Returns the Lambda Permission resource allowing S3 to invoke the function this event source triggers. :param dict kwargs: S3 bucket resource :returns: a list of vanilla CloudFormation Resources, to which this S3 event expands :rtype: list
[ "Returns", "the", "Lambda", "Permission", "resource", "allowing", "S3", "to", "invoke", "the", "function", "this", "event", "source", "triggers", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/eventsources/push.py#L197-L241
train
Returns the Lambda Permission resource allowing S3 to invoke the function this event source triggers.
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,QWgp4ELTm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2KDPD,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(0b1111 + 0o41) + chr(0b1011001 + 0o26) + chr(50) + '\x36' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + '\062' + chr(1438 - 1387) + chr(2216 - 2166), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + chr(0b11011 + 0o26) + chr(0b110001) + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + chr(12252 - 12141) + chr(0b110010) + chr(425 - 376), 23364 - 23356), ehT0Px3KOsy9(chr(48) + chr(0b11000 + 0o127) + '\x36' + chr(0b110011 + 0o0), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1011011 + 0o24) + chr(0b110011) + chr(49), 0o10), ehT0Px3KOsy9(chr(2203 - 2155) + '\157' + '\x37' + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + chr(9223 - 9112) + chr(0b100000 + 0o23) + chr(49) + chr(0b11000 + 0o36), 64506 - 64498), ehT0Px3KOsy9(chr(48) + chr(0b1011001 + 0o26) + chr(0b101001 + 0o11) + '\x32' + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b1 + 0o62) + chr(0b110111) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1101111) + '\x31' + '\067' + chr(2741 - 2686), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(6327 - 6216) + chr(0b11101 + 0o25) + '\x36' + chr(0b110101 + 0o1), 13987 - 13979), ehT0Px3KOsy9('\060' + chr(7034 - 6923) + chr(0b101011 + 0o7) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\x6f' + chr(0b100 + 0o63) + chr(0b101000 + 0o14), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(54) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1513 - 1460) + '\060', 62467 - 62459), ehT0Px3KOsy9(chr(2272 - 2224) + '\x6f' + '\063' + '\x30' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b111 + 0o150) + chr(2289 - 2239) + chr(53) + chr(1850 - 1802), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9712 - 9601) + '\x33' + '\x37' + chr(53), 0o10), ehT0Px3KOsy9(chr(2113 - 2065) + '\x6f' + chr(0b110010) + '\066' + chr(1161 - 1110), 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(8984 - 8873) + chr(49) + chr(0b110110) + chr(511 - 462), 5291 - 5283), ehT0Px3KOsy9(chr(1784 - 1736) + chr(229 - 118) + chr(1406 - 1357) + '\x36' + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b100101 + 0o112) + chr(0b11001 + 0o31) + '\067' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(5487 - 5376) + '\x33' + chr(1247 - 1198) + '\x30', 0o10), ehT0Px3KOsy9('\060' + chr(6573 - 6462) + '\x32' + chr(1530 - 1477) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\067' + chr(52), 21178 - 21170), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(0b101010 + 0o6) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(53) + chr(54 - 0), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(2000 - 1889) + chr(51) + chr(285 - 232) + chr(0b1010 + 0o52), 9802 - 9794), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + chr(50) + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(603 - 553) + chr(53) + chr(1238 - 1189), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(608 - 556) + chr(0b10111 + 0o34), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\066' + chr(0b100100 + 0o21), 18267 - 18259), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1547 - 1497) + chr(0b100100 + 0o16) + chr(0b11100 + 0o32), 11722 - 11714), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(50) + chr(0b11101 + 0o30), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(0b110111) + chr(0b100011 + 0o15), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + chr(1010 - 961) + chr(0b110100) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + chr(50) + chr(0b100111 + 0o14) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101100 + 0o6) + chr(0b110001) + '\x32', 9842 - 9834)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + chr(0b101100 + 0o11) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x9a'), chr(100) + chr(0b1100101) + '\143' + '\x6f' + chr(0b110011 + 0o61) + '\x65')(chr(324 - 207) + chr(6953 - 6837) + '\146' + '\x2d' + chr(1992 - 1936)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def NpIm0Ph3ybvM(oVre8I6UXc3b, **M8EIoTs2GJXE): bBC93MgSHzUB = M8EIoTs2GJXE.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2\xef#rGpR\xa0'), chr(100) + '\x65' + '\x63' + chr(6507 - 6396) + '\x64' + '\145')(chr(117) + '\164' + chr(0b1000011 + 0o43) + chr(0b101101) + chr(2389 - 2333))) if not bBC93MgSHzUB: raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9\xf3>bZwZ\xee\xe0\x9b\x0e\xc3yNSL\xe2\xc3\x98\xca\x06\x19\xc8\xac\x8cd\xce\xe1\x1b\x81\xb0\xc7\x97\x0f\xb6\xf3\x8d\t\xfb\xfe\xdd\xf5#'), '\x64' + chr(1348 - 1247) + chr(5457 - 5358) + chr(5189 - 5078) + chr(0b1100100) + '\145')('\165' + '\164' + '\x66' + chr(45) + chr(0b111000))) if xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6\xef.zVm'), chr(5443 - 5343) + chr(101) + '\143' + chr(0b1001101 + 0o42) + chr(168 - 68) + chr(101))('\165' + '\x74' + chr(8800 - 8698) + chr(53 - 8) + '\x38') not in M8EIoTs2GJXE or M8EIoTs2GJXE[xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6\xef.zVm'), '\x64' + '\145' + chr(0b100 + 0o137) + '\x6f' + chr(100) + '\145')('\165' + chr(116) + '\x66' + '\x2d' + chr(56))] is None: raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9\xf3>bZwZ\xee\xe0\x9b\x0e\xc3yNSL\xe2\xc3\x98\xca\x06\x19\xc8\xac\x8cd\xce\xe1\x1b\x81\xb0\xc7\x97\x0f\xb6\xf7\x8d\x04\xf3\xef\xc0'), chr(0b111110 + 0o46) + chr(3451 - 3350) + chr(0b10111 + 0o114) + chr(0b100101 + 0o112) + chr(0b1010111 + 0o15) + chr(8376 - 8275))(chr(117) + chr(116) + chr(102) + chr(45) + '\x38')) if xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6\xef.zVmb\xa7\xf6'), '\x64' + chr(0b1100101) + chr(99) + chr(1112 - 1001) + chr(9741 - 9641) + chr(0b1000001 + 0o44))('\x75' + chr(116) + '\146' + '\055' + '\070') not in M8EIoTs2GJXE or M8EIoTs2GJXE[xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6\xef.zVmb\xa7\xf6'), '\144' + chr(101) + chr(0b100100 + 0o77) + chr(0b1101111) + chr(0b111011 + 0o51) + chr(0b1100101))(chr(117) + '\x74' + chr(102) + chr(0b101101) + chr(0b11011 + 0o35))] is None: raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9\xf3>bZwZ\xee\xe0\x9b\x0e\xc3yNSL\xe2\xc3\x98\xca\x06\x19\xc8\xac\x8cd\xce\xe1\x1b\x81\xb0\xc7\x97\x0f\xb6\xf7\x8d\x04\xf3\xef\xc0\xc5$u'), chr(0b10 + 0o142) + chr(101) + chr(99) + chr(111) + chr(0b11000 + 0o114) + chr(0b1000011 + 0o42))(chr(0b11100 + 0o131) + chr(0b1110100) + chr(0b1100110) + chr(0b1000 + 0o45) + '\070')) BoaD8srOIvI5 = M8EIoTs2GJXE[xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6\xef.zVm'), chr(8606 - 8506) + chr(2734 - 2633) + chr(0b1100011) + chr(0b11 + 0o154) + chr(0b111100 + 0o50) + '\145')(chr(0b100011 + 0o122) + chr(0b1110100) + chr(0b1100110) + chr(45) + '\070')] gFaNANARChCb = M8EIoTs2GJXE[xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6\xef.zVmb\xa7\xf6'), '\x64' + chr(0b1100101 + 0o0) + chr(0b1100011) + '\x6f' + '\x64' + '\145')('\165' + '\x74' + chr(1099 - 997) + chr(1505 - 1460) + '\x38')] z4Xs9XhDbg00 = [] fsuFTTiwSMgc = X4s0pSydcnYR(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\xcd\x1e+\tX^\xad\xfd\x8b\x11\xc2YX'), '\144' + chr(5760 - 5659) + chr(0b1100011) + chr(10373 - 10262) + '\x64' + chr(0b111 + 0o136))(chr(0b1110101) + chr(116) + '\x66' + chr(45) + chr(0b100001 + 0o27))) YjuVmx7ofT5i = oVre8I6UXc3b._construct_permission(bBC93MgSHzUB, source_account=fsuFTTiwSMgc) if y7wKORCUVRd8 in xafqLlk3kkUe(YjuVmx7ofT5i, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcc\xad)u}FV\xa7\xa7\x908\xd8'), chr(100) + chr(0b1100101) + chr(0b1100011) + '\157' + '\x64' + chr(0b10101 + 0o120))(chr(117) + '\x74' + chr(0b1100110) + chr(0b10011 + 0o32) + '\x38')): xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xeb\xfe(aVwY\x91\xfd\x90 \xdaqQTL\xa3\xf7\x8d\xd6\x03\x1b\xd3\xbb\xdfl\xd3\xe8\x1d\xb3\xa0\xda\x8a[\xf1\xca\x8c\x06\xff'), chr(7631 - 7531) + '\145' + chr(0b1001111 + 0o24) + chr(111) + '\x64' + chr(101))('\165' + '\164' + chr(0b1100110) + chr(45) + '\070'))(BoaD8srOIvI5, YjuVmx7ofT5i) else: xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xeb\xfe(aVwY\x91\xfd\x90 \xdaqQTL\xa3\xf7\x8d\xd6\x03\x1b\xd3\xbb\xdfl\xd3\xe8\x1d'), '\x64' + chr(0b100010 + 0o103) + chr(99) + '\x6f' + chr(0b101100 + 0o70) + chr(0b1000100 + 0o41))('\x75' + chr(0b110001 + 0o103) + '\x66' + chr(45) + '\070'))(BoaD8srOIvI5, YjuVmx7ofT5i) xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5\xea=t]}'), chr(8533 - 8433) + '\x65' + chr(2608 - 2509) + chr(0b1101111) + chr(0b1100100) + chr(6301 - 6200))(chr(10944 - 10827) + chr(116) + '\146' + '\x2d' + chr(0b111000)))(YjuVmx7ofT5i) xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xeb\xf3#{VzI\x91\xfc\x91\x0b\xdfvUUI\xb6\xc1\x92\xdd.\x15\xd5\xa6\xcal\xdb\xf3\x1c\x8d\xa1\xc0\x8c['), chr(831 - 731) + '\145' + chr(0b1100011) + '\x6f' + chr(322 - 222) + chr(0b1011101 + 0o10))('\x75' + chr(0b10 + 0o162) + chr(4242 - 4140) + '\x2d' + chr(0b111000)))(bBC93MgSHzUB, BoaD8srOIvI5) xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5\xea=t]}'), chr(0b111010 + 0o52) + chr(9536 - 9435) + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))('\165' + chr(116) + chr(0b1001 + 0o135) + chr(0b101101) + '\070'))(xafqLlk3kkUe(jpJXhDdnWBaT, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2\xe8"|l}T\xad\xe6'), '\x64' + chr(101) + chr(0b1100011) + chr(0b1101001 + 0o6) + chr(100) + chr(0b10110 + 0o117))('\x75' + chr(9193 - 9077) + chr(102) + chr(0b100111 + 0o6) + chr(56)))(gFaNANARChCb, BoaD8srOIvI5)) return z4Xs9XhDbg00
awslabs/serverless-application-model
samtranslator/model/eventsources/push.py
S3._depend_on_lambda_permissions
def _depend_on_lambda_permissions(self, bucket, permission): """ Make the S3 bucket depends on Lambda Permissions resource because when S3 adds a Notification Configuration, it will check whether it has permissions to access Lambda. This will fail if the Lambda::Permissions is not already applied for this bucket to invoke the Lambda. :param dict bucket: Dictionary representing the bucket in SAM template. This is a raw dictionary and not a "resource" object :param model.lambda_.lambda_permission permission: Lambda Permission resource that needs to be created before the bucket. :return: Modified Bucket dictionary """ depends_on = bucket.get("DependsOn", []) # DependsOn can be either a list of strings or a scalar string if isinstance(depends_on, string_types): depends_on = [depends_on] depends_on_set = set(depends_on) depends_on_set.add(permission.logical_id) bucket["DependsOn"] = list(depends_on_set) return bucket
python
def _depend_on_lambda_permissions(self, bucket, permission): """ Make the S3 bucket depends on Lambda Permissions resource because when S3 adds a Notification Configuration, it will check whether it has permissions to access Lambda. This will fail if the Lambda::Permissions is not already applied for this bucket to invoke the Lambda. :param dict bucket: Dictionary representing the bucket in SAM template. This is a raw dictionary and not a "resource" object :param model.lambda_.lambda_permission permission: Lambda Permission resource that needs to be created before the bucket. :return: Modified Bucket dictionary """ depends_on = bucket.get("DependsOn", []) # DependsOn can be either a list of strings or a scalar string if isinstance(depends_on, string_types): depends_on = [depends_on] depends_on_set = set(depends_on) depends_on_set.add(permission.logical_id) bucket["DependsOn"] = list(depends_on_set) return bucket
[ "def", "_depend_on_lambda_permissions", "(", "self", ",", "bucket", ",", "permission", ")", ":", "depends_on", "=", "bucket", ".", "get", "(", "\"DependsOn\"", ",", "[", "]", ")", "# DependsOn can be either a list of strings or a scalar string", "if", "isinstance", "(", "depends_on", ",", "string_types", ")", ":", "depends_on", "=", "[", "depends_on", "]", "depends_on_set", "=", "set", "(", "depends_on", ")", "depends_on_set", ".", "add", "(", "permission", ".", "logical_id", ")", "bucket", "[", "\"DependsOn\"", "]", "=", "list", "(", "depends_on_set", ")", "return", "bucket" ]
Make the S3 bucket depends on Lambda Permissions resource because when S3 adds a Notification Configuration, it will check whether it has permissions to access Lambda. This will fail if the Lambda::Permissions is not already applied for this bucket to invoke the Lambda. :param dict bucket: Dictionary representing the bucket in SAM template. This is a raw dictionary and not a "resource" object :param model.lambda_.lambda_permission permission: Lambda Permission resource that needs to be created before the bucket. :return: Modified Bucket dictionary
[ "Make", "the", "S3", "bucket", "depends", "on", "Lambda", "Permissions", "resource", "because", "when", "S3", "adds", "a", "Notification", "Configuration", "it", "will", "check", "whether", "it", "has", "permissions", "to", "access", "Lambda", ".", "This", "will", "fail", "if", "the", "Lambda", "::", "Permissions", "is", "not", "already", "applied", "for", "this", "bucket", "to", "invoke", "the", "Lambda", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/eventsources/push.py#L243-L266
train
Make the S3 bucket depends on Lambda Permissions resource because when S3 adds a Notification Configuration it will fail if Lambda does not have permission to invoke Lambda.
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,GNd6AVv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P,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(0b10 + 0o155) + chr(0b110001) + chr(1657 - 1609) + '\x32', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b100000 + 0o22) + chr(50) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b111010 + 0o65) + chr(1981 - 1932) + '\x36' + '\x35', 0o10), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(111) + '\063' + '\x33' + chr(0b100011 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(50) + '\064', 0b1000), ehT0Px3KOsy9(chr(851 - 803) + '\x6f' + chr(1800 - 1749) + '\x30' + chr(0b11001 + 0o32), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b110010) + chr(48), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(0b110110) + chr(0b10001 + 0o40), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101010 + 0o11) + '\x31' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(50) + chr(2393 - 2344), 52829 - 52821), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\157' + chr(0b110001) + chr(0b1111 + 0o42) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\x6f' + chr(1547 - 1495) + chr(1568 - 1515), 0o10), ehT0Px3KOsy9(chr(1340 - 1292) + '\x6f' + chr(51) + '\062' + '\x37', 0b1000), ehT0Px3KOsy9(chr(1332 - 1284) + '\157' + chr(0b111 + 0o53) + '\x37' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(10569 - 10458) + chr(0b1111 + 0o42) + chr(0b110000) + '\063', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b110010) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + chr(5598 - 5487) + '\x33' + chr(1544 - 1490) + chr(53), 13294 - 13286), ehT0Px3KOsy9(chr(1237 - 1189) + chr(0b1101111) + chr(0b110 + 0o55) + chr(829 - 779), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + '\060' + chr(298 - 246), 0b1000), ehT0Px3KOsy9(chr(1865 - 1817) + chr(0b1101111) + chr(1529 - 1480) + '\x36' + '\064', 0b1000), ehT0Px3KOsy9(chr(1136 - 1088) + chr(111) + chr(51) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(123 - 73) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1011001 + 0o26) + '\x33' + chr(1426 - 1371) + '\x30', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b1010 + 0o51) + '\x36' + chr(53), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + '\063' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(258 - 209) + chr(0b110001) + chr(2254 - 2204), 0o10), ehT0Px3KOsy9('\x30' + chr(0b11100 + 0o123) + chr(0b1100 + 0o46) + chr(0b110100) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b111 + 0o60) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2013 - 1963) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + '\067' + '\065', 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(2461 - 2350) + '\066' + chr(1130 - 1082), 25680 - 25672), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + '\x32', 8), ehT0Px3KOsy9('\060' + '\157' + '\x32' + '\x32' + '\062', 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + chr(0b110001) + chr(1823 - 1773) + chr(0b1111 + 0o41), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(0b110101) + chr(1242 - 1187), 12341 - 12333), ehT0Px3KOsy9(chr(2224 - 2176) + chr(111) + '\x33' + chr(1969 - 1919), 8), ehT0Px3KOsy9(chr(0b110000) + chr(9401 - 9290) + chr(50) + chr(0b110110) + chr(0b110001), 1836 - 1828), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(1820 - 1772) + chr(0b110110), 43041 - 43033), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + '\063' + chr(49) + chr(0b110101), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(0b110010) + chr(0b110011), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11101 + 0o30) + chr(1495 - 1447), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'l'), '\x64' + chr(0b1100101) + '\143' + chr(2244 - 2133) + chr(5271 - 5171) + '\145')(chr(0b100111 + 0o116) + chr(0b10011 + 0o141) + chr(0b100 + 0o142) + chr(0b100101 + 0o10) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def qezq_8cHQjSf(oVre8I6UXc3b, BoaD8srOIvI5, YjuVmx7ofT5i): oayEYOknteBp = BoaD8srOIvI5.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\x06\xf6\x05\xb9\xfa\xa7\xe3\xbe\xa5'), chr(4314 - 4214) + chr(4451 - 4350) + chr(99) + '\157' + chr(0b1100100 + 0o0) + '\145')(chr(0b1011110 + 0o27) + '\x74' + chr(0b1010101 + 0o21) + chr(0b101101) + chr(378 - 322)), []) if PlSM16l2KDPD(oayEYOknteBp, sInLJQno9SRQ): oayEYOknteBp = [oayEYOknteBp] Rj2JMWSqyslO = MVEN8G6CxlvR(oayEYOknteBp) xafqLlk3kkUe(Rj2JMWSqyslO, xafqLlk3kkUe(SXOLrMavuUCe(b'7\xd9E\xad\xad\xa0\xd7\xc4\x91\x9e\x19\x16'), chr(4122 - 4022) + chr(9563 - 9462) + chr(0b11000 + 0o113) + chr(111) + chr(0b1100100) + chr(0b1100101))('\165' + chr(10349 - 10233) + chr(0b1101 + 0o131) + chr(0b110 + 0o47) + chr(1130 - 1074)))(xafqLlk3kkUe(YjuVmx7ofT5i, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\xe3/\xae\xa2\xf5\xdd\x95\x89\xb9\x1db'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(8583 - 8472) + '\x64' + chr(101))(chr(0b1110101) + chr(116) + chr(102) + chr(45) + '\070'))) BoaD8srOIvI5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x06\xf6\x05\xb9\xfa\xa7\xe3\xbe\xa5'), chr(1939 - 1839) + '\x65' + chr(7773 - 7674) + chr(0b1001 + 0o146) + chr(0b1100100) + '\145')(chr(5081 - 4964) + chr(3107 - 2991) + '\146' + chr(0b101101) + chr(0b11100 + 0o34))] = YyaZ4tpXu4lf(Rj2JMWSqyslO) return BoaD8srOIvI5
awslabs/serverless-application-model
samtranslator/model/eventsources/push.py
S3._depend_on_lambda_permissions_using_tag
def _depend_on_lambda_permissions_using_tag(self, bucket, permission): """ Since conditional DependsOn is not supported this undocumented way of implicitely making dependency through tags is used. See https://stackoverflow.com/questions/34607476/cloudformation-apply-condition-on-dependson It is done by using Ref wrapped in a conditional Fn::If. Using Ref implies a dependency, so CloudFormation will automatically wait once it reaches that function, the same as if you were using a DependsOn. """ properties = bucket.get('Properties', None) if properties is None: properties = {} bucket['Properties'] = properties tags = properties.get('Tags', None) if tags is None: tags = [] properties['Tags'] = tags dep_tag = { 'sam:ConditionalDependsOn:' + permission.logical_id: { 'Fn::If': [ permission.resource_attributes[CONDITION], ref(permission.logical_id), 'no dependency' ] } } properties['Tags'] = tags + get_tag_list(dep_tag) return bucket
python
def _depend_on_lambda_permissions_using_tag(self, bucket, permission): """ Since conditional DependsOn is not supported this undocumented way of implicitely making dependency through tags is used. See https://stackoverflow.com/questions/34607476/cloudformation-apply-condition-on-dependson It is done by using Ref wrapped in a conditional Fn::If. Using Ref implies a dependency, so CloudFormation will automatically wait once it reaches that function, the same as if you were using a DependsOn. """ properties = bucket.get('Properties', None) if properties is None: properties = {} bucket['Properties'] = properties tags = properties.get('Tags', None) if tags is None: tags = [] properties['Tags'] = tags dep_tag = { 'sam:ConditionalDependsOn:' + permission.logical_id: { 'Fn::If': [ permission.resource_attributes[CONDITION], ref(permission.logical_id), 'no dependency' ] } } properties['Tags'] = tags + get_tag_list(dep_tag) return bucket
[ "def", "_depend_on_lambda_permissions_using_tag", "(", "self", ",", "bucket", ",", "permission", ")", ":", "properties", "=", "bucket", ".", "get", "(", "'Properties'", ",", "None", ")", "if", "properties", "is", "None", ":", "properties", "=", "{", "}", "bucket", "[", "'Properties'", "]", "=", "properties", "tags", "=", "properties", ".", "get", "(", "'Tags'", ",", "None", ")", "if", "tags", "is", "None", ":", "tags", "=", "[", "]", "properties", "[", "'Tags'", "]", "=", "tags", "dep_tag", "=", "{", "'sam:ConditionalDependsOn:'", "+", "permission", ".", "logical_id", ":", "{", "'Fn::If'", ":", "[", "permission", ".", "resource_attributes", "[", "CONDITION", "]", ",", "ref", "(", "permission", ".", "logical_id", ")", ",", "'no dependency'", "]", "}", "}", "properties", "[", "'Tags'", "]", "=", "tags", "+", "get_tag_list", "(", "dep_tag", ")", "return", "bucket" ]
Since conditional DependsOn is not supported this undocumented way of implicitely making dependency through tags is used. See https://stackoverflow.com/questions/34607476/cloudformation-apply-condition-on-dependson It is done by using Ref wrapped in a conditional Fn::If. Using Ref implies a dependency, so CloudFormation will automatically wait once it reaches that function, the same as if you were using a DependsOn.
[ "Since", "conditional", "DependsOn", "is", "not", "supported", "this", "undocumented", "way", "of", "implicitely", "making", "dependency", "through", "tags", "is", "used", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/eventsources/push.py#L268-L297
train
This function is used to make conditional DependsOn depend on a resource and add it to the properties of the bucket.
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,OTstrxJf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4lf,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(0b111 + 0o150) + chr(0b1110 + 0o43) + '\061' + chr(225 - 173), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10001 + 0o136) + chr(1866 - 1816) + chr(843 - 793) + chr(633 - 580), 27576 - 27568), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + chr(0b110001) + '\x36' + chr(0b110 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(1290 - 1242) + '\157' + chr(0b110001) + chr(0b10 + 0o64) + '\x31', 42411 - 42403), ehT0Px3KOsy9(chr(48) + chr(6567 - 6456) + chr(0b11000 + 0o32) + chr(0b101101 + 0o3) + chr(0b100001 + 0o25), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b101111 + 0o100) + chr(50) + chr(0b110100) + chr(0b1001 + 0o50), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b10000 + 0o41) + chr(54) + chr(974 - 926), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100110 + 0o15) + chr(49) + '\063', 0o10), ehT0Px3KOsy9(chr(1561 - 1513) + '\x6f' + chr(0b100100 + 0o16) + '\061' + chr(0b1111 + 0o46), ord("\x08")), ehT0Px3KOsy9(chr(1602 - 1554) + chr(7479 - 7368) + chr(0b101100 + 0o7) + chr(1854 - 1805) + chr(0b110001), 2791 - 2783), ehT0Px3KOsy9(chr(48) + chr(0b1001101 + 0o42) + '\063' + chr(0b1101 + 0o45) + chr(0b100110 + 0o20), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + '\061' + '\x32' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + '\061' + '\x31' + '\061', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(0b101111 + 0o3) + '\067', 1406 - 1398), ehT0Px3KOsy9(chr(0b110000) + chr(0b100100 + 0o113) + '\061' + chr(2318 - 2269) + chr(850 - 795), ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + chr(2084 - 2033) + '\x30' + chr(54), 41173 - 41165), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + chr(50) + '\067' + chr(0b101011 + 0o10), 5336 - 5328), ehT0Px3KOsy9('\060' + chr(5599 - 5488) + chr(0b110110) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x33' + '\063' + '\060', 64966 - 64958), ehT0Px3KOsy9(chr(0b110000) + chr(0b10101 + 0o132) + chr(51) + chr(0b110111) + '\x30', 62746 - 62738), ehT0Px3KOsy9(chr(48) + chr(0b101100 + 0o103) + chr(51) + chr(51) + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(0b110010) + chr(0b110011), 64427 - 64419), ehT0Px3KOsy9('\x30' + chr(7159 - 7048) + chr(51) + chr(1361 - 1306) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(1053 - 1005) + '\x6f' + chr(163 - 113) + chr(0b110111) + '\x33', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(0b110101) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b111111 + 0o60) + '\x31' + chr(0b110111) + chr(0b11110 + 0o30), 30164 - 30156), ehT0Px3KOsy9(chr(1114 - 1066) + '\157' + chr(51) + '\065' + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10 + 0o61) + chr(2293 - 2244) + chr(0b101001 + 0o14), 23431 - 23423), ehT0Px3KOsy9('\x30' + chr(111) + chr(1664 - 1615) + chr(50) + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + chr(8708 - 8597) + chr(0b100 + 0o57) + chr(0b11 + 0o63) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + chr(4561 - 4450) + '\062' + chr(0b10111 + 0o37), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + '\x35' + chr(1807 - 1753), 0b1000), ehT0Px3KOsy9(chr(528 - 480) + chr(111) + '\062' + chr(52), 0b1000), ehT0Px3KOsy9(chr(1718 - 1670) + '\157' + chr(724 - 673) + '\067' + chr(49), 58838 - 58830), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(7678 - 7567) + '\061' + '\062' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\157' + chr(0b110011) + chr(0b100010 + 0o21) + chr(0b100111 + 0o11), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x34' + chr(315 - 264), 13941 - 13933), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110111) + chr(1481 - 1429), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(0b101001 + 0o10) + chr(2173 - 2124), 0o10), ehT0Px3KOsy9(chr(626 - 578) + chr(111) + chr(0b0 + 0o62) + chr(0b10101 + 0o41) + chr(50), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101001 + 0o6) + chr(596 - 543) + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'b'), chr(0b1001101 + 0o27) + '\x65' + chr(0b1001101 + 0o26) + chr(0b111101 + 0o62) + chr(9492 - 9392) + '\145')(chr(0b1110 + 0o147) + '\x74' + chr(0b1100110) + '\x2d' + chr(0b0 + 0o70)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def SjFdhImWat8z(oVre8I6UXc3b, BoaD8srOIvI5, YjuVmx7ofT5i): o4Mv82sLmOP8 = BoaD8srOIvI5.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1c\xe7\x1a\x01\xe3\xd3\x04\xa2\xe8\xba'), chr(0b1100100) + '\x65' + '\x63' + '\x6f' + chr(7923 - 7823) + '\x65')(chr(0b10 + 0o163) + chr(116) + '\x66' + chr(0b10010 + 0o33) + chr(0b100011 + 0o25)), None) if o4Mv82sLmOP8 is None: o4Mv82sLmOP8 = {} BoaD8srOIvI5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x1c\xe7\x1a\x01\xe3\xd3\x04\xa2\xe8\xba'), chr(0b1100100) + chr(9767 - 9666) + '\x63' + chr(0b111100 + 0o63) + chr(100) + '\145')(chr(117) + chr(2877 - 2761) + '\146' + '\055' + '\070')] = o4Mv82sLmOP8 MRGa81KE7QCh = o4Mv82sLmOP8.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\xf4\x12\x02'), chr(100) + '\x65' + '\x63' + '\157' + chr(8117 - 8017) + chr(0b1100101))(chr(117) + chr(0b101101 + 0o107) + '\x66' + chr(0b10000 + 0o35) + '\x38'), None) if MRGa81KE7QCh is None: MRGa81KE7QCh = [] o4Mv82sLmOP8[xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\xf4\x12\x02'), chr(6958 - 6858) + chr(0b1110 + 0o127) + chr(0b111000 + 0o53) + chr(111) + chr(3970 - 3870) + chr(5141 - 5040))('\x75' + chr(0b1110100) + '\146' + chr(0b101101) + chr(751 - 695))] = MRGa81KE7QCh JOZr0b6hsSol = {xafqLlk3kkUe(SXOLrMavuUCe(b"?\xf4\x18K\xc5\xce\x1e\xaf\xe4\xbd\xbf9'\xf6#\x82\xdeA\xbd\x96\xbf\xe0\xb2\xd5U"), '\x64' + chr(0b1100101) + '\143' + chr(111) + chr(100) + chr(101))('\165' + chr(0b110100 + 0o100) + chr(2651 - 2549) + chr(646 - 601) + chr(165 - 109)) + YjuVmx7ofT5i.NpZr66MdBhVG: {xafqLlk3kkUe(SXOLrMavuUCe(b'\n\xfbOK\xcf\xc7'), chr(100) + chr(1240 - 1139) + '\143' + chr(111) + chr(100) + chr(5873 - 5772))(chr(5627 - 5510) + '\164' + '\146' + chr(0b101101) + chr(0b111000)): [YjuVmx7ofT5i.x7ddN_ki5nGn[y7wKORCUVRd8], X4s0pSydcnYR(YjuVmx7ofT5i.NpZr66MdBhVG), xafqLlk3kkUe(SXOLrMavuUCe(b'"\xfaU\x15\xe3\xd1\x15\xa5\xe9\xac\xb850'), chr(0b100101 + 0o77) + '\x65' + chr(99) + chr(111) + chr(100) + '\145')(chr(0b1110101) + '\164' + chr(102) + '\x2d' + '\x38')]}} o4Mv82sLmOP8[xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\xf4\x12\x02'), chr(0b0 + 0o144) + chr(101) + chr(99) + '\157' + chr(8946 - 8846) + '\x65')('\x75' + chr(0b1100011 + 0o21) + '\x66' + chr(0b11111 + 0o16) + chr(56))] = MRGa81KE7QCh + o7wz5rzQkPvy(JOZr0b6hsSol) return BoaD8srOIvI5
awslabs/serverless-application-model
samtranslator/model/eventsources/push.py
SNS.to_cloudformation
def to_cloudformation(self, **kwargs): """Returns the Lambda Permission resource allowing SNS to invoke the function this event source triggers. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to which this SNS event expands :rtype: list """ function = kwargs.get('function') if not function: raise TypeError("Missing required keyword argument: function") return [self._construct_permission(function, source_arn=self.Topic), self._inject_subscription(function, self.Topic, self.FilterPolicy)]
python
def to_cloudformation(self, **kwargs): """Returns the Lambda Permission resource allowing SNS to invoke the function this event source triggers. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to which this SNS event expands :rtype: list """ function = kwargs.get('function') if not function: raise TypeError("Missing required keyword argument: function") return [self._construct_permission(function, source_arn=self.Topic), self._inject_subscription(function, self.Topic, self.FilterPolicy)]
[ "def", "to_cloudformation", "(", "self", ",", "*", "*", "kwargs", ")", ":", "function", "=", "kwargs", ".", "get", "(", "'function'", ")", "if", "not", "function", ":", "raise", "TypeError", "(", "\"Missing required keyword argument: function\"", ")", "return", "[", "self", ".", "_construct_permission", "(", "function", ",", "source_arn", "=", "self", ".", "Topic", ")", ",", "self", ".", "_inject_subscription", "(", "function", ",", "self", ".", "Topic", ",", "self", ".", "FilterPolicy", ")", "]" ]
Returns the Lambda Permission resource allowing SNS to invoke the function this event source triggers. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to which this SNS event expands :rtype: list
[ "Returns", "the", "Lambda", "Permission", "resource", "allowing", "SNS", "to", "invoke", "the", "function", "this", "event", "source", "triggers", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/eventsources/push.py#L350-L363
train
Returns the Lambda Permission resource allowing SNS to invoke the function this event source triggers.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7Cc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L8qwsX,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(0b10000 + 0o40) + '\157' + chr(0b110010) + chr(54) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(0b110101) + chr(0b100011 + 0o16), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + '\x37' + chr(0b110000), 61380 - 61372), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100011 + 0o14) + chr(1108 - 1059) + chr(0b110111) + chr(0b101110 + 0o10), ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(10800 - 10689) + chr(0b1101 + 0o51) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(1518 - 1470) + chr(8941 - 8830) + '\x33' + chr(51) + chr(0b11111 + 0o24), 4497 - 4489), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000010 + 0o55) + chr(51) + chr(1073 - 1022) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + chr(0b10111 + 0o32) + '\x34' + chr(0b11111 + 0o27), 0b1000), ehT0Px3KOsy9('\060' + chr(10976 - 10865) + chr(0b110010) + chr(0b110001) + chr(1625 - 1572), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b10101 + 0o37) + chr(0b110000 + 0o6), 8), ehT0Px3KOsy9('\060' + chr(0b1001110 + 0o41) + '\063' + chr(0b100011 + 0o16) + '\065', 21827 - 21819), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x37' + '\061', 0b1000), ehT0Px3KOsy9(chr(395 - 347) + chr(0b101 + 0o152) + chr(575 - 526) + chr(0b110110 + 0o1) + chr(1839 - 1788), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\065' + chr(55), 48223 - 48215), ehT0Px3KOsy9(chr(633 - 585) + chr(3388 - 3277) + chr(54) + chr(1514 - 1460), 34588 - 34580), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\157' + chr(0b110010) + chr(52) + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(0b11100 + 0o123) + chr(49) + chr(2183 - 2130) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b110010 + 0o75) + '\063' + chr(48) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b111111 + 0o60) + chr(0b110011) + chr(2035 - 1980) + '\x31', 0o10), ehT0Px3KOsy9('\060' + chr(0b1010111 + 0o30) + '\x31' + chr(49) + chr(55), 15145 - 15137), ehT0Px3KOsy9('\x30' + chr(10854 - 10743) + '\061' + '\x30' + '\064', 0b1000), ehT0Px3KOsy9(chr(1873 - 1825) + '\157' + '\064' + chr(1547 - 1494), 0o10), ehT0Px3KOsy9('\x30' + chr(0b100110 + 0o111) + '\062' + chr(0b110000) + chr(146 - 94), 0o10), ehT0Px3KOsy9(chr(1723 - 1675) + '\157' + chr(0b110011) + chr(0b111 + 0o54) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000110 + 0o51) + '\x32' + chr(0b11010 + 0o34) + chr(2605 - 2552), 8), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b111101 + 0o62) + chr(2404 - 2354) + '\067', 34939 - 34931), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(52) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(0b110011) + '\x32' + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(48) + chr(839 - 787), 8), ehT0Px3KOsy9(chr(2090 - 2042) + chr(111) + chr(51) + '\066' + chr(1379 - 1331), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(802 - 751) + '\067' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + chr(50) + chr(50), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\060' + chr(51), 39384 - 39376), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + '\063' + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\062' + '\060' + chr(0b100011 + 0o15), 6670 - 6662), ehT0Px3KOsy9(chr(48) + chr(1776 - 1665) + chr(0b100000 + 0o23) + chr(0b11001 + 0o34) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(53) + chr(1603 - 1548), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(52) + chr(0b110110), 8), ehT0Px3KOsy9(chr(1035 - 987) + chr(111) + chr(2045 - 1994) + '\066' + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\157' + chr(49) + '\x34' + chr(53), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(53) + chr(219 - 171), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b'), chr(100) + chr(0b1100 + 0o131) + chr(0b10001 + 0o122) + chr(111) + chr(3931 - 3831) + '\145')(chr(0b1110101) + '\164' + chr(7326 - 7224) + '\x2d' + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def NpIm0Ph3ybvM(oVre8I6UXc3b, **M8EIoTs2GJXE): bBC93MgSHzUB = M8EIoTs2GJXE.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3\xdc\x96\x1dE\xb2\xb3\x08'), chr(0b1100100) + '\145' + chr(0b1100011) + '\x6f' + chr(0b1100100) + '\x65')(chr(5283 - 5166) + chr(0b100100 + 0o120) + '\x66' + chr(0b11010 + 0o23) + chr(2303 - 2247))) if not bBC93MgSHzUB: raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\xc0\x8b\rX\xb5\xbbF\xff\x03\xbcL\x12]S\xc2N\xa9\x9c63J\xf6\xba\x95v\x94\xb2\xf1\x9d\x9f\xbc\xb7\xa0\xa0\x88Z\x88\x96\x11\xdc\xc6\x96'), chr(9473 - 9373) + '\145' + '\x63' + chr(3968 - 3857) + chr(0b1100100) + chr(5062 - 4961))(chr(117) + '\x74' + '\x66' + '\055' + chr(2388 - 2332))) return [xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xea\xca\x97\x10B\xaf\xae\x13\xee\x12\x92I\x1e][\xcf\x1d\xb1\x90 *'), chr(1459 - 1359) + chr(101) + '\143' + chr(10245 - 10134) + chr(2227 - 2127) + '\x65')('\165' + chr(0b1110100) + '\x66' + chr(0b0 + 0o55) + '\070'))(bBC93MgSHzUB, source_arn=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1\xc6\x88\x17R'), chr(100) + '\145' + chr(0b1010 + 0o131) + chr(0b1101111) + chr(100) + chr(101))('\x75' + chr(0b11 + 0o161) + chr(3613 - 3511) + chr(0b101101) + chr(56)))), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xea\xc0\x96\x14T\xb8\xa89\xfe\x13\xafJ\x18]_\xd6\x1a\xab\x96!'), '\x64' + '\x65' + chr(0b1010101 + 0o16) + chr(0b110010 + 0o75) + chr(0b1100100) + chr(7270 - 7169))(chr(0b1110101) + chr(116) + chr(102) + '\055' + chr(56)))(bBC93MgSHzUB, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1\xc6\x88\x17R'), chr(100) + chr(101) + '\x63' + chr(0b101 + 0o152) + chr(0b100001 + 0o103) + '\x65')('\x75' + chr(0b1110100) + chr(0b11010 + 0o114) + chr(0b10100 + 0o31) + chr(56))), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3\xc0\x94\nT\xa9\x8c\t\xe1\x0f\xae@'), chr(100) + '\x65' + '\143' + chr(0b10101 + 0o132) + chr(0b10110 + 0o116) + chr(0b1100101))('\165' + chr(116) + chr(0b111000 + 0o56) + chr(0b1011 + 0o42) + chr(0b110101 + 0o3))))]
awslabs/serverless-application-model
samtranslator/model/eventsources/push.py
Api.resources_to_link
def resources_to_link(self, resources): """ If this API Event Source refers to an explicit API resource, resolve the reference and grab necessary data from the explicit API """ rest_api_id = self.RestApiId if isinstance(rest_api_id, dict) and "Ref" in rest_api_id: rest_api_id = rest_api_id["Ref"] # If RestApiId is a resource in the same template, then we try find the StageName by following the reference # Otherwise we default to a wildcard. This stage name is solely used to construct the permission to # allow this stage to invoke the Lambda function. If we are unable to resolve the stage name, we will # simply permit all stages to invoke this Lambda function # This hack is necessary because customers could use !ImportValue, !Ref or other intrinsic functions which # can be sometimes impossible to resolve (ie. when it has cross-stack references) permitted_stage = "*" stage_suffix = "AllStages" explicit_api = None if isinstance(rest_api_id, string_types): if rest_api_id in resources \ and "Properties" in resources[rest_api_id] \ and "StageName" in resources[rest_api_id]["Properties"]: explicit_api = resources[rest_api_id]["Properties"] permitted_stage = explicit_api["StageName"] # Stage could be a intrinsic, in which case leave the suffix to default value if isinstance(permitted_stage, string_types): if not permitted_stage: raise InvalidResourceException(rest_api_id, 'StageName cannot be empty.') stage_suffix = permitted_stage else: stage_suffix = "Stage" else: # RestApiId is a string, not an intrinsic, but we did not find a valid API resource for this ID raise InvalidEventException(self.relative_id, "RestApiId property of Api event must reference a valid " "resource in the same template.") return { 'explicit_api': explicit_api, 'explicit_api_stage': { 'permitted_stage': permitted_stage, 'suffix': stage_suffix } }
python
def resources_to_link(self, resources): """ If this API Event Source refers to an explicit API resource, resolve the reference and grab necessary data from the explicit API """ rest_api_id = self.RestApiId if isinstance(rest_api_id, dict) and "Ref" in rest_api_id: rest_api_id = rest_api_id["Ref"] # If RestApiId is a resource in the same template, then we try find the StageName by following the reference # Otherwise we default to a wildcard. This stage name is solely used to construct the permission to # allow this stage to invoke the Lambda function. If we are unable to resolve the stage name, we will # simply permit all stages to invoke this Lambda function # This hack is necessary because customers could use !ImportValue, !Ref or other intrinsic functions which # can be sometimes impossible to resolve (ie. when it has cross-stack references) permitted_stage = "*" stage_suffix = "AllStages" explicit_api = None if isinstance(rest_api_id, string_types): if rest_api_id in resources \ and "Properties" in resources[rest_api_id] \ and "StageName" in resources[rest_api_id]["Properties"]: explicit_api = resources[rest_api_id]["Properties"] permitted_stage = explicit_api["StageName"] # Stage could be a intrinsic, in which case leave the suffix to default value if isinstance(permitted_stage, string_types): if not permitted_stage: raise InvalidResourceException(rest_api_id, 'StageName cannot be empty.') stage_suffix = permitted_stage else: stage_suffix = "Stage" else: # RestApiId is a string, not an intrinsic, but we did not find a valid API resource for this ID raise InvalidEventException(self.relative_id, "RestApiId property of Api event must reference a valid " "resource in the same template.") return { 'explicit_api': explicit_api, 'explicit_api_stage': { 'permitted_stage': permitted_stage, 'suffix': stage_suffix } }
[ "def", "resources_to_link", "(", "self", ",", "resources", ")", ":", "rest_api_id", "=", "self", ".", "RestApiId", "if", "isinstance", "(", "rest_api_id", ",", "dict", ")", "and", "\"Ref\"", "in", "rest_api_id", ":", "rest_api_id", "=", "rest_api_id", "[", "\"Ref\"", "]", "# If RestApiId is a resource in the same template, then we try find the StageName by following the reference", "# Otherwise we default to a wildcard. This stage name is solely used to construct the permission to", "# allow this stage to invoke the Lambda function. If we are unable to resolve the stage name, we will", "# simply permit all stages to invoke this Lambda function", "# This hack is necessary because customers could use !ImportValue, !Ref or other intrinsic functions which", "# can be sometimes impossible to resolve (ie. when it has cross-stack references)", "permitted_stage", "=", "\"*\"", "stage_suffix", "=", "\"AllStages\"", "explicit_api", "=", "None", "if", "isinstance", "(", "rest_api_id", ",", "string_types", ")", ":", "if", "rest_api_id", "in", "resources", "and", "\"Properties\"", "in", "resources", "[", "rest_api_id", "]", "and", "\"StageName\"", "in", "resources", "[", "rest_api_id", "]", "[", "\"Properties\"", "]", ":", "explicit_api", "=", "resources", "[", "rest_api_id", "]", "[", "\"Properties\"", "]", "permitted_stage", "=", "explicit_api", "[", "\"StageName\"", "]", "# Stage could be a intrinsic, in which case leave the suffix to default value", "if", "isinstance", "(", "permitted_stage", ",", "string_types", ")", ":", "if", "not", "permitted_stage", ":", "raise", "InvalidResourceException", "(", "rest_api_id", ",", "'StageName cannot be empty.'", ")", "stage_suffix", "=", "permitted_stage", "else", ":", "stage_suffix", "=", "\"Stage\"", "else", ":", "# RestApiId is a string, not an intrinsic, but we did not find a valid API resource for this ID", "raise", "InvalidEventException", "(", "self", ".", "relative_id", ",", "\"RestApiId property of Api event must reference a valid \"", "\"resource in the same template.\"", ")", "return", "{", "'explicit_api'", ":", "explicit_api", ",", "'explicit_api_stage'", ":", "{", "'permitted_stage'", ":", "permitted_stage", ",", "'suffix'", ":", "stage_suffix", "}", "}" ]
If this API Event Source refers to an explicit API resource, resolve the reference and grab necessary data from the explicit API
[ "If", "this", "API", "Event", "Source", "refers", "to", "an", "explicit", "API", "resource", "resolve", "the", "reference", "and", "grab", "necessary", "data", "from", "the", "explicit", "API" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/eventsources/push.py#L392-L439
train
Given a list of resources return a dictionary of the resource names and the corresponding explicit API resource IDs.
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,Iiw8L0M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N,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' + '\062' + chr(1372 - 1323) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + chr(400 - 351) + '\064', 57386 - 57378), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(49) + chr(52), 0b1000), ehT0Px3KOsy9(chr(365 - 317) + chr(111) + chr(1524 - 1474) + chr(464 - 409) + chr(0b100 + 0o63), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10 + 0o63) + '\064', 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(1932 - 1883) + '\x36' + '\x36', 0b1000), ehT0Px3KOsy9(chr(583 - 535) + '\157' + '\x31' + chr(170 - 118) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(2258 - 2210) + chr(3845 - 3734) + chr(0b1101 + 0o46) + chr(1872 - 1820) + chr(54), 0b1000), ehT0Px3KOsy9(chr(1960 - 1912) + chr(0b1101111) + chr(0b101111 + 0o6) + chr(0b100011 + 0o22), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110101) + '\064', 8), ehT0Px3KOsy9(chr(394 - 346) + chr(0b1101111) + chr(0b100111 + 0o12) + chr(0b11110 + 0o31) + '\062', 0b1000), ehT0Px3KOsy9('\x30' + chr(11117 - 11006) + '\065' + chr(544 - 494), 31396 - 31388), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + chr(0b110011) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(1845 - 1797) + chr(0b1101111) + chr(0b100100 + 0o16) + chr(2696 - 2642) + '\x34', 0o10), ehT0Px3KOsy9(chr(506 - 458) + '\x6f' + '\063' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + '\062' + '\x34' + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11000 + 0o127) + chr(0b110001) + chr(2432 - 2380) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1110 + 0o43) + '\067' + chr(0b110001 + 0o1), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110101) + chr(51), 22388 - 22380), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + chr(0b11100 + 0o25) + '\x32', 45924 - 45916), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + '\064' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + '\067' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(1954 - 1843) + '\063' + chr(0b110111) + '\066', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\066' + '\063', 20071 - 20063), ehT0Px3KOsy9(chr(48) + '\157' + chr(54) + chr(0b1100 + 0o50), 18637 - 18629), ehT0Px3KOsy9(chr(48) + chr(5763 - 5652) + chr(0b110101) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110010 + 0o75) + chr(2123 - 2071) + chr(0b111 + 0o56), ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + chr(0b110001) + chr(1798 - 1745) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(53) + '\x36', 53925 - 53917), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(11345 - 11234) + chr(0b101 + 0o54) + '\x32' + chr(0b110110), 9466 - 9458), ehT0Px3KOsy9(chr(0b110000) + chr(2602 - 2491) + chr(1377 - 1327) + '\x34' + chr(0b110110), 8), ehT0Px3KOsy9(chr(48) + chr(10646 - 10535) + '\061' + '\063' + chr(51), 35207 - 35199), ehT0Px3KOsy9('\x30' + chr(0b11101 + 0o122) + chr(51) + chr(771 - 721) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b111100 + 0o63) + '\063' + chr(53) + chr(1034 - 985), ord("\x08")), ehT0Px3KOsy9(chr(341 - 293) + '\157' + '\x34' + chr(0b10100 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1101111) + '\x31' + chr(0b100000 + 0o21) + chr(732 - 683), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + '\061' + '\065' + '\x37', 0b1000), ehT0Px3KOsy9(chr(628 - 580) + chr(111) + '\062' + '\x35' + chr(0b110101), 23477 - 23469), ehT0Px3KOsy9(chr(588 - 540) + '\x6f' + chr(0b110010) + chr(0b1100 + 0o51) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1010000 + 0o37) + '\066' + '\x33', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1856 - 1808) + chr(0b1101111) + '\065' + chr(0b101101 + 0o3), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa6'), chr(100) + '\x65' + chr(8755 - 8656) + '\157' + chr(100) + '\x65')(chr(117) + chr(0b1110100) + chr(9721 - 9619) + '\055' + chr(1383 - 1327)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def S6HQZUh3Ypaj(oVre8I6UXc3b, z4Xs9XhDbg00): t096BLW_NG_C = oVre8I6UXc3b.hxMeJnubhZib if PlSM16l2KDPD(t096BLW_NG_C, wLqBDw8l0eIm) and xafqLlk3kkUe(SXOLrMavuUCe(b'\xdai\xaa'), chr(4592 - 4492) + chr(0b1100101) + chr(2397 - 2298) + '\157' + chr(100) + chr(101))('\165' + '\164' + chr(9084 - 8982) + chr(45) + chr(0b11 + 0o65)) in t096BLW_NG_C: t096BLW_NG_C = t096BLW_NG_C[xafqLlk3kkUe(SXOLrMavuUCe(b'\xdai\xaa'), chr(0b101011 + 0o71) + chr(101) + '\143' + chr(0b11001 + 0o126) + chr(100) + chr(101))('\165' + chr(0b1110100) + '\x66' + '\055' + chr(340 - 284))] pzFO0ZrR8a_w = xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2'), chr(0b1100100) + chr(0b1011000 + 0o15) + chr(0b111 + 0o134) + chr(0b1100001 + 0o16) + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(2037 - 1935) + chr(45) + '\070') A2Eot5Nd9MFh = xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9`\xa0\xecX\x17\x06\x83^'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\157' + chr(0b1100100) + chr(6683 - 6582))(chr(117) + '\x74' + '\146' + chr(805 - 760) + '\070') zBjQ9fkNWpqr = None if PlSM16l2KDPD(t096BLW_NG_C, sInLJQno9SRQ): if t096BLW_NG_C in z4Xs9XhDbg00 and xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8~\xa3\xcfI\x04\x15\x8fH_'), '\x64' + chr(9165 - 9064) + '\x63' + chr(0b1101111) + chr(0b101010 + 0o72) + chr(0b11101 + 0o110))(chr(0b1110101) + chr(11167 - 11051) + chr(5997 - 5895) + chr(549 - 504) + chr(2449 - 2393)) in z4Xs9XhDbg00[t096BLW_NG_C] and (xafqLlk3kkUe(SXOLrMavuUCe(b'\xdbx\xad\xd8I8\x00\x8bH'), '\144' + chr(624 - 523) + chr(99) + '\x6f' + '\x64' + chr(9897 - 9796))(chr(117) + chr(116) + chr(0b10011 + 0o123) + '\055' + chr(56)) in z4Xs9XhDbg00[t096BLW_NG_C][xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8~\xa3\xcfI\x04\x15\x8fH_'), '\144' + '\145' + chr(0b1001100 + 0o27) + '\157' + '\144' + chr(2163 - 2062))(chr(117) + chr(12382 - 12266) + chr(0b1100110) + chr(0b10 + 0o53) + chr(0b11100 + 0o34))]): zBjQ9fkNWpqr = z4Xs9XhDbg00[t096BLW_NG_C][xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8~\xa3\xcfI\x04\x15\x8fH_'), chr(0b1 + 0o143) + chr(0b1100101) + '\143' + '\157' + chr(2031 - 1931) + chr(0b1100001 + 0o4))(chr(5016 - 4899) + chr(0b100010 + 0o122) + chr(102) + '\055' + chr(2717 - 2661))] pzFO0ZrR8a_w = zBjQ9fkNWpqr[xafqLlk3kkUe(SXOLrMavuUCe(b'\xdbx\xad\xd8I8\x00\x8bH'), chr(9064 - 8964) + chr(0b110011 + 0o62) + chr(6523 - 6424) + chr(0b101100 + 0o103) + chr(100) + chr(0b1100101))(chr(117) + '\x74' + '\146' + chr(45) + chr(56))] if PlSM16l2KDPD(pzFO0ZrR8a_w, sInLJQno9SRQ): if not pzFO0ZrR8a_w: raise ow8Lll3lwq0h(t096BLW_NG_C, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdbx\xad\xd8I8\x00\x8bH\x0c\x19K\xf4\xdap\xd2F\x18N\xaa\xc4\x91\x8eGM\x07'), '\x64' + chr(0b1100101) + chr(0b110 + 0o135) + chr(111) + '\144' + chr(101))('\165' + chr(0b1011011 + 0o31) + chr(0b1100110) + chr(45) + chr(56))) A2Eot5Nd9MFh = pzFO0ZrR8a_w else: A2Eot5Nd9MFh = xafqLlk3kkUe(SXOLrMavuUCe(b'\xdbx\xad\xd8I'), chr(0b1100100) + chr(101) + chr(99) + chr(111) + chr(0b1100100) + '\145')('\x75' + chr(1387 - 1271) + chr(102) + '\055' + chr(56)) else: raise eXWqlSUlGxPF(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfai\xa0\xdeX\x1f\x17\x83rE\x1e'), chr(9053 - 8953) + '\x65' + chr(0b1100011) + chr(1658 - 1547) + '\144' + chr(0b1011110 + 0o7))('\x75' + chr(0b10010 + 0o142) + '\146' + '\x2d' + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdai\xbf\xcbm\x06\x08\xafI\x0c\nX\xf5\xc4z\xd4\x12\x03\x0b\xe5\xc7\xdc\xbfC]\t@\x1c\x8b8\xd2{\xbd\x9cS=O\xdf\xcfU\xed~\xa9\xd1O\x13A\x87\rZ\x1bF\xf3\xd0?\xd4\x03\tD\xff\xd3\x9f\x9b\x13]G\x05\x1e\x863\x86(\xb1\x84Ei\x1b\xc8\xc7C\xe4m\xb8\xda\x02'), chr(0b0 + 0o144) + chr(4540 - 4439) + '\x63' + chr(148 - 37) + chr(100) + '\x65')(chr(0b1111 + 0o146) + chr(0b1101101 + 0o7) + '\x66' + chr(0b101101) + chr(0b111000))) return {xafqLlk3kkUe(SXOLrMavuUCe(b'\xedt\xbc\xd3E\x15\x08\x92rM\nC'), chr(7158 - 7058) + chr(101) + chr(0b1001001 + 0o32) + '\157' + chr(0b1100100) + chr(101))('\165' + chr(6163 - 6047) + '\146' + chr(357 - 312) + '\x38'): zBjQ9fkNWpqr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xedt\xbc\xd3E\x15\x08\x92rM\nC\xc5\xc7k\xc7\x01\x1f'), '\144' + '\145' + chr(0b101 + 0o136) + chr(0b1101111) + chr(0b100110 + 0o76) + '\x65')('\x75' + '\164' + '\146' + chr(1507 - 1462) + '\070'): {xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8i\xbe\xd2E\x02\x15\x83Is\t^\xfb\xd3z'), chr(0b110001 + 0o63) + chr(4095 - 3994) + chr(99) + '\x6f' + chr(0b1010110 + 0o16) + '\145')(chr(117) + '\164' + chr(102) + '\055' + chr(56)): pzFO0ZrR8a_w, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfby\xaa\xd9E\x0e'), '\x64' + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(1601 - 1501) + '\145')('\165' + chr(0b1110100) + chr(0b1000001 + 0o45) + chr(0b101101) + '\070'): A2Eot5Nd9MFh}}
awslabs/serverless-application-model
samtranslator/model/eventsources/push.py
Api.to_cloudformation
def to_cloudformation(self, **kwargs): """If the Api event source has a RestApi property, then simply return the Lambda Permission resource allowing API Gateway to call the function. If no RestApi is provided, then additionally inject the path, method, and the x-amazon-apigateway-integration into the Swagger body for a provided implicit API. :param dict kwargs: a dict containing the implicit RestApi to be modified, should no explicit RestApi \ be provided. :returns: a list of vanilla CloudFormation Resources, to which this Api event expands :rtype: list """ resources = [] function = kwargs.get('function') if not function: raise TypeError("Missing required keyword argument: function") if self.Method is not None: # Convert to lower case so that user can specify either GET or get self.Method = self.Method.lower() resources.extend(self._get_permissions(kwargs)) explicit_api = kwargs['explicit_api'] if explicit_api.get("__MANAGE_SWAGGER"): self._add_swagger_integration(explicit_api, function) return resources
python
def to_cloudformation(self, **kwargs): """If the Api event source has a RestApi property, then simply return the Lambda Permission resource allowing API Gateway to call the function. If no RestApi is provided, then additionally inject the path, method, and the x-amazon-apigateway-integration into the Swagger body for a provided implicit API. :param dict kwargs: a dict containing the implicit RestApi to be modified, should no explicit RestApi \ be provided. :returns: a list of vanilla CloudFormation Resources, to which this Api event expands :rtype: list """ resources = [] function = kwargs.get('function') if not function: raise TypeError("Missing required keyword argument: function") if self.Method is not None: # Convert to lower case so that user can specify either GET or get self.Method = self.Method.lower() resources.extend(self._get_permissions(kwargs)) explicit_api = kwargs['explicit_api'] if explicit_api.get("__MANAGE_SWAGGER"): self._add_swagger_integration(explicit_api, function) return resources
[ "def", "to_cloudformation", "(", "self", ",", "*", "*", "kwargs", ")", ":", "resources", "=", "[", "]", "function", "=", "kwargs", ".", "get", "(", "'function'", ")", "if", "not", "function", ":", "raise", "TypeError", "(", "\"Missing required keyword argument: function\"", ")", "if", "self", ".", "Method", "is", "not", "None", ":", "# Convert to lower case so that user can specify either GET or get", "self", ".", "Method", "=", "self", ".", "Method", ".", "lower", "(", ")", "resources", ".", "extend", "(", "self", ".", "_get_permissions", "(", "kwargs", ")", ")", "explicit_api", "=", "kwargs", "[", "'explicit_api'", "]", "if", "explicit_api", ".", "get", "(", "\"__MANAGE_SWAGGER\"", ")", ":", "self", ".", "_add_swagger_integration", "(", "explicit_api", ",", "function", ")", "return", "resources" ]
If the Api event source has a RestApi property, then simply return the Lambda Permission resource allowing API Gateway to call the function. If no RestApi is provided, then additionally inject the path, method, and the x-amazon-apigateway-integration into the Swagger body for a provided implicit API. :param dict kwargs: a dict containing the implicit RestApi to be modified, should no explicit RestApi \ be provided. :returns: a list of vanilla CloudFormation Resources, to which this Api event expands :rtype: list
[ "If", "the", "Api", "event", "source", "has", "a", "RestApi", "property", "then", "simply", "return", "the", "Lambda", "Permission", "resource", "allowing", "API", "Gateway", "to", "call", "the", "function", ".", "If", "no", "RestApi", "is", "provided", "then", "additionally", "inject", "the", "path", "method", "and", "the", "x", "-", "amazon", "-", "apigateway", "-", "integration", "into", "the", "Swagger", "body", "for", "a", "provided", "implicit", "API", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/eventsources/push.py#L441-L468
train
Converts the event source to a list of CloudFormation Resources.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQe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zvg0Vq,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) + '\063' + '\x35' + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(55) + '\065', 44646 - 44638), ehT0Px3KOsy9(chr(1666 - 1618) + chr(0b1101111) + chr(51) + chr(647 - 592) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(2281 - 2233) + chr(1238 - 1127) + chr(49) + chr(0b110001) + chr(53), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x35' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(92 - 44) + chr(8506 - 8395) + chr(49) + '\066', 0o10), ehT0Px3KOsy9(chr(1141 - 1093) + '\x6f' + '\x33' + chr(0b10100 + 0o43) + chr(2392 - 2338), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(0b110111) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(690 - 640) + '\x37', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10001 + 0o40) + chr(48), 0o10), ehT0Px3KOsy9(chr(854 - 806) + chr(111) + chr(0b110011) + chr(1010 - 956) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11010 + 0o125) + '\x31' + chr(0b110011) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(2963 - 2852) + '\062' + chr(2872 - 2817) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(1121 - 1073) + chr(10902 - 10791) + '\x31' + '\x36' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(1576 - 1528) + chr(0b1100001 + 0o16) + chr(0b110001) + chr(49) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(0b100000 + 0o21) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10 + 0o57) + chr(2236 - 2181) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\x6f' + chr(0b100011 + 0o16) + '\062', 46465 - 46457), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2446 - 2396) + chr(415 - 367) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(2408 - 2353) + chr(0b101111 + 0o6), 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + '\063' + chr(0b100011 + 0o24) + chr(0b110110), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(2474 - 2422) + chr(184 - 135), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101101 + 0o2) + chr(75 - 26) + chr(0b111 + 0o56) + chr(1675 - 1623), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + '\x33' + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(6606 - 6495) + chr(0b110011) + chr(54) + chr(846 - 795), 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b111000 + 0o67) + chr(0b1000 + 0o51) + '\x36' + chr(0b110101), 23585 - 23577), ehT0Px3KOsy9(chr(477 - 429) + '\157' + chr(1641 - 1590) + chr(55) + chr(0b100100 + 0o23), 8), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\157' + chr(230 - 180) + chr(819 - 769) + chr(375 - 325), 0o10), ehT0Px3KOsy9(chr(479 - 431) + chr(0b1001101 + 0o42) + chr(1325 - 1276) + '\067' + chr(915 - 864), ord("\x08")), ehT0Px3KOsy9(chr(1029 - 981) + '\x6f' + chr(0b100111 + 0o12) + chr(2174 - 2119) + chr(0b11010 + 0o35), 0o10), ehT0Px3KOsy9('\060' + chr(0b110011 + 0o74) + chr(49) + chr(0b100101 + 0o13) + chr(0b110000), 49258 - 49250), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(827 - 777) + '\x33' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(0b110 + 0o54) + chr(0b100111 + 0o16) + chr(50), 40703 - 40695), ehT0Px3KOsy9(chr(1468 - 1420) + '\157' + '\062' + chr(0b110110) + chr(744 - 690), ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\x6f' + chr(374 - 323) + '\062' + '\062', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11000 + 0o31) + '\x34', 63873 - 63865), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + '\x37' + '\x37', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(342 - 293) + '\067' + chr(0b100110 + 0o20), ord("\x08")), ehT0Px3KOsy9(chr(800 - 752) + chr(111) + chr(2510 - 2459) + chr(723 - 668) + chr(0b110001), 8), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + '\063' + chr(0b110001) + '\x32', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1028 - 980) + chr(0b1101111) + chr(0b110101) + chr(121 - 73), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0'), chr(0b1100100) + chr(0b1100101) + chr(0b10100 + 0o117) + chr(0b1101111) + chr(5036 - 4936) + chr(101))(chr(0b1110101) + chr(12839 - 12723) + chr(8874 - 8772) + chr(810 - 765) + chr(0b101111 + 0o11)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def NpIm0Ph3ybvM(oVre8I6UXc3b, **M8EIoTs2GJXE): z4Xs9XhDbg00 = [] bBC93MgSHzUB = M8EIoTs2GJXE.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\x88\xc8\x91.[g\x91\x97'), chr(6235 - 6135) + chr(6860 - 6759) + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(0b1101 + 0o147) + chr(278 - 176) + chr(0b11100 + 0o21) + chr(0b111000))) if not bBC93MgSHzUB: raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3\xd4\x8c>F`\x99\xd9%m\x83-\xd5\x04),Xa\xe6\x84\x89N\x1e\xfa\xd3\x14\x8d\xf5\x0e\x12%\xf3\xde\x8c\xf2j\n\x10\x9a\xbe\x87\xd2\x91'), chr(0b1001101 + 0o27) + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\144' + chr(0b1000100 + 0o41))(chr(0b1110101) + '\164' + chr(0b1100110) + chr(1813 - 1768) + chr(56))) if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3\xd8\x8b%@j'), chr(100) + '\145' + chr(99) + chr(0b1100001 + 0o16) + chr(0b11001 + 0o113) + chr(101))('\x75' + chr(0b100000 + 0o124) + '\x66' + chr(539 - 494) + chr(56))) is not None: oVre8I6UXc3b.fpNPCvYKIs70 = oVre8I6UXc3b.Method.lower() xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8b\xc5\x8b(Aj'), chr(100) + chr(3294 - 3193) + chr(99) + chr(0b1001010 + 0o45) + '\144' + chr(0b1011000 + 0o15))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(0b11111 + 0o16) + '\x38'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\xda\x9a9p~\x9b\x8b:a\x81+\xd5\x19";'), chr(100) + chr(4258 - 4157) + chr(0b10001 + 0o122) + chr(111) + chr(4334 - 4234) + chr(101))(chr(0b110011 + 0o102) + '\164' + chr(1445 - 1343) + chr(45) + chr(2770 - 2714)))(M8EIoTs2GJXE)) zBjQ9fkNWpqr = M8EIoTs2GJXE[xafqLlk3kkUe(SXOLrMavuUCe(b'\x8b\xc5\x8f!Fm\x97\x8d\x08i\x821'), '\144' + chr(0b1100101) + chr(1414 - 1315) + chr(111) + chr(0b1011 + 0o131) + chr(9823 - 9722))(chr(0b1110101) + '\x74' + chr(102) + '\x2d' + chr(56))] if xafqLlk3kkUe(zBjQ9fkNWpqr, xafqLlk3kkUe(SXOLrMavuUCe(b'\x89\xd8\x8b'), chr(100) + chr(691 - 590) + '\143' + chr(0b11 + 0o154) + '\144' + chr(0b110011 + 0o62))(chr(0b1110101) + chr(2167 - 2051) + '\146' + chr(0b101101) + chr(1032 - 976)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\xe2\xb2\x0caO\xb9\xbc\x08[\xa5\x19\xfb1\t\x1a'), chr(100) + chr(101) + chr(99) + chr(696 - 585) + '\x64' + chr(7435 - 7334))(chr(0b1000 + 0o155) + '\x74' + chr(0b1100110) + '\055' + '\x38')): xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\xdc\x9b)p}\x89\x980o\x97*\xe3\x1f"<\x1dm\xf1\x9c\x8aH\x03\xf0'), chr(0b1010110 + 0o16) + chr(101) + chr(0b11 + 0o140) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(10616 - 10500) + '\146' + '\x2d' + chr(56)))(zBjQ9fkNWpqr, bBC93MgSHzUB) return z4Xs9XhDbg00
awslabs/serverless-application-model
samtranslator/model/eventsources/push.py
Api._add_swagger_integration
def _add_swagger_integration(self, api, function): """Adds the path and method for this Api event source to the Swagger body for the provided RestApi. :param model.apigateway.ApiGatewayRestApi rest_api: the RestApi to which the path and method should be added. """ swagger_body = api.get("DefinitionBody") if swagger_body is None: return function_arn = function.get_runtime_attr('arn') partition = ArnGenerator.get_partition_name() uri = fnSub('arn:' + partition + ':apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/' + make_shorthand(function_arn) + '/invocations') editor = SwaggerEditor(swagger_body) if editor.has_integration(self.Path, self.Method): # Cannot add the Lambda Integration, if it is already present raise InvalidEventException( self.relative_id, 'API method "{method}" defined multiple times for path "{path}".'.format( method=self.Method, path=self.Path)) condition = None if CONDITION in function.resource_attributes: condition = function.resource_attributes[CONDITION] editor.add_lambda_integration(self.Path, self.Method, uri, self.Auth, api.get('Auth'), condition=condition) if self.Auth: method_authorizer = self.Auth.get('Authorizer') if method_authorizer: api_auth = api.get('Auth') api_authorizers = api_auth and api_auth.get('Authorizers') if method_authorizer != 'AWS_IAM': if not api_authorizers: raise InvalidEventException( self.relative_id, 'Unable to set Authorizer [{authorizer}] on API method [{method}] for path [{path}] ' 'because the related API does not define any Authorizers.'.format( authorizer=method_authorizer, method=self.Method, path=self.Path)) if method_authorizer != 'NONE' and not api_authorizers.get(method_authorizer): raise InvalidEventException( self.relative_id, 'Unable to set Authorizer [{authorizer}] on API method [{method}] for path [{path}] ' 'because it wasn\'t defined in the API\'s Authorizers.'.format( authorizer=method_authorizer, method=self.Method, path=self.Path)) if method_authorizer == 'NONE' and not api_auth.get('DefaultAuthorizer'): raise InvalidEventException( self.relative_id, 'Unable to set Authorizer on API method [{method}] for path [{path}] because \'NONE\' ' 'is only a valid value when a DefaultAuthorizer on the API is specified.'.format( method=self.Method, path=self.Path)) editor.add_auth_to_method(api=api, path=self.Path, method_name=self.Method, auth=self.Auth) api["DefinitionBody"] = editor.swagger
python
def _add_swagger_integration(self, api, function): """Adds the path and method for this Api event source to the Swagger body for the provided RestApi. :param model.apigateway.ApiGatewayRestApi rest_api: the RestApi to which the path and method should be added. """ swagger_body = api.get("DefinitionBody") if swagger_body is None: return function_arn = function.get_runtime_attr('arn') partition = ArnGenerator.get_partition_name() uri = fnSub('arn:' + partition + ':apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/' + make_shorthand(function_arn) + '/invocations') editor = SwaggerEditor(swagger_body) if editor.has_integration(self.Path, self.Method): # Cannot add the Lambda Integration, if it is already present raise InvalidEventException( self.relative_id, 'API method "{method}" defined multiple times for path "{path}".'.format( method=self.Method, path=self.Path)) condition = None if CONDITION in function.resource_attributes: condition = function.resource_attributes[CONDITION] editor.add_lambda_integration(self.Path, self.Method, uri, self.Auth, api.get('Auth'), condition=condition) if self.Auth: method_authorizer = self.Auth.get('Authorizer') if method_authorizer: api_auth = api.get('Auth') api_authorizers = api_auth and api_auth.get('Authorizers') if method_authorizer != 'AWS_IAM': if not api_authorizers: raise InvalidEventException( self.relative_id, 'Unable to set Authorizer [{authorizer}] on API method [{method}] for path [{path}] ' 'because the related API does not define any Authorizers.'.format( authorizer=method_authorizer, method=self.Method, path=self.Path)) if method_authorizer != 'NONE' and not api_authorizers.get(method_authorizer): raise InvalidEventException( self.relative_id, 'Unable to set Authorizer [{authorizer}] on API method [{method}] for path [{path}] ' 'because it wasn\'t defined in the API\'s Authorizers.'.format( authorizer=method_authorizer, method=self.Method, path=self.Path)) if method_authorizer == 'NONE' and not api_auth.get('DefaultAuthorizer'): raise InvalidEventException( self.relative_id, 'Unable to set Authorizer on API method [{method}] for path [{path}] because \'NONE\' ' 'is only a valid value when a DefaultAuthorizer on the API is specified.'.format( method=self.Method, path=self.Path)) editor.add_auth_to_method(api=api, path=self.Path, method_name=self.Method, auth=self.Auth) api["DefinitionBody"] = editor.swagger
[ "def", "_add_swagger_integration", "(", "self", ",", "api", ",", "function", ")", ":", "swagger_body", "=", "api", ".", "get", "(", "\"DefinitionBody\"", ")", "if", "swagger_body", "is", "None", ":", "return", "function_arn", "=", "function", ".", "get_runtime_attr", "(", "'arn'", ")", "partition", "=", "ArnGenerator", ".", "get_partition_name", "(", ")", "uri", "=", "fnSub", "(", "'arn:'", "+", "partition", "+", "':apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/'", "+", "make_shorthand", "(", "function_arn", ")", "+", "'/invocations'", ")", "editor", "=", "SwaggerEditor", "(", "swagger_body", ")", "if", "editor", ".", "has_integration", "(", "self", ".", "Path", ",", "self", ".", "Method", ")", ":", "# Cannot add the Lambda Integration, if it is already present", "raise", "InvalidEventException", "(", "self", ".", "relative_id", ",", "'API method \"{method}\" defined multiple times for path \"{path}\".'", ".", "format", "(", "method", "=", "self", ".", "Method", ",", "path", "=", "self", ".", "Path", ")", ")", "condition", "=", "None", "if", "CONDITION", "in", "function", ".", "resource_attributes", ":", "condition", "=", "function", ".", "resource_attributes", "[", "CONDITION", "]", "editor", ".", "add_lambda_integration", "(", "self", ".", "Path", ",", "self", ".", "Method", ",", "uri", ",", "self", ".", "Auth", ",", "api", ".", "get", "(", "'Auth'", ")", ",", "condition", "=", "condition", ")", "if", "self", ".", "Auth", ":", "method_authorizer", "=", "self", ".", "Auth", ".", "get", "(", "'Authorizer'", ")", "if", "method_authorizer", ":", "api_auth", "=", "api", ".", "get", "(", "'Auth'", ")", "api_authorizers", "=", "api_auth", "and", "api_auth", ".", "get", "(", "'Authorizers'", ")", "if", "method_authorizer", "!=", "'AWS_IAM'", ":", "if", "not", "api_authorizers", ":", "raise", "InvalidEventException", "(", "self", ".", "relative_id", ",", "'Unable to set Authorizer [{authorizer}] on API method [{method}] for path [{path}] '", "'because the related API does not define any Authorizers.'", ".", "format", "(", "authorizer", "=", "method_authorizer", ",", "method", "=", "self", ".", "Method", ",", "path", "=", "self", ".", "Path", ")", ")", "if", "method_authorizer", "!=", "'NONE'", "and", "not", "api_authorizers", ".", "get", "(", "method_authorizer", ")", ":", "raise", "InvalidEventException", "(", "self", ".", "relative_id", ",", "'Unable to set Authorizer [{authorizer}] on API method [{method}] for path [{path}] '", "'because it wasn\\'t defined in the API\\'s Authorizers.'", ".", "format", "(", "authorizer", "=", "method_authorizer", ",", "method", "=", "self", ".", "Method", ",", "path", "=", "self", ".", "Path", ")", ")", "if", "method_authorizer", "==", "'NONE'", "and", "not", "api_auth", ".", "get", "(", "'DefaultAuthorizer'", ")", ":", "raise", "InvalidEventException", "(", "self", ".", "relative_id", ",", "'Unable to set Authorizer on API method [{method}] for path [{path}] because \\'NONE\\' '", "'is only a valid value when a DefaultAuthorizer on the API is specified.'", ".", "format", "(", "method", "=", "self", ".", "Method", ",", "path", "=", "self", ".", "Path", ")", ")", "editor", ".", "add_auth_to_method", "(", "api", "=", "api", ",", "path", "=", "self", ".", "Path", ",", "method_name", "=", "self", ".", "Method", ",", "auth", "=", "self", ".", "Auth", ")", "api", "[", "\"DefinitionBody\"", "]", "=", "editor", ".", "swagger" ]
Adds the path and method for this Api event source to the Swagger body for the provided RestApi. :param model.apigateway.ApiGatewayRestApi rest_api: the RestApi to which the path and method should be added.
[ "Adds", "the", "path", "and", "method", "for", "this", "Api", "event", "source", "to", "the", "Swagger", "body", "for", "the", "provided", "RestApi", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/eventsources/push.py#L507-L567
train
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AeSQh7N,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(0b110101) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + chr(51) + chr(0b101111 + 0o7) + chr(0b11101 + 0o32), 0o10), ehT0Px3KOsy9(chr(48) + chr(235 - 124) + chr(1961 - 1910) + '\x30' + chr(50), 64917 - 64909), ehT0Px3KOsy9(chr(1033 - 985) + chr(8021 - 7910) + '\062' + chr(0b110101) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(2147 - 2098) + '\x35' + chr(1275 - 1226), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(51) + chr(0b110101), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(398 - 347) + chr(874 - 820), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(1415 - 1367) + '\061', 33213 - 33205), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(4944 - 4833) + chr(0b110010 + 0o0) + '\063' + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + '\061' + '\060', 0o10), ehT0Px3KOsy9('\060' + chr(2759 - 2648) + '\x32' + chr(0b110100) + chr(1878 - 1826), 58036 - 58028), ehT0Px3KOsy9('\x30' + chr(7984 - 7873) + chr(50) + chr(52) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(2353 - 2242) + chr(1337 - 1288) + chr(733 - 684) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(90 - 42) + '\062', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b111110 + 0o61) + chr(0b110011) + chr(0b110111) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1998 - 1948) + chr(0b110111) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(658 - 607) + chr(0b110000) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(53) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(8051 - 7940) + chr(0b10000 + 0o47) + chr(0b11100 + 0o24), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(53) + chr(49), 8), ehT0Px3KOsy9(chr(48) + chr(0b1100011 + 0o14) + '\x33' + chr(0b110100) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(8333 - 8222) + chr(0b10101 + 0o36) + chr(0b101110 + 0o7) + chr(0b110000 + 0o7), 8), ehT0Px3KOsy9(chr(1431 - 1383) + chr(9520 - 9409) + '\x32' + chr(51) + chr(0b100010 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\065' + '\x36', 0o10), ehT0Px3KOsy9('\060' + chr(0b11011 + 0o124) + chr(0b110011) + chr(0b110010) + '\067', 26014 - 26006), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + '\x37' + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b110110 + 0o71) + chr(0b110011) + '\066' + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + '\x30' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(1305 - 1257) + '\x6f' + '\x32' + chr(1614 - 1561) + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b101101 + 0o102) + chr(49) + chr(0b110111) + '\065', 29188 - 29180), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1010100 + 0o33) + chr(0b101001 + 0o10) + '\060' + '\067', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b1001 + 0o51) + '\x37' + chr(0b11001 + 0o30), ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(111) + '\x32' + chr(0b100101 + 0o20) + '\067', 8), ehT0Px3KOsy9(chr(733 - 685) + chr(225 - 114) + chr(0b110001) + '\064' + '\x30', 0b1000), ehT0Px3KOsy9(chr(232 - 184) + chr(1828 - 1717) + chr(0b110001) + '\065' + chr(2515 - 2462), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(1866 - 1814) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(692 - 644) + chr(111) + chr(0b110111) + chr(50), 56645 - 56637), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(659 - 607) + '\x34', 39343 - 39335), ehT0Px3KOsy9(chr(48) + chr(0b1011001 + 0o26) + '\x34', 32108 - 32100), ehT0Px3KOsy9(chr(0b110000) + chr(5874 - 5763) + chr(1552 - 1502) + chr(0b101110 + 0o10) + chr(0b11101 + 0o30), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + chr(53) + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x05'), chr(0b1100100) + chr(6301 - 6200) + chr(99) + chr(0b1011001 + 0o26) + '\144' + chr(101))(chr(0b1110010 + 0o3) + '\164' + chr(0b100011 + 0o103) + '\x2d' + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def t264pveEyoOj(oVre8I6UXc3b, M8HTx_I8VoWH, bBC93MgSHzUB): fhKnsoQFJwfS = M8HTx_I8VoWH.get(xafqLlk3kkUe(SXOLrMavuUCe(b'o\x92\xa4\xc6\x074\xaa(\xf7&\xe6\xcc.\xbb'), chr(1998 - 1898) + '\145' + '\x63' + chr(0b0 + 0o157) + '\144' + chr(101))(chr(0b101010 + 0o113) + chr(116) + '\146' + '\055' + chr(0b111000))) if fhKnsoQFJwfS is None: return gJYAmrulne1a = bBC93MgSHzUB.get_runtime_attr(xafqLlk3kkUe(SXOLrMavuUCe(b'J\x85\xac'), '\x64' + chr(4707 - 4606) + chr(0b1100011) + chr(0b101011 + 0o104) + '\144' + chr(0b1100101))(chr(11013 - 10896) + chr(2891 - 2775) + '\x66' + '\055' + chr(0b1000 + 0o60))) OVBNb17g1bVT = CuA6J2AA1iJi.get_partition_name() jFJCWjIi12ys = ht4eALydAxe8(xafqLlk3kkUe(SXOLrMavuUCe(b'J\x85\xac\x95'), chr(100) + chr(0b11010 + 0o113) + '\143' + chr(0b100001 + 0o116) + chr(1588 - 1488) + '\x65')(chr(117) + chr(2551 - 2435) + chr(8405 - 8303) + '\x2d' + chr(1598 - 1542)) + OVBNb17g1bVT + xafqLlk3kkUe(SXOLrMavuUCe(b'\x11\x96\xb2\xc6\x0e<\xaa$\xef)\xdd\x99n\xb9\xb9\xe8\x93\xd5\x02;\x87\x88\xf2\x81\xb9\xc0\xca.\xcb\x10%\xdd\xceZ\x1d\x06N\x8c+\x87\x1b\xc6\xf7\x82Yn\xf3r\xa9g\xc2\xd6$\xa1\x8c\xd6\xaf\x81KF'), '\x64' + chr(101) + '\143' + chr(3493 - 3382) + chr(0b1000110 + 0o36) + '\x65')(chr(0b1011100 + 0o31) + chr(0b11 + 0o161) + chr(0b11 + 0o143) + '\055' + '\x38') + OYFoaBW6Rem8(gJYAmrulne1a) + xafqLlk3kkUe(SXOLrMavuUCe(b"\x04\x9e\xac\xd9\x06>\xbf5\xf1'\xca\xd0"), '\x64' + chr(0b1010001 + 0o24) + chr(99) + chr(111) + chr(100) + chr(9741 - 9640))(chr(2191 - 2074) + chr(116) + chr(7584 - 7482) + chr(45) + chr(0b10001 + 0o47))) QP6wN7VyBwGk = IX7SCU7eVrph(fhKnsoQFJwfS) if xafqLlk3kkUe(QP6wN7VyBwGk, xafqLlk3kkUe(SXOLrMavuUCe(b'C\x96\xb1\xf0\x003\xaa$\xff:\xc5\xd7#\xad\x96'), chr(100) + chr(0b1100101) + '\x63' + chr(111) + '\144' + chr(1134 - 1033))(chr(0b110011 + 0o102) + '\x74' + '\x66' + chr(0b100110 + 0o7) + chr(1928 - 1872)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'{\x96\xb6\xc7'), chr(100) + chr(4774 - 4673) + chr(9631 - 9532) + chr(0b1101111) + chr(1981 - 1881) + chr(3841 - 3740))('\x75' + chr(0b1011011 + 0o31) + chr(0b1100000 + 0o6) + '\055' + '\070')), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'M\x87\x8c\xff*+\x87\n\xd1;\x93\x93'), chr(5278 - 5178) + '\x65' + '\x63' + chr(0b1101111) + '\x64' + '\145')(chr(0b1110000 + 0o5) + chr(0b10 + 0o162) + chr(0b10011 + 0o123) + chr(45) + chr(0b111000)))): raise eXWqlSUlGxPF(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'Y\x92\xae\xce\x1d4\xa8$\xc7!\xc0'), chr(0b1100100) + chr(0b1011101 + 0o10) + chr(0b1010100 + 0o17) + chr(0b100000 + 0o117) + '\x64' + '\145')(chr(0b1001100 + 0o51) + '\x74' + chr(0b1010110 + 0o20) + chr(0b101101) + chr(0b11111 + 0o31))), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'j\xa7\x8b\x8f\x048\xaa)\xf7,\x84\x811\xaf\x9d\xcb\xa8\x80\\\x14\xc0\xcf\xff\x8b\xb1\xd4\x9e\'\xce]*\xcc\xc3\x14\x04\x17V\x81$\xc1B\x9a\xa7\xdcI;\xb13\xb88\xc5\xd7"\xe2\xda\xc4\xb0\x8eL\x01\x9f\xcd\xb5'), chr(0b101110 + 0o66) + '\145' + '\143' + '\x6f' + chr(100) + '\x65')(chr(9677 - 9560) + chr(116) + '\x66' + '\x2d' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'}\xc3\xb0\xc0!<\x8dr\xc88\xc1\xc9'), chr(6603 - 6503) + chr(0b1001 + 0o134) + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(0b110010 + 0o63))(chr(0b1110101) + chr(0b10011 + 0o141) + chr(102) + chr(0b10101 + 0o30) + '\x38'))(method=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'M\x87\x8c\xff*+\x87\n\xd1;\x93\x93'), chr(0b1010 + 0o132) + chr(0b111101 + 0o50) + chr(6543 - 6444) + chr(8128 - 8017) + chr(566 - 466) + chr(0b1100101))(chr(117) + '\164' + chr(0b110010 + 0o64) + chr(1138 - 1093) + '\x38')), path=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'{\x96\xb6\xc7'), chr(878 - 778) + chr(0b1100101) + chr(0b1001101 + 0o26) + chr(6341 - 6230) + '\144' + chr(209 - 108))('\165' + chr(0b1000101 + 0o57) + chr(102) + chr(0b101101) + '\070')))) z3jGhw6b9vwa = None if y7wKORCUVRd8 in xafqLlk3kkUe(bBC93MgSHzUB, xafqLlk3kkUe(SXOLrMavuUCe(b"S\xc0\xa6\xcb'\x02\xb5(\xad&\xe3\xcd"), chr(9172 - 9072) + chr(0b10101 + 0o120) + chr(0b1100011) + chr(111) + '\x64' + chr(7334 - 7233))('\x75' + chr(0b1110100) + chr(0b101110 + 0o70) + chr(0b101101) + '\x38')): z3jGhw6b9vwa = bBC93MgSHzUB.x7ddN_ki5nGn[y7wKORCUVRd8] xafqLlk3kkUe(QP6wN7VyBwGk, xafqLlk3kkUe(SXOLrMavuUCe(b'J\x93\xa6\xf0\x05<\xb3#\xfc)\xfb\xca$\xb6\x9d\xd8\xb2\x8eL\x00\x8d\x81'), chr(7633 - 7533) + '\x65' + chr(0b1010100 + 0o17) + chr(10713 - 10602) + chr(0b1011000 + 0o14) + chr(1295 - 1194))('\165' + '\x74' + '\x66' + '\055' + chr(0b111000)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'{\x96\xb6\xc7'), chr(9679 - 9579) + '\145' + chr(0b10110 + 0o115) + chr(3200 - 3089) + '\x64' + chr(0b100001 + 0o104))(chr(117) + chr(116) + chr(102) + chr(0b101101) + chr(0b10011 + 0o45))), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'M\x87\x8c\xff*+\x87\n\xd1;\x93\x93'), '\x64' + chr(0b1100101) + chr(0b100000 + 0o103) + chr(0b1101111) + '\144' + chr(0b100110 + 0o77))(chr(8327 - 8210) + '\x74' + chr(2581 - 2479) + chr(0b101101) + chr(2318 - 2262))), jFJCWjIi12ys, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x82\xb6\xc7'), chr(0b1100100) + '\x65' + chr(2876 - 2777) + '\x6f' + '\144' + '\145')(chr(117) + chr(0b1100 + 0o150) + chr(0b100011 + 0o103) + '\x2d' + chr(0b111000))), xafqLlk3kkUe(M8HTx_I8VoWH, xafqLlk3kkUe(SXOLrMavuUCe(b'L\x92\xb6'), chr(9376 - 9276) + '\x65' + chr(0b11010 + 0o111) + '\x6f' + chr(100) + chr(0b1010001 + 0o24))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(305 - 260) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'j\x82\xb6\xc7'), chr(100) + chr(101) + '\143' + '\x6f' + chr(0b1100100) + '\145')(chr(13478 - 13361) + chr(0b100111 + 0o115) + chr(102) + chr(0b101101) + chr(0b10110 + 0o42))), condition=z3jGhw6b9vwa) if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x82\xb6\xc7'), chr(100) + '\145' + chr(0b110011 + 0o60) + chr(0b1101111) + '\144' + chr(0b101011 + 0o72))(chr(0b111101 + 0o70) + chr(0b1100011 + 0o21) + chr(102) + chr(1744 - 1699) + '\070')): oiZuHrDlNRpP = oVre8I6UXc3b.Auth.get(xafqLlk3kkUe(SXOLrMavuUCe(b'j\x82\xb6\xc7\x06/\xb7;\xfd:'), chr(0b1100100) + chr(7902 - 7801) + '\x63' + chr(111) + '\144' + chr(101))('\x75' + chr(0b11111 + 0o125) + chr(102) + '\055' + '\070')) if oiZuHrDlNRpP: mEFsUOvnVq1u = M8HTx_I8VoWH.get(xafqLlk3kkUe(SXOLrMavuUCe(b'j\x82\xb6\xc7'), chr(8745 - 8645) + chr(101) + chr(0b11101 + 0o106) + chr(3418 - 3307) + chr(100) + '\x65')(chr(0b1011001 + 0o34) + chr(0b1011110 + 0o26) + chr(102) + '\055' + chr(0b10101 + 0o43))) _SaKDBQVILBB = mEFsUOvnVq1u and mEFsUOvnVq1u.get(xafqLlk3kkUe(SXOLrMavuUCe(b'j\x82\xb6\xc7\x06/\xb7;\xfd:\xd7'), chr(100) + chr(0b111000 + 0o55) + '\x63' + chr(111) + chr(100) + '\x65')('\x75' + chr(666 - 550) + '\146' + chr(45) + chr(2750 - 2694))) if oiZuHrDlNRpP != xafqLlk3kkUe(SXOLrMavuUCe(b'j\xa0\x91\xf0 \x1c\x93'), chr(100) + chr(101) + chr(99) + '\157' + chr(100) + '\x65')('\165' + chr(116) + '\x66' + '\055' + chr(56)): if not _SaKDBQVILBB: raise eXWqlSUlGxPF(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'Y\x92\xae\xce\x1d4\xa8$\xc7!\xc0'), chr(0b1100100) + '\x65' + '\x63' + '\157' + chr(0b1000010 + 0o42) + chr(0b1100101))(chr(5657 - 5540) + '\164' + '\146' + chr(1123 - 1078) + chr(0b110010 + 0o6))), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'~\x99\xa3\xcd\x058\xfe5\xf7h\xd7\xc6>\xe2\xb9\xca\xb4\x87W\x1b\x8b\x95\xfe\x9c\xf7\xe6\x8b#\xdf\t/\xd6\xdd\t\x17\x02H\x99Y\x95D\x99\xe2\xee9\x14\xfe,\xfd<\xcc\xcc.\xe2\xa3\xc4\xad\x8aL\x01\x8d\x8b\xe6\xb3\xf7\xdb\x9f0\x8a\r&\xcd\xc7@6\x1cJ\x85p\xddV\xaa\xe2\xcd\x0c>\xbf4\xeb-\x84\xd7"\xa7\xd8\xcd\xa5\x83Y\x1d\x87\x8b\xbb\xaf\x87\xf4\xd0&\xc5\x184\x99\xc1\x0f\x19G^\x81b\xdcE\x92\xe2\xce\x07$\xfe\x00\xed<\xcc\xcc8\xab\x82\xda\xb2\x9c\x16'), chr(1948 - 1848) + '\x65' + chr(0b1100001 + 0o2) + chr(4468 - 4357) + '\144' + chr(0b1100101))(chr(0b1110101) + '\164' + chr(102) + chr(0b101101) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'}\xc3\xb0\xc0!<\x8dr\xc88\xc1\xc9'), chr(0b1100100) + '\x65' + chr(3881 - 3782) + '\157' + chr(100) + chr(5403 - 5302))(chr(0b101101 + 0o110) + '\164' + chr(8681 - 8579) + chr(0b101101) + chr(0b111000)))(authorizer=oiZuHrDlNRpP, method=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'M\x87\x8c\xff*+\x87\n\xd1;\x93\x93'), chr(0b101000 + 0o74) + chr(0b1100101) + '\143' + chr(5919 - 5808) + '\x64' + '\x65')(chr(117) + chr(0b111111 + 0o65) + chr(9981 - 9879) + '\x2d' + chr(56))), path=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'{\x96\xb6\xc7'), chr(6274 - 6174) + chr(3132 - 3031) + '\143' + chr(0b111111 + 0o60) + '\x64' + chr(763 - 662))(chr(0b1011100 + 0o31) + chr(5338 - 5222) + chr(102) + chr(0b11101 + 0o20) + chr(2340 - 2284))))) if oiZuHrDlNRpP != xafqLlk3kkUe(SXOLrMavuUCe(b'e\xb8\x8c\xea'), '\144' + '\145' + '\143' + chr(111) + chr(558 - 458) + chr(0b1100101))(chr(117) + '\x74' + '\x66' + chr(0b1000 + 0o45) + chr(0b11000 + 0o40)) and (not xafqLlk3kkUe(_SaKDBQVILBB, xafqLlk3kkUe(SXOLrMavuUCe(b'L\x92\xb6'), '\x64' + chr(0b1100101) + chr(513 - 414) + '\157' + chr(0b110111 + 0o55) + chr(0b1011 + 0o132))('\x75' + '\x74' + '\146' + chr(0b11101 + 0o20) + chr(56)))(oiZuHrDlNRpP)): raise eXWqlSUlGxPF(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'Y\x92\xae\xce\x1d4\xa8$\xc7!\xc0'), chr(0b1100000 + 0o4) + '\x65' + chr(0b11100 + 0o107) + chr(0b1000011 + 0o54) + chr(0b1100100) + chr(0b1100101))(chr(0b100 + 0o161) + chr(0b1110100) + '\x66' + '\055' + chr(0b11010 + 0o36))), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'~\x99\xa3\xcd\x058\xfe5\xf7h\xd7\xc6>\xe2\xb9\xca\xb4\x87W\x1b\x8b\x95\xfe\x9c\xf7\xe6\x8b#\xdf\t/\xd6\xdd\t\x17\x02H\x99Y\x95D\x99\xe2\xee9\x14\xfe,\xfd<\xcc\xcc.\xe2\xa3\xc4\xad\x8aL\x01\x8d\x8b\xe6\xb3\xf7\xdb\x9f0\x8a\r&\xcd\xc7@6\x1cJ\x85p\xddV\xaa\xe2\xcd\x0c>\xbf4\xeb-\x84\xca>\xe2\x8f\xde\xb3\x81\x1f\x1d\xc2\x8b\xfe\x88\xbe\xd3\x95&\x8a\x14)\x99\xdb\x08\x08G{\xb4M\x92X\xd7\x83\xda\x1d5\xb13\xf12\xc1\xd19\xec'), chr(0b1100100) + '\x65' + chr(0b100010 + 0o101) + chr(111) + chr(0b1011001 + 0o13) + chr(101))(chr(0b1100001 + 0o24) + chr(0b1110100) + chr(4507 - 4405) + chr(0b1000 + 0o45) + chr(3110 - 3054)), xafqLlk3kkUe(SXOLrMavuUCe(b'}\xc3\xb0\xc0!<\x8dr\xc88\xc1\xc9'), '\144' + '\145' + chr(9289 - 9190) + '\x6f' + '\144' + chr(0b1100101 + 0o0))('\x75' + chr(116) + chr(0b100110 + 0o100) + chr(45) + chr(0b101101 + 0o13)))(authorizer=oiZuHrDlNRpP, method=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'M\x87\x8c\xff*+\x87\n\xd1;\x93\x93'), '\x64' + '\145' + '\x63' + chr(111) + chr(0b1100100) + '\145')(chr(9465 - 9348) + '\164' + '\x66' + '\055' + chr(0b1000 + 0o60))), path=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'{\x96\xb6\xc7'), '\144' + '\145' + chr(7542 - 7443) + chr(111) + chr(5840 - 5740) + '\x65')('\165' + '\164' + chr(6778 - 6676) + chr(337 - 292) + chr(2157 - 2101))))) if oiZuHrDlNRpP == xafqLlk3kkUe(SXOLrMavuUCe(b'e\xb8\x8c\xea'), chr(100) + chr(101) + '\143' + '\x6f' + chr(100) + chr(0b1100101))(chr(10395 - 10278) + chr(0b1110100) + chr(102) + chr(45) + chr(0b1100 + 0o54)) and (not xafqLlk3kkUe(mEFsUOvnVq1u, xafqLlk3kkUe(SXOLrMavuUCe(b'L\x92\xb6'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1001110 + 0o41) + chr(100) + chr(0b1011000 + 0o15))(chr(4985 - 4868) + chr(116) + chr(102) + '\x2d' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'o\x92\xa4\xce\x1c1\xaa\x00\xed<\xcc\xcc8\xab\x82\xda\xb2'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(0b101110 + 0o101) + '\x64' + chr(101))(chr(8620 - 8503) + '\x74' + '\x66' + chr(357 - 312) + chr(0b1100 + 0o54)))): raise eXWqlSUlGxPF(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'Y\x92\xae\xce\x1d4\xa8$\xc7!\xc0'), chr(0b1100100) + chr(0b110001 + 0o64) + chr(0b111101 + 0o46) + '\157' + '\x64' + '\145')(chr(6153 - 6036) + chr(116) + '\146' + '\x2d' + chr(0b111000))), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"~\x99\xa3\xcd\x058\xfe5\xf7h\xd7\xc6>\xe2\xb9\xca\xb4\x87W\x1b\x8b\x95\xfe\x9c\xf7\xd2\x9eb\xeb-\x0e\x99\xc2\x05\x19\x0fU\x80$\xeeP\x9a\xa7\xdb\x012\xba<\xc5h\xc2\xcc8\xe2\x88\xde\xb4\x87\x182\x99\x9f\xfa\x9a\xbf\xc0\xadb\xc8\x18$\xd8\xda\x13\x08G\x1d\xaaK\xfbn\xd0\xe2\xc6\x1a}\xb1/\xf41\x84\xc2j\xb4\x99\xd3\xa9\x8b\x18\x1f\x83\x83\xee\x8b\xf7\xca\x98'\xc4]&\x99\xeb\x05\x0b\x06O\x88p\xf4^\x83\xaa\xc0\x1b4\xa4$\xeah\xcb\xcdj\xb6\x90\xda\xe0\xaeh \xc2\x86\xe8\xce\xa4\xcd\x95!\xc3\x1b.\xdc\xcbN"), chr(0b1010 + 0o132) + '\145' + chr(99) + chr(6882 - 6771) + '\x64' + '\145')(chr(12168 - 12051) + chr(0b1110100) + chr(0b1100110) + chr(0b1001 + 0o44) + chr(2789 - 2733)), xafqLlk3kkUe(SXOLrMavuUCe(b'}\xc3\xb0\xc0!<\x8dr\xc88\xc1\xc9'), chr(0b1100100) + chr(0b1001100 + 0o31) + '\x63' + chr(111) + chr(0b1100100) + chr(0b1100101))(chr(117) + '\x74' + chr(0b10000 + 0o126) + chr(0b101101) + chr(0b111000)))(method=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'M\x87\x8c\xff*+\x87\n\xd1;\x93\x93'), '\x64' + chr(0b1010110 + 0o17) + chr(6457 - 6358) + '\157' + chr(0b1100100) + chr(2268 - 2167))(chr(0b1100101 + 0o20) + chr(0b1110100) + chr(0b110001 + 0o65) + '\055' + chr(3012 - 2956))), path=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'{\x96\xb6\xc7'), chr(100) + chr(0b111100 + 0o51) + chr(0b1100011) + chr(11020 - 10909) + chr(9754 - 9654) + '\145')('\165' + '\164' + chr(102) + '\x2d' + chr(0b101011 + 0o15))))) xafqLlk3kkUe(QP6wN7VyBwGk, xafqLlk3kkUe(SXOLrMavuUCe(b"J\x93\xa6\xf0\x08(\xaa)\xc7<\xcb\xfc'\xa7\x8c\xd7\xaf\x8b"), chr(0b1100100) + '\145' + chr(99) + chr(111) + '\144' + chr(9259 - 9158))('\x75' + chr(0b1001 + 0o153) + chr(0b1100110) + '\055' + chr(524 - 468)))(api=M8HTx_I8VoWH, path=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'{\x96\xb6\xc7'), '\x64' + chr(8837 - 8736) + chr(0b1100011) + '\x6f' + '\144' + chr(101))('\x75' + chr(116) + chr(102) + chr(0b101101) + chr(56))), method_name=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'M\x87\x8c\xff*+\x87\n\xd1;\x93\x93'), '\144' + chr(631 - 530) + chr(6049 - 5950) + '\157' + chr(100) + chr(0b1100101))(chr(0b1110101) + '\x74' + '\x66' + '\055' + '\x38')), auth=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x82\xb6\xc7'), '\x64' + chr(826 - 725) + '\x63' + '\157' + chr(0b100100 + 0o100) + chr(0b101010 + 0o73))('\165' + '\164' + chr(9898 - 9796) + '\055' + chr(0b111000)))) M8HTx_I8VoWH[xafqLlk3kkUe(SXOLrMavuUCe(b'o\x92\xa4\xc6\x074\xaa(\xf7&\xe6\xcc.\xbb'), chr(507 - 407) + chr(0b1100101) + chr(99) + chr(0b100 + 0o153) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(7138 - 7022) + chr(102) + '\055' + '\x38')] = QP6wN7VyBwGk.swagger
awslabs/serverless-application-model
samtranslator/intrinsics/resolver.py
IntrinsicsResolver.resolve_parameter_refs
def resolve_parameter_refs(self, input): """ Resolves references to parameters within the given dictionary recursively. Other intrinsic functions such as !GetAtt, !Sub or !Ref to non-parameters will be left untouched. Result is a dictionary where parameter values are inlined. Don't pass this dictionary directly into transform's output because it changes the template structure by inlining parameter values. :param input: Any primitive type (dict, array, string etc) whose values might contain intrinsic functions :return: A copy of a dictionary with parameter references replaced by actual value. """ return self._traverse(input, self.parameters, self._try_resolve_parameter_refs)
python
def resolve_parameter_refs(self, input): """ Resolves references to parameters within the given dictionary recursively. Other intrinsic functions such as !GetAtt, !Sub or !Ref to non-parameters will be left untouched. Result is a dictionary where parameter values are inlined. Don't pass this dictionary directly into transform's output because it changes the template structure by inlining parameter values. :param input: Any primitive type (dict, array, string etc) whose values might contain intrinsic functions :return: A copy of a dictionary with parameter references replaced by actual value. """ return self._traverse(input, self.parameters, self._try_resolve_parameter_refs)
[ "def", "resolve_parameter_refs", "(", "self", ",", "input", ")", ":", "return", "self", ".", "_traverse", "(", "input", ",", "self", ".", "parameters", ",", "self", ".", "_try_resolve_parameter_refs", ")" ]
Resolves references to parameters within the given dictionary recursively. Other intrinsic functions such as !GetAtt, !Sub or !Ref to non-parameters will be left untouched. Result is a dictionary where parameter values are inlined. Don't pass this dictionary directly into transform's output because it changes the template structure by inlining parameter values. :param input: Any primitive type (dict, array, string etc) whose values might contain intrinsic functions :return: A copy of a dictionary with parameter references replaced by actual value.
[ "Resolves", "references", "to", "parameters", "within", "the", "given", "dictionary", "recursively", ".", "Other", "intrinsic", "functions", "such", "as", "!GetAtt", "!Sub", "or", "!Ref", "to", "non", "-", "parameters", "will", "be", "left", "untouched", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/resolver.py#L30-L41
train
Resolves references to parameters within the given dictionary recursively.
Pu7Z6IJCgH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KLA6,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(50) + chr(0b110011) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + chr(0b100010 + 0o17) + '\061' + chr(0b100001 + 0o25), ord("\x08")), ehT0Px3KOsy9(chr(1773 - 1725) + chr(0b1010 + 0o145) + chr(49) + chr(1786 - 1737) + '\x35', 64405 - 64397), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(0b110010) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b111101 + 0o62) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x36' + chr(647 - 599), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(334 - 284) + chr(2092 - 2041) + chr(49), 14452 - 14444), ehT0Px3KOsy9(chr(48) + chr(0b10 + 0o155) + chr(0b110010) + chr(0b1 + 0o62) + chr(600 - 550), 38021 - 38013), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\x6f' + chr(0b110011) + chr(2290 - 2242) + '\067', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(51) + '\x30', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\064' + '\061', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(0b10100 + 0o40) + chr(0b11111 + 0o23), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10100 + 0o36) + chr(0b10100 + 0o40) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1041 - 930) + '\061' + chr(0b110100) + chr(0b1 + 0o65), 61869 - 61861), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b111 + 0o52) + '\x30' + chr(2358 - 2304), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(1385 - 1335) + chr(0b100 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(417 - 369) + '\x6f' + chr(53) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(1771 - 1716) + chr(0b101000 + 0o17), 0b1000), ehT0Px3KOsy9(chr(1818 - 1770) + chr(0b1101111) + '\061' + '\x34' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101111) + chr(0b11001 + 0o31) + chr(0b10 + 0o62) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + chr(52) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + chr(48), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + '\x36' + '\x34', 22152 - 22144), ehT0Px3KOsy9(chr(1228 - 1180) + chr(10453 - 10342) + '\x33' + '\062' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101001 + 0o6) + '\066' + chr(0b100001 + 0o20), 0o10), ehT0Px3KOsy9('\060' + chr(11434 - 11323) + chr(49) + chr(54), 48315 - 48307), ehT0Px3KOsy9(chr(48) + chr(0b111100 + 0o63) + '\062' + '\x34' + chr(49), 27955 - 27947), ehT0Px3KOsy9(chr(48) + chr(0b1100111 + 0o10) + chr(0b110001) + chr(0b110001) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(9073 - 8962) + chr(0b10100 + 0o37) + chr(0b101101 + 0o3) + chr(0b110101 + 0o0), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100 + 0o55) + '\x37' + chr(0b10 + 0o63), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(6262 - 6151) + '\x36' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1011101 + 0o22) + chr(0b11101 + 0o26) + '\066' + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b111110 + 0o61) + chr(0b110110) + '\067', 45549 - 45541), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(0b1001 + 0o47) + '\064', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(0b101100 + 0o10) + '\066', 8), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + '\062' + chr(48) + chr(0b10100 + 0o37), 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + '\x33' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\x6f' + '\x33' + '\x37' + chr(0b110110 + 0o1), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + chr(0b11111 + 0o30) + chr(313 - 260), 28407 - 28399), ehT0Px3KOsy9(chr(109 - 61) + chr(0b1000011 + 0o54) + chr(50) + '\066' + '\062', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(53) + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1'), '\x64' + chr(0b1100101) + chr(4694 - 4595) + chr(0b10100 + 0o133) + chr(100) + chr(0b1100101))('\165' + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b101010 + 0o16)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Khlw9Xworg_f(oVre8I6UXc3b, Y3jVKaC8LEDU): return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0:?\xf1vU\xeb\xe9\xa2'), chr(100) + chr(0b1010010 + 0o23) + chr(5293 - 5194) + '\x6f' + chr(0b1100100) + chr(7774 - 7673))(chr(0b1110010 + 0o3) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b111000 + 0o0)))(Y3jVKaC8LEDU, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xef/?\xf1mU\xed\xff\xb5\xab'), '\x64' + '\145' + chr(99) + '\x6f' + chr(0b10001 + 0o123) + chr(101))(chr(0b1000101 + 0o60) + '\x74' + '\146' + '\055' + chr(1393 - 1337))), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b"\xc0:?\xe9_B\xfc\xe9\xa8\xb4W\x87\xf8\x16'aH\xd2\x01\xd0Aj+\xa2Th\xd2"), chr(0b101100 + 0o70) + '\x65' + chr(4392 - 4293) + '\157' + chr(100) + chr(5886 - 5785))(chr(117) + chr(0b1110100) + chr(102) + chr(1246 - 1201) + '\x38')))
awslabs/serverless-application-model
samtranslator/intrinsics/resolver.py
IntrinsicsResolver.resolve_sam_resource_refs
def resolve_sam_resource_refs(self, input, supported_resource_refs): """ Customers can provide a reference to a "derived" SAM resource such as Alias of a Function or Stage of an API resource. This method recursively walks the tree, converting all derived references to the real resource name, if it is present. Example: {"Ref": "MyFunction.Alias"} -> {"Ref": "MyFunctionAliasLive"} This method does not attempt to validate a reference. If it is invalid or non-resolvable, it skips the occurrence and continues with the rest. It is recommended that you have an external process that detects and surfaces invalid references. For first call, it is recommended that `template` is the entire CFN template in order to handle references in Mapping or Output sections. :param dict input: CFN template that needs resolution. This method will modify the input directly resolving references. In subsequent recursions, this will be a fragment of the CFN template. :param SupportedResourceReferences supported_resource_refs: Object that contains information about the resource references supported in this SAM template, along with the value they should resolve to. :return list errors: List of dictionary containing information about invalid reference. Empty list otherwise """ return self._traverse(input, supported_resource_refs, self._try_resolve_sam_resource_refs)
python
def resolve_sam_resource_refs(self, input, supported_resource_refs): """ Customers can provide a reference to a "derived" SAM resource such as Alias of a Function or Stage of an API resource. This method recursively walks the tree, converting all derived references to the real resource name, if it is present. Example: {"Ref": "MyFunction.Alias"} -> {"Ref": "MyFunctionAliasLive"} This method does not attempt to validate a reference. If it is invalid or non-resolvable, it skips the occurrence and continues with the rest. It is recommended that you have an external process that detects and surfaces invalid references. For first call, it is recommended that `template` is the entire CFN template in order to handle references in Mapping or Output sections. :param dict input: CFN template that needs resolution. This method will modify the input directly resolving references. In subsequent recursions, this will be a fragment of the CFN template. :param SupportedResourceReferences supported_resource_refs: Object that contains information about the resource references supported in this SAM template, along with the value they should resolve to. :return list errors: List of dictionary containing information about invalid reference. Empty list otherwise """ return self._traverse(input, supported_resource_refs, self._try_resolve_sam_resource_refs)
[ "def", "resolve_sam_resource_refs", "(", "self", ",", "input", ",", "supported_resource_refs", ")", ":", "return", "self", ".", "_traverse", "(", "input", ",", "supported_resource_refs", ",", "self", ".", "_try_resolve_sam_resource_refs", ")" ]
Customers can provide a reference to a "derived" SAM resource such as Alias of a Function or Stage of an API resource. This method recursively walks the tree, converting all derived references to the real resource name, if it is present. Example: {"Ref": "MyFunction.Alias"} -> {"Ref": "MyFunctionAliasLive"} This method does not attempt to validate a reference. If it is invalid or non-resolvable, it skips the occurrence and continues with the rest. It is recommended that you have an external process that detects and surfaces invalid references. For first call, it is recommended that `template` is the entire CFN template in order to handle references in Mapping or Output sections. :param dict input: CFN template that needs resolution. This method will modify the input directly resolving references. In subsequent recursions, this will be a fragment of the CFN template. :param SupportedResourceReferences supported_resource_refs: Object that contains information about the resource references supported in this SAM template, along with the value they should resolve to. :return list errors: List of dictionary containing information about invalid reference. Empty list otherwise
[ "Customers", "can", "provide", "a", "reference", "to", "a", "derived", "SAM", "resource", "such", "as", "Alias", "of", "a", "Function", "or", "Stage", "of", "an", "API", "resource", ".", "This", "method", "recursively", "walks", "the", "tree", "converting", "all", "derived", "references", "to", "the", "real", "resource", "name", "if", "it", "is", "present", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/resolver.py#L43-L65
train
This method will recursively resolve all derived references to real resource names and return a list of errors.
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(1433 - 1385) + chr(0b1011101 + 0o22) + chr(0b100110 + 0o14) + chr(52) + '\x37', 45490 - 45482), ehT0Px3KOsy9('\060' + chr(9420 - 9309) + '\x33' + chr(0b11111 + 0o24) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(1302 - 1249) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7701 - 7590) + chr(0b10111 + 0o32) + chr(0b100 + 0o54), 0o10), ehT0Px3KOsy9('\x30' + chr(6148 - 6037) + '\062' + '\066' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b110 + 0o151) + chr(0b110001) + '\x31' + chr(1413 - 1361), ord("\x08")), ehT0Px3KOsy9(chr(1904 - 1856) + chr(0b1100101 + 0o12) + chr(1941 - 1892) + chr(1884 - 1835) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b111010 + 0o65) + chr(133 - 79) + chr(0b11101 + 0o27), 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + chr(1151 - 1101) + '\061' + chr(0b1110 + 0o45), 4305 - 4297), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11101 + 0o25) + chr(2167 - 2115) + chr(0b110100 + 0o1), 0o10), ehT0Px3KOsy9('\060' + chr(5836 - 5725) + chr(0b11001 + 0o30) + '\060' + '\x36', 0b1000), ehT0Px3KOsy9(chr(480 - 432) + chr(0b1000000 + 0o57) + chr(0b10101 + 0o34) + chr(2000 - 1950) + chr(517 - 465), 0b1000), ehT0Px3KOsy9('\x30' + chr(9249 - 9138) + chr(0b110011) + '\x33' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1010110 + 0o31) + chr(51) + '\x30' + chr(0b1 + 0o62), 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(111) + chr(2387 - 2336) + chr(0b110000) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11111 + 0o30) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + '\062' + chr(0b11100 + 0o32), ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b1001011 + 0o44) + chr(2161 - 2110) + '\x32' + chr(0b110001), 15568 - 15560), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x35' + chr(1274 - 1222), 23037 - 23029), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(0b110100), 10425 - 10417), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + '\063' + chr(48) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(0b101010 + 0o10), 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + chr(863 - 814) + chr(0b110111) + chr(0b110110), 12640 - 12632), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(328 - 277) + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(1310 - 1255), 0o10), ehT0Px3KOsy9(chr(608 - 560) + '\x6f' + '\x32' + '\x33' + chr(1123 - 1070), 0b1000), ehT0Px3KOsy9(chr(685 - 637) + chr(0b1101111) + chr(0b1001 + 0o53) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101011 + 0o7) + chr(49) + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010 + 0o1) + chr(53) + chr(498 - 450), 0o10), ehT0Px3KOsy9(chr(1008 - 960) + chr(111) + chr(2235 - 2185) + '\x36', 41664 - 41656), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(0b100101 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(1817 - 1769) + chr(0b1101111) + chr(1809 - 1760), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + '\x33' + chr(0b110111), 10247 - 10239), ehT0Px3KOsy9(chr(1508 - 1460) + chr(566 - 455) + chr(0b110001) + chr(54) + '\063', 0o10), ehT0Px3KOsy9(chr(48) + chr(1934 - 1823) + chr(1820 - 1767) + chr(689 - 634), 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + chr(0b100100 + 0o17) + '\065', 0o10), ehT0Px3KOsy9(chr(2120 - 2072) + chr(0b1101111) + '\061' + chr(50) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + '\066' + '\x36', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10101 + 0o40) + chr(0b1111 + 0o41), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x89'), chr(100) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(2730 - 2630) + chr(101))(chr(117) + '\x74' + chr(8115 - 8013) + '\x2d' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def D9WaTaU5hRlC(oVre8I6UXc3b, Y3jVKaC8LEDU, KvSmPUitKt7D): return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\xae\x9e`~\xd4>=Q'), '\x64' + chr(0b1100101) + chr(7151 - 7052) + chr(5095 - 4984) + chr(0b1100100) + chr(101))(chr(117) + chr(0b1101001 + 0o13) + '\x66' + chr(1681 - 1636) + chr(0b1111 + 0o51)))(Y3jVKaC8LEDU, KvSmPUitKt7D, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\xae\x9exW\xc3)=[\xe7\xd3#\x0b\xab\xa2\xaa`$\xb4_c\xb5uy\x1b\x83}\xf8A\xfa'), '\144' + chr(101) + '\x63' + chr(11342 - 11231) + '\144' + chr(0b1000100 + 0o41))(chr(0b1110101) + '\x74' + '\x66' + chr(0b101101) + '\x38')))
awslabs/serverless-application-model
samtranslator/intrinsics/resolver.py
IntrinsicsResolver.resolve_sam_resource_id_refs
def resolve_sam_resource_id_refs(self, input, supported_resource_id_refs): """ Some SAM resources have their logical ids mutated from the original id that the customer writes in the template. This method recursively walks the tree and updates these logical ids from the old value to the new value that is generated by SAM. Example: {"Ref": "MyLayer"} -> {"Ref": "MyLayerABC123"} This method does not attempt to validate a reference. If it is invalid or non-resolvable, it skips the occurrence and continues with the rest. It is recommended that you have an external process that detects and surfaces invalid references. For first call, it is recommended that `template` is the entire CFN template in order to handle references in Mapping or Output sections. :param dict input: CFN template that needs resolution. This method will modify the input directly resolving references. In subsequent recursions, this will be a fragment of the CFN template. :param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones. :return list errors: List of dictionary containing information about invalid reference. Empty list otherwise """ return self._traverse(input, supported_resource_id_refs, self._try_resolve_sam_resource_id_refs)
python
def resolve_sam_resource_id_refs(self, input, supported_resource_id_refs): """ Some SAM resources have their logical ids mutated from the original id that the customer writes in the template. This method recursively walks the tree and updates these logical ids from the old value to the new value that is generated by SAM. Example: {"Ref": "MyLayer"} -> {"Ref": "MyLayerABC123"} This method does not attempt to validate a reference. If it is invalid or non-resolvable, it skips the occurrence and continues with the rest. It is recommended that you have an external process that detects and surfaces invalid references. For first call, it is recommended that `template` is the entire CFN template in order to handle references in Mapping or Output sections. :param dict input: CFN template that needs resolution. This method will modify the input directly resolving references. In subsequent recursions, this will be a fragment of the CFN template. :param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones. :return list errors: List of dictionary containing information about invalid reference. Empty list otherwise """ return self._traverse(input, supported_resource_id_refs, self._try_resolve_sam_resource_id_refs)
[ "def", "resolve_sam_resource_id_refs", "(", "self", ",", "input", ",", "supported_resource_id_refs", ")", ":", "return", "self", ".", "_traverse", "(", "input", ",", "supported_resource_id_refs", ",", "self", ".", "_try_resolve_sam_resource_id_refs", ")" ]
Some SAM resources have their logical ids mutated from the original id that the customer writes in the template. This method recursively walks the tree and updates these logical ids from the old value to the new value that is generated by SAM. Example: {"Ref": "MyLayer"} -> {"Ref": "MyLayerABC123"} This method does not attempt to validate a reference. If it is invalid or non-resolvable, it skips the occurrence and continues with the rest. It is recommended that you have an external process that detects and surfaces invalid references. For first call, it is recommended that `template` is the entire CFN template in order to handle references in Mapping or Output sections. :param dict input: CFN template that needs resolution. This method will modify the input directly resolving references. In subsequent recursions, this will be a fragment of the CFN template. :param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones. :return list errors: List of dictionary containing information about invalid reference. Empty list otherwise
[ "Some", "SAM", "resources", "have", "their", "logical", "ids", "mutated", "from", "the", "original", "id", "that", "the", "customer", "writes", "in", "the", "template", ".", "This", "method", "recursively", "walks", "the", "tree", "and", "updates", "these", "logical", "ids", "from", "the", "old", "value", "to", "the", "new", "value", "that", "is", "generated", "by", "SAM", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/resolver.py#L67-L88
train
This method will traverse the tree and resolve any references that are not supported by the SAM.
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,yDcnbVVBZ5V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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' + '\067' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(0b101000 + 0o17), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11000 + 0o127) + chr(0b11101 + 0o24) + chr(0b110001) + chr(191 - 143), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1 + 0o62) + chr(656 - 605) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(111) + '\065' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(1570 - 1522) + chr(4857 - 4746) + chr(51) + chr(0b110001) + chr(1202 - 1149), 20187 - 20179), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1011100 + 0o23) + '\063' + chr(0b100101 + 0o13) + '\x35', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100011 + 0o20) + '\062' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b110110 + 0o71) + chr(49) + chr(52) + chr(49), 56317 - 56309), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(0b10010 + 0o135) + chr(0b100111 + 0o14) + chr(727 - 677) + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(0b101011 + 0o11) + chr(82 - 28), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110111) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\067' + chr(0b100 + 0o61), ord("\x08")), ehT0Px3KOsy9('\060' + chr(3316 - 3205) + chr(51) + chr(50) + '\x32', 0o10), ehT0Px3KOsy9('\060' + chr(3527 - 3416) + chr(50) + chr(1446 - 1396) + chr(0b110111), 26835 - 26827), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(0b11010 + 0o34) + chr(0b101 + 0o55), 0b1000), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(2535 - 2424) + '\062' + chr(0b100111 + 0o14) + '\x31', 0o10), ehT0Px3KOsy9(chr(856 - 808) + chr(0b1101111) + '\061' + chr(0b110011) + chr(0b100000 + 0o23), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(55) + chr(177 - 129), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1010111 + 0o30) + chr(0b100100 + 0o22) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + chr(10375 - 10264) + chr(0b1011 + 0o46) + chr(0b110001) + '\060', 8), ehT0Px3KOsy9('\060' + chr(0b101000 + 0o107) + '\061' + '\x31' + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1010100 + 0o33) + '\x34' + '\x34', 50973 - 50965), ehT0Px3KOsy9(chr(321 - 273) + chr(6944 - 6833) + chr(0b10111 + 0o34) + '\x35' + chr(54), 0o10), ehT0Px3KOsy9('\060' + chr(0b1000100 + 0o53) + '\062' + chr(49) + chr(1633 - 1580), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b10011 + 0o134) + chr(0b110001) + '\064', 0o10), ehT0Px3KOsy9(chr(1782 - 1734) + chr(0b1101111) + chr(183 - 132) + chr(54) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(541 - 493) + chr(111) + '\061' + chr(0b10100 + 0o36) + chr(48), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1001110 + 0o41) + chr(0b100001 + 0o20) + chr(0b110100) + chr(49), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b11101 + 0o25) + chr(717 - 668) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(48) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b10011 + 0o134) + chr(0b110001) + '\x36' + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(1490 - 1439) + chr(0b11111 + 0o26), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b10101 + 0o132) + '\061' + chr(0b110111) + chr(0b1100 + 0o44), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(1504 - 1455) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b100010 + 0o16), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(468 - 418) + chr(0b110011) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + chr(51) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(1298 - 1250) + '\x36', 64620 - 64612)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b111 + 0o56) + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x15'), chr(100) + chr(0b1100101) + chr(0b0 + 0o143) + chr(0b1101111) + chr(0b1100100) + chr(2125 - 2024))(chr(12695 - 12578) + '\x74' + chr(3472 - 3370) + chr(0b11010 + 0o23) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ob8pYLJwJX11(oVre8I6UXc3b, Y3jVKaC8LEDU, Xwr_NWMclJnm): return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'dk:\xbd\\\xa8\xb7\xa7\x04'), '\x64' + '\x65' + chr(5635 - 5536) + chr(111) + chr(0b11111 + 0o105) + chr(3516 - 3415))(chr(0b1110101) + '\x74' + chr(0b1100110) + '\x2d' + chr(0b111000)))(Y3jVKaC8LEDU, Xwr_NWMclJnm, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'dk:\xa5u\xbf\xa0\xa7\x0en\xa3\xc3aN\xb3\xfa\xad\xeb>\x8b\\=>G\x8b\xd2e\x90\x0f\x13\xec\xa5\x02'), chr(0b10111 + 0o115) + '\x65' + '\x63' + chr(0b1101111) + chr(100) + chr(6571 - 6470))('\x75' + '\164' + chr(7054 - 6952) + chr(1683 - 1638) + '\x38')))
awslabs/serverless-application-model
samtranslator/intrinsics/resolver.py
IntrinsicsResolver._traverse
def _traverse(self, input, resolution_data, resolver_method): """ Driver method that performs the actual traversal of input and calls the appropriate `resolver_method` when to perform the resolution. :param input: Any primitive type (dict, array, string etc) whose value might contain an intrinsic function :param resolution_data: Data that will help with resolution. For example, when resolving parameter references, this object will contain a dictionary of parameter names and their values. :param resolver_method: Method that will be called to actually resolve an intrinsic function. This method is called with the parameters `(input, resolution_data)`. :return: Modified `input` with intrinsics resolved """ # There is data to help with resolution. Skip the traversal altogether if len(resolution_data) == 0: return input # # Traversal Algorithm: # # Imagine the input dictionary/list as a tree. We are doing a Pre-Order tree traversal here where we first # process the root node before going to its children. Dict and Lists are the only two iterable nodes. # Everything else is a leaf node. # # We do a Pre-Order traversal to handle the case where `input` contains intrinsic function as its only child # ie. input = {"Ref": "foo}. # # We will try to resolve the intrinsics if we can, otherwise return the original input. In some cases, resolving # an intrinsic will result in a terminal state ie. {"Ref": "foo"} could resolve to a string "bar". In other # cases, resolving intrinsics is only partial and we might need to continue traversing the tree (ex: Fn::Sub) # to handle nested intrinsics. All of these cases lend well towards a Pre-Order traversal where we try and # process the intrinsic, which results in a modified sub-tree to traverse. # input = resolver_method(input, resolution_data) if isinstance(input, dict): return self._traverse_dict(input, resolution_data, resolver_method) elif isinstance(input, list): return self._traverse_list(input, resolution_data, resolver_method) else: # We can iterate only over dict or list types. Primitive types are terminals return input
python
def _traverse(self, input, resolution_data, resolver_method): """ Driver method that performs the actual traversal of input and calls the appropriate `resolver_method` when to perform the resolution. :param input: Any primitive type (dict, array, string etc) whose value might contain an intrinsic function :param resolution_data: Data that will help with resolution. For example, when resolving parameter references, this object will contain a dictionary of parameter names and their values. :param resolver_method: Method that will be called to actually resolve an intrinsic function. This method is called with the parameters `(input, resolution_data)`. :return: Modified `input` with intrinsics resolved """ # There is data to help with resolution. Skip the traversal altogether if len(resolution_data) == 0: return input # # Traversal Algorithm: # # Imagine the input dictionary/list as a tree. We are doing a Pre-Order tree traversal here where we first # process the root node before going to its children. Dict and Lists are the only two iterable nodes. # Everything else is a leaf node. # # We do a Pre-Order traversal to handle the case where `input` contains intrinsic function as its only child # ie. input = {"Ref": "foo}. # # We will try to resolve the intrinsics if we can, otherwise return the original input. In some cases, resolving # an intrinsic will result in a terminal state ie. {"Ref": "foo"} could resolve to a string "bar". In other # cases, resolving intrinsics is only partial and we might need to continue traversing the tree (ex: Fn::Sub) # to handle nested intrinsics. All of these cases lend well towards a Pre-Order traversal where we try and # process the intrinsic, which results in a modified sub-tree to traverse. # input = resolver_method(input, resolution_data) if isinstance(input, dict): return self._traverse_dict(input, resolution_data, resolver_method) elif isinstance(input, list): return self._traverse_list(input, resolution_data, resolver_method) else: # We can iterate only over dict or list types. Primitive types are terminals return input
[ "def", "_traverse", "(", "self", ",", "input", ",", "resolution_data", ",", "resolver_method", ")", ":", "# There is data to help with resolution. Skip the traversal altogether", "if", "len", "(", "resolution_data", ")", "==", "0", ":", "return", "input", "#", "# Traversal Algorithm:", "#", "# Imagine the input dictionary/list as a tree. We are doing a Pre-Order tree traversal here where we first", "# process the root node before going to its children. Dict and Lists are the only two iterable nodes.", "# Everything else is a leaf node.", "#", "# We do a Pre-Order traversal to handle the case where `input` contains intrinsic function as its only child", "# ie. input = {\"Ref\": \"foo}.", "#", "# We will try to resolve the intrinsics if we can, otherwise return the original input. In some cases, resolving", "# an intrinsic will result in a terminal state ie. {\"Ref\": \"foo\"} could resolve to a string \"bar\". In other", "# cases, resolving intrinsics is only partial and we might need to continue traversing the tree (ex: Fn::Sub)", "# to handle nested intrinsics. All of these cases lend well towards a Pre-Order traversal where we try and", "# process the intrinsic, which results in a modified sub-tree to traverse.", "#", "input", "=", "resolver_method", "(", "input", ",", "resolution_data", ")", "if", "isinstance", "(", "input", ",", "dict", ")", ":", "return", "self", ".", "_traverse_dict", "(", "input", ",", "resolution_data", ",", "resolver_method", ")", "elif", "isinstance", "(", "input", ",", "list", ")", ":", "return", "self", ".", "_traverse_list", "(", "input", ",", "resolution_data", ",", "resolver_method", ")", "else", ":", "# We can iterate only over dict or list types. Primitive types are terminals", "return", "input" ]
Driver method that performs the actual traversal of input and calls the appropriate `resolver_method` when to perform the resolution. :param input: Any primitive type (dict, array, string etc) whose value might contain an intrinsic function :param resolution_data: Data that will help with resolution. For example, when resolving parameter references, this object will contain a dictionary of parameter names and their values. :param resolver_method: Method that will be called to actually resolve an intrinsic function. This method is called with the parameters `(input, resolution_data)`. :return: Modified `input` with intrinsics resolved
[ "Driver", "method", "that", "performs", "the", "actual", "traversal", "of", "input", "and", "calls", "the", "appropriate", "resolver_method", "when", "to", "perform", "the", "resolution", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/resolver.py#L90-L132
train
Internal method that traverses the input dictionary and returns the modified input with intrins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ZiUMA3VWp,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(0b10010 + 0o36) + chr(0b1101111) + chr(1305 - 1254) + chr(52) + chr(0b10101 + 0o37), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(10209 - 10098) + '\061' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + '\060' + chr(55), 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(7106 - 6995) + chr(0b100 + 0o55) + chr(52) + chr(554 - 502), ord("\x08")), ehT0Px3KOsy9(chr(973 - 925) + chr(9254 - 9143) + '\x33' + '\064' + chr(1343 - 1288), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101011 + 0o11) + chr(258 - 208), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101100 + 0o7) + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(48) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b101100 + 0o103) + chr(51) + chr(603 - 553) + '\x34', 0o10), ehT0Px3KOsy9(chr(1637 - 1589) + chr(111) + '\062' + chr(2020 - 1969) + chr(1399 - 1350), ord("\x08")), ehT0Px3KOsy9(chr(1793 - 1745) + '\157' + chr(390 - 341) + chr(609 - 559) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(0b11110 + 0o24) + '\060', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110100) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11111 + 0o30) + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + '\063' + chr(0b11111 + 0o24), 28126 - 28118), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + chr(50) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\x6f' + '\x32' + '\062' + '\x36', 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(1865 - 1816) + chr(0b1100 + 0o47), 32449 - 32441), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1000010 + 0o55) + '\062' + '\x32' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(962 - 914) + chr(111) + chr(0b1100 + 0o45) + chr(0b1111 + 0o43) + chr(2251 - 2199), 8), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + chr(2242 - 2194) + chr(0b110111), 8), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\x33' + chr(52), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(55) + chr(698 - 648), 9004 - 8996), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + chr(0b110011), 8099 - 8091), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\x6f' + '\061' + chr(0b10111 + 0o37) + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101010 + 0o5) + chr(0b110011) + chr(54) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b110111 + 0o70) + '\062' + chr(1616 - 1567) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b11110 + 0o24) + chr(2407 - 2357) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b10001 + 0o136) + '\061' + chr(0b10101 + 0o34) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b100101 + 0o112) + chr(51) + '\061' + chr(49), 56965 - 56957), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(6290 - 6179) + '\062' + chr(0b100110 + 0o21) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(48) + '\061', 14467 - 14459), ehT0Px3KOsy9(chr(1340 - 1292) + '\157' + chr(0b110011) + chr(0b110101 + 0o2) + chr(0b100100 + 0o21), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b110110 + 0o71) + '\x32' + chr(51) + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + chr(0b11 + 0o60) + chr(0b110 + 0o54) + chr(84 - 35), 0o10), ehT0Px3KOsy9('\060' + chr(2896 - 2785) + '\062' + chr(0b110110) + chr(51), 0o10), ehT0Px3KOsy9(chr(56 - 8) + chr(0b1101111) + chr(1090 - 1041) + chr(50) + chr(190 - 137), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(641 - 591) + chr(0b110100) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(0b11110 + 0o24), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110101) + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xca'), chr(0b1100010 + 0o2) + '\145' + chr(99) + chr(5734 - 5623) + chr(100) + chr(0b100011 + 0o102))(chr(0b1110101) + '\x74' + '\146' + chr(0b101101) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def exDWGAAUDBGH(oVre8I6UXc3b, Y3jVKaC8LEDU, QEgcTpwBWp7n, CxJV_EGySTFN): if c2A0yzQpDQB3(QEgcTpwBWp7n) == ehT0Px3KOsy9('\x30' + chr(2192 - 2081) + '\060', 0o10): return Y3jVKaC8LEDU Y3jVKaC8LEDU = CxJV_EGySTFN(Y3jVKaC8LEDU, QEgcTpwBWp7n) if PlSM16l2KDPD(Y3jVKaC8LEDU, wLqBDw8l0eIm): return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbbrx\xa6\x12\x82Pj\xe2\x8b\xfd=\xb3T'), chr(0b1100100) + chr(0b1100101) + chr(0b100000 + 0o103) + '\157' + chr(0b1100100) + '\x65')(chr(11640 - 11523) + chr(7057 - 6941) + chr(5476 - 5374) + chr(0b101101) + chr(0b11010 + 0o36)))(Y3jVKaC8LEDU, QEgcTpwBWp7n, CxJV_EGySTFN) elif PlSM16l2KDPD(Y3jVKaC8LEDU, YyaZ4tpXu4lf): return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbbrx\xa6\x12\x82Pj\xe2\x8b\xf5=\xa3T'), chr(6113 - 6013) + chr(8574 - 8473) + '\143' + chr(111) + chr(0b101110 + 0o66) + chr(0b1100101))('\x75' + chr(0b10110 + 0o136) + '\146' + chr(0b1010 + 0o43) + '\070'))(Y3jVKaC8LEDU, QEgcTpwBWp7n, CxJV_EGySTFN) else: return Y3jVKaC8LEDU
awslabs/serverless-application-model
samtranslator/intrinsics/resolver.py
IntrinsicsResolver._traverse_dict
def _traverse_dict(self, input_dict, resolution_data, resolver_method): """ Traverse a dictionary to resolve intrinsic functions on every value :param input_dict: Input dictionary to traverse :param resolution_data: Data that the `resolver_method` needs to operate :param resolver_method: Method that can actually resolve an intrinsic function, if it detects one :return: Modified dictionary with values resolved """ for key, value in input_dict.items(): input_dict[key] = self._traverse(value, resolution_data, resolver_method) return input_dict
python
def _traverse_dict(self, input_dict, resolution_data, resolver_method): """ Traverse a dictionary to resolve intrinsic functions on every value :param input_dict: Input dictionary to traverse :param resolution_data: Data that the `resolver_method` needs to operate :param resolver_method: Method that can actually resolve an intrinsic function, if it detects one :return: Modified dictionary with values resolved """ for key, value in input_dict.items(): input_dict[key] = self._traverse(value, resolution_data, resolver_method) return input_dict
[ "def", "_traverse_dict", "(", "self", ",", "input_dict", ",", "resolution_data", ",", "resolver_method", ")", ":", "for", "key", ",", "value", "in", "input_dict", ".", "items", "(", ")", ":", "input_dict", "[", "key", "]", "=", "self", ".", "_traverse", "(", "value", ",", "resolution_data", ",", "resolver_method", ")", "return", "input_dict" ]
Traverse a dictionary to resolve intrinsic functions on every value :param input_dict: Input dictionary to traverse :param resolution_data: Data that the `resolver_method` needs to operate :param resolver_method: Method that can actually resolve an intrinsic function, if it detects one :return: Modified dictionary with values resolved
[ "Traverse", "a", "dictionary", "to", "resolve", "intrinsic", "functions", "on", "every", "value" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/resolver.py#L134-L146
train
Traverse a dictionary to resolve intrinsic functions on every value
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,cW7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qgHmVpI,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(0b100111 + 0o11) + chr(111) + '\x31' + chr(1361 - 1313) + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11110 + 0o25) + chr(49) + '\x32', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(797 - 743) + chr(0b10 + 0o57), 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\x6f' + chr(497 - 446) + '\062' + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(0b110111) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(55) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9681 - 9570) + chr(523 - 474) + '\x36' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + '\062' + '\062' + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100011 + 0o14) + '\x31' + chr(0b110010 + 0o4), 0b1000), ehT0Px3KOsy9(chr(349 - 301) + chr(11247 - 11136) + chr(53) + chr(494 - 442), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + '\x31' + '\061', 13466 - 13458), ehT0Px3KOsy9(chr(48) + chr(5913 - 5802) + chr(1778 - 1727) + chr(0b110000) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1101111) + chr(0b11011 + 0o27) + chr(0b110000 + 0o3) + '\062', 60525 - 60517), ehT0Px3KOsy9(chr(48) + chr(0b111 + 0o150) + chr(50) + chr(331 - 280) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(52) + chr(48), 30009 - 30001), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b100011 + 0o114) + '\066' + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(0b100000 + 0o22) + '\067', 8), ehT0Px3KOsy9(chr(1109 - 1061) + chr(0b1101111) + chr(0b110010) + '\060' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(133 - 85) + '\157' + chr(0b110001) + chr(0b11110 + 0o25) + chr(0b110000), 40939 - 40931), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(0b10101 + 0o40) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(0b110110) + chr(0b110010 + 0o0), ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1001101 + 0o42) + chr(50) + chr(0b1001 + 0o47) + chr(0b0 + 0o63), 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + '\061' + '\x32' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(772 - 661) + chr(0b110010) + '\x33' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\x6f' + chr(50) + '\x36' + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100110 + 0o111) + chr(607 - 556) + '\x32' + chr(0b110100 + 0o2), 0o10), ehT0Px3KOsy9('\x30' + chr(7026 - 6915) + '\x32' + chr(52) + chr(0b110011 + 0o1), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + '\060' + chr(1313 - 1261), 12012 - 12004), ehT0Px3KOsy9('\060' + chr(111) + '\064', 0b1000), ehT0Px3KOsy9(chr(1026 - 978) + chr(111) + chr(0b110010) + chr(0b110000) + '\060', 8), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b110111 + 0o70) + '\x31' + chr(51) + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(50) + chr(0b10111 + 0o36), 14837 - 14829), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\x6f' + chr(49) + chr(0b1001 + 0o56) + '\063', 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\157' + '\065' + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\x31' + '\x31', 8), ehT0Px3KOsy9(chr(48) + chr(11718 - 11607) + '\061' + chr(0b110100) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + '\062' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(286 - 238) + chr(0b111 + 0o150) + chr(0b110010) + '\067' + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(2057 - 2003) + '\x35', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(404 - 293) + chr(1002 - 949) + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'k'), chr(0b1010000 + 0o24) + '\x65' + '\x63' + chr(9515 - 9404) + chr(6267 - 6167) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(6629 - 6527) + chr(0b101101) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def kamtzyYcDGgN(oVre8I6UXc3b, fsKNe8onWqjT, QEgcTpwBWp7n, CxJV_EGySTFN): for (K3J4ZwSlE0sT, QmmgWUB13VCJ) in xafqLlk3kkUe(fsKNe8onWqjT, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0b\xb0\x07\xb2\xf5eD\xdab\x7f\x81\xfb'), chr(6871 - 6771) + '\x65' + '\143' + chr(7064 - 6953) + '\144' + chr(6704 - 6603))(chr(117) + '\164' + chr(5003 - 4901) + chr(0b11101 + 0o20) + '\x38'))(): fsKNe8onWqjT[K3J4ZwSlE0sT] = oVre8I6UXc3b._traverse(QmmgWUB13VCJ, QEgcTpwBWp7n, CxJV_EGySTFN) return fsKNe8onWqjT
awslabs/serverless-application-model
samtranslator/intrinsics/resolver.py
IntrinsicsResolver._traverse_list
def _traverse_list(self, input_list, resolution_data, resolver_method): """ Traverse a list to resolve intrinsic functions on every element :param input_list: List of input :param resolution_data: Data that the `resolver_method` needs to operate :param resolver_method: Method that can actually resolve an intrinsic function, if it detects one :return: Modified list with intrinsic functions resolved """ for index, value in enumerate(input_list): input_list[index] = self._traverse(value, resolution_data, resolver_method) return input_list
python
def _traverse_list(self, input_list, resolution_data, resolver_method): """ Traverse a list to resolve intrinsic functions on every element :param input_list: List of input :param resolution_data: Data that the `resolver_method` needs to operate :param resolver_method: Method that can actually resolve an intrinsic function, if it detects one :return: Modified list with intrinsic functions resolved """ for index, value in enumerate(input_list): input_list[index] = self._traverse(value, resolution_data, resolver_method) return input_list
[ "def", "_traverse_list", "(", "self", ",", "input_list", ",", "resolution_data", ",", "resolver_method", ")", ":", "for", "index", ",", "value", "in", "enumerate", "(", "input_list", ")", ":", "input_list", "[", "index", "]", "=", "self", ".", "_traverse", "(", "value", ",", "resolution_data", ",", "resolver_method", ")", "return", "input_list" ]
Traverse a list to resolve intrinsic functions on every element :param input_list: List of input :param resolution_data: Data that the `resolver_method` needs to operate :param resolver_method: Method that can actually resolve an intrinsic function, if it detects one :return: Modified list with intrinsic functions resolved
[ "Traverse", "a", "list", "to", "resolve", "intrinsic", "functions", "on", "every", "element" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/resolver.py#L148-L160
train
Traverse a list to resolve intrinsic functions on every element of the list
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pd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eError,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) + '\157' + chr(568 - 518), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(587 - 538) + '\063', 2985 - 2977), ehT0Px3KOsy9(chr(48) + chr(0b110001 + 0o76) + chr(50) + chr(0b110010) + chr(0b101101 + 0o4), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101101 + 0o6) + chr(55) + chr(0b110110), 26823 - 26815), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + '\061' + '\063' + chr(902 - 854), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(996 - 947) + '\065', 0o10), ehT0Px3KOsy9(chr(1853 - 1805) + '\x6f' + chr(51) + '\x37' + '\x34', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b10010 + 0o135) + '\x33' + chr(0b100110 + 0o21) + chr(1264 - 1215), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1000001 + 0o56) + '\066' + chr(1074 - 1020), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(55) + '\064', 8), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(0b110101) + '\063', 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(9808 - 9697) + chr(0b110011) + chr(54) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(1597 - 1486) + chr(0b110001) + '\061' + chr(0b1 + 0o66), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x34' + '\065', 0b1000), ehT0Px3KOsy9('\x30' + chr(3087 - 2976) + chr(0b110010) + chr(476 - 428) + chr(617 - 562), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(51) + '\061' + '\x31', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(0b11 + 0o63) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11001 + 0o33) + chr(0b110101 + 0o0), 8), ehT0Px3KOsy9(chr(0b110000) + chr(7718 - 7607) + chr(0b100011 + 0o17) + chr(385 - 330) + chr(2381 - 2331), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(0b110101) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(0b100101 + 0o21) + chr(54), 8), ehT0Px3KOsy9(chr(1738 - 1690) + chr(111) + '\x31' + chr(50) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1001010 + 0o45) + '\x32' + chr(0b110111) + chr(0b110101), 52824 - 52816), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110 + 0o55) + chr(54) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1011 + 0o50) + chr(0b0 + 0o65) + '\061', 0b1000), ehT0Px3KOsy9(chr(881 - 833) + chr(0b1101111) + chr(0b10010 + 0o40) + chr(0b110010) + chr(2967 - 2912), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9368 - 9257) + '\062' + chr(2414 - 2360) + chr(2012 - 1963), 8), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b10 + 0o155) + '\062' + chr(0b11111 + 0o23) + '\x32', 0o10), ehT0Px3KOsy9(chr(600 - 552) + chr(0b1101111) + chr(2510 - 2457) + chr(0b100111 + 0o16), 0o10), ehT0Px3KOsy9('\060' + chr(4049 - 3938) + '\x31' + chr(1349 - 1294) + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b101000 + 0o107) + '\x31' + chr(0b10110 + 0o41) + '\x31', 8), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b110101) + '\x31', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b11001 + 0o30) + chr(0b110000) + chr(0b110101), 0o10), ehT0Px3KOsy9('\060' + chr(4967 - 4856) + chr(0b1000 + 0o51) + chr(1498 - 1444) + chr(0b11111 + 0o23), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b1000 + 0o57) + '\061', 8), ehT0Px3KOsy9(chr(1880 - 1832) + chr(0b1101111) + chr(0b110011) + chr(0b101101 + 0o12) + chr(0b101010 + 0o15), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101000 + 0o11) + '\x35', 51921 - 51913), ehT0Px3KOsy9('\x30' + chr(0b101 + 0o152) + chr(0b110010) + chr(2104 - 2052) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5538 - 5427) + chr(2180 - 2130) + '\x34' + chr(2222 - 2172), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(8199 - 8088) + '\065' + chr(0b110010 + 0o2), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110101) + chr(0b11100 + 0o24), 42838 - 42830)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b','), '\x64' + chr(0b1100101) + chr(5424 - 5325) + chr(111) + chr(0b11 + 0o141) + '\145')(chr(0b101000 + 0o115) + chr(0b1100100 + 0o20) + chr(102) + chr(45) + chr(2995 - 2939)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Lk_J8NLAm96H(oVre8I6UXc3b, zNDuWsUOZeSr, QEgcTpwBWp7n, CxJV_EGySTFN): for (XdowRbJKZWL9, QmmgWUB13VCJ) in YlkZvXL8qwsX(zNDuWsUOZeSr): zNDuWsUOZeSr[XdowRbJKZWL9] = oVre8I6UXc3b._traverse(QmmgWUB13VCJ, QEgcTpwBWp7n, CxJV_EGySTFN) return zNDuWsUOZeSr
awslabs/serverless-application-model
samtranslator/intrinsics/resolver.py
IntrinsicsResolver._try_resolve_parameter_refs
def _try_resolve_parameter_refs(self, input, parameters): """ Try to resolve parameter references on the given input object. The object could be of any type. If the input is not in the format used by intrinsics (ie. dictionary with one key), input is returned unmodified. If the single key in dictionary is one of the supported intrinsic function types, go ahead and try to resolve it. :param input: Input object to resolve :param parameters: Parameter values used to for ref substitution :return: """ if not self._is_intrinsic_dict(input): return input function_type = list(input.keys())[0] return self.supported_intrinsics[function_type].resolve_parameter_refs(input, parameters)
python
def _try_resolve_parameter_refs(self, input, parameters): """ Try to resolve parameter references on the given input object. The object could be of any type. If the input is not in the format used by intrinsics (ie. dictionary with one key), input is returned unmodified. If the single key in dictionary is one of the supported intrinsic function types, go ahead and try to resolve it. :param input: Input object to resolve :param parameters: Parameter values used to for ref substitution :return: """ if not self._is_intrinsic_dict(input): return input function_type = list(input.keys())[0] return self.supported_intrinsics[function_type].resolve_parameter_refs(input, parameters)
[ "def", "_try_resolve_parameter_refs", "(", "self", ",", "input", ",", "parameters", ")", ":", "if", "not", "self", ".", "_is_intrinsic_dict", "(", "input", ")", ":", "return", "input", "function_type", "=", "list", "(", "input", ".", "keys", "(", ")", ")", "[", "0", "]", "return", "self", ".", "supported_intrinsics", "[", "function_type", "]", ".", "resolve_parameter_refs", "(", "input", ",", "parameters", ")" ]
Try to resolve parameter references on the given input object. The object could be of any type. If the input is not in the format used by intrinsics (ie. dictionary with one key), input is returned unmodified. If the single key in dictionary is one of the supported intrinsic function types, go ahead and try to resolve it. :param input: Input object to resolve :param parameters: Parameter values used to for ref substitution :return:
[ "Try", "to", "resolve", "parameter", "references", "on", "the", "given", "input", "object", ".", "The", "object", "could", "be", "of", "any", "type", ".", "If", "the", "input", "is", "not", "in", "the", "format", "used", "by", "intrinsics", "(", "ie", ".", "dictionary", "with", "one", "key", ")", "input", "is", "returned", "unmodified", ".", "If", "the", "single", "key", "in", "dictionary", "is", "one", "of", "the", "supported", "intrinsic", "function", "types", "go", "ahead", "and", "try", "to", "resolve", "it", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/resolver.py#L162-L177
train
Try to resolve parameter references on the input object.
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(10666 - 10555) + '\x32' + '\062' + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x36' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(586 - 538) + chr(111) + chr(51) + chr(52) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(2222 - 2174) + chr(0b11 + 0o154) + chr(0b101011 + 0o6) + chr(50) + chr(49), 62900 - 62892), ehT0Px3KOsy9('\060' + '\x6f' + chr(53) + chr(501 - 453), 43385 - 43377), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + '\x32' + chr(2724 - 2670), 12860 - 12852), ehT0Px3KOsy9('\x30' + chr(0b1001010 + 0o45) + chr(49) + '\064' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(107 - 59) + '\x6f' + chr(0b110001) + '\061' + chr(0b110011), 42643 - 42635), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(0b11101 + 0o26) + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b110001) + chr(0b10101 + 0o33), 40955 - 40947), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1020 - 967) + chr(0b10011 + 0o42), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10010 + 0o40) + chr(1798 - 1743) + chr(2372 - 2323), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010011 + 0o34) + chr(51) + chr(2386 - 2337) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + chr(0b110001) + '\063' + chr(1783 - 1735), ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1110 + 0o141) + chr(0b110001) + '\x35' + chr(0b101111 + 0o10), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1167 - 1113) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b0 + 0o157) + chr(54) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b110100 + 0o73) + chr(0b110011) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + '\x37' + '\064', 0b1000), ehT0Px3KOsy9(chr(1643 - 1595) + chr(111) + '\062' + chr(48) + chr(606 - 555), 28886 - 28878), ehT0Px3KOsy9('\060' + '\157' + '\061' + '\x31' + '\061', 422 - 414), ehT0Px3KOsy9(chr(48) + chr(0b1101111 + 0o0) + chr(1083 - 1032) + '\065' + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + '\x31' + chr(748 - 694), 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1001 + 0o146) + '\x31' + '\062' + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100101 + 0o15) + chr(52) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111 + 0o0) + '\061' + chr(0b110100) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101111) + chr(51) + chr(0b110011) + chr(53), 31339 - 31331), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(2351 - 2301) + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b100000 + 0o21) + '\x37' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(796 - 748) + chr(0b1101111) + chr(0b110001) + chr(54) + chr(0b101101 + 0o6), 42340 - 42332), ehT0Px3KOsy9(chr(0b110000) + chr(1627 - 1516) + chr(1368 - 1317) + chr(51) + '\065', 8), ehT0Px3KOsy9('\060' + '\157' + '\x36' + chr(0b110000), 40461 - 40453), ehT0Px3KOsy9('\060' + chr(2111 - 2000) + chr(1379 - 1329) + chr(0b100111 + 0o12) + '\065', 53424 - 53416), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011 + 0o1) + chr(2422 - 2369), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + chr(0b101 + 0o56) + chr(0b11 + 0o63), 23168 - 23160), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\x33' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(111) + chr(49) + '\x35' + chr(55), 8), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(111) + '\063' + chr(2344 - 2292) + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1095 - 1045) + chr(0b110010) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(54) + chr(49), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b11101 + 0o122) + '\x35' + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd'), chr(0b1000 + 0o134) + chr(2003 - 1902) + chr(99) + chr(1969 - 1858) + chr(0b1001110 + 0o26) + chr(101))(chr(117) + chr(0b1011101 + 0o27) + '\146' + '\x2d' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Zcs1YHp9bsA8(oVre8I6UXc3b, Y3jVKaC8LEDU, YwMyLskbiCrd): if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcc[\x94\x0eA8\x159\xf2\xa6^\xd0\xaf\x07\x0b]Ti'), '\x64' + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b111100 + 0o51))(chr(0b1110101) + chr(0b1001011 + 0o51) + chr(102) + chr(45) + '\070'))(Y3jVKaC8LEDU): return Y3jVKaC8LEDU cid_uaYJYOSx = YyaZ4tpXu4lf(Y3jVKaC8LEDU.keys())[ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11011 + 0o25), ord("\x08"))] return xafqLlk3kkUe(oVre8I6UXc3b.supported_intrinsics[cid_uaYJYOSx], xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1W\x94>D \x04\x14\xeb\xa9_\xd8\xa1=\x1bQEB\x8e\xe6/\x9e'), chr(0b1100100) + chr(101) + '\x63' + '\157' + '\144' + chr(101))(chr(6877 - 6760) + '\x74' + chr(0b1100110) + chr(0b111 + 0o46) + '\x38'))(Y3jVKaC8LEDU, YwMyLskbiCrd)
awslabs/serverless-application-model
samtranslator/intrinsics/resolver.py
IntrinsicsResolver._try_resolve_sam_resource_refs
def _try_resolve_sam_resource_refs(self, input, supported_resource_refs): """ Try to resolve SAM resource references on the given template. If the given object looks like one of the supported intrinsics, it calls the appropriate resolution on it. If not, this method returns the original input unmodified. :param dict input: Dictionary that may represent an intrinsic function :param SupportedResourceReferences supported_resource_refs: Object containing information about available resource references and the values they resolve to. :return: Modified input dictionary with references resolved """ if not self._is_intrinsic_dict(input): return input function_type = list(input.keys())[0] return self.supported_intrinsics[function_type].resolve_resource_refs(input, supported_resource_refs)
python
def _try_resolve_sam_resource_refs(self, input, supported_resource_refs): """ Try to resolve SAM resource references on the given template. If the given object looks like one of the supported intrinsics, it calls the appropriate resolution on it. If not, this method returns the original input unmodified. :param dict input: Dictionary that may represent an intrinsic function :param SupportedResourceReferences supported_resource_refs: Object containing information about available resource references and the values they resolve to. :return: Modified input dictionary with references resolved """ if not self._is_intrinsic_dict(input): return input function_type = list(input.keys())[0] return self.supported_intrinsics[function_type].resolve_resource_refs(input, supported_resource_refs)
[ "def", "_try_resolve_sam_resource_refs", "(", "self", ",", "input", ",", "supported_resource_refs", ")", ":", "if", "not", "self", ".", "_is_intrinsic_dict", "(", "input", ")", ":", "return", "input", "function_type", "=", "list", "(", "input", ".", "keys", "(", ")", ")", "[", "0", "]", "return", "self", ".", "supported_intrinsics", "[", "function_type", "]", ".", "resolve_resource_refs", "(", "input", ",", "supported_resource_refs", ")" ]
Try to resolve SAM resource references on the given template. If the given object looks like one of the supported intrinsics, it calls the appropriate resolution on it. If not, this method returns the original input unmodified. :param dict input: Dictionary that may represent an intrinsic function :param SupportedResourceReferences supported_resource_refs: Object containing information about available resource references and the values they resolve to. :return: Modified input dictionary with references resolved
[ "Try", "to", "resolve", "SAM", "resource", "references", "on", "the", "given", "template", ".", "If", "the", "given", "object", "looks", "like", "one", "of", "the", "supported", "intrinsics", "it", "calls", "the", "appropriate", "resolution", "on", "it", ".", "If", "not", "this", "method", "returns", "the", "original", "input", "unmodified", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/resolver.py#L179-L194
train
Try to resolve SAM resource references on the given 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,NL8dt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ammpH,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(716 - 665) + chr(50) + '\067', 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1001110 + 0o41) + '\x33' + chr(0b110101) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(420 - 372) + chr(0b1101110 + 0o1) + chr(50) + '\x30' + '\x35', 0b1000), ehT0Px3KOsy9(chr(225 - 177) + chr(0b1101111) + chr(807 - 758) + chr(0b10010 + 0o37) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b111 + 0o52) + chr(721 - 669) + chr(0b111 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\067' + chr(49), 49326 - 49318), ehT0Px3KOsy9(chr(48) + chr(2011 - 1900) + chr(0b100011 + 0o20) + chr(0b110101) + '\063', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(50) + chr(2672 - 2619), 0o10), ehT0Px3KOsy9('\060' + chr(7018 - 6907) + chr(0b110011) + '\x30' + chr(0b10101 + 0o42), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b101000 + 0o11) + '\066' + chr(1002 - 950), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1796 - 1743) + chr(0b1011 + 0o53), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(0b100000 + 0o24) + '\x31', 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + '\x37' + chr(1166 - 1115), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(5470 - 5359) + chr(55) + chr(0b101011 + 0o14), 61333 - 61325), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + chr(0b11 + 0o60) + '\x35' + chr(54), 60138 - 60130), ehT0Px3KOsy9('\060' + chr(0b1010001 + 0o36) + chr(2367 - 2317) + chr(49) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(512 - 462) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + '\x33' + chr(2429 - 2377), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b110111) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(1795 - 1745) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\064' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(3494 - 3383) + chr(0b110010) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(316 - 268) + chr(0b110 + 0o151) + '\x33' + '\064' + chr(0b10011 + 0o42), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(719 - 608) + chr(0b110010) + '\x34' + chr(1078 - 1030), 33886 - 33878), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(0b1101 + 0o46) + chr(53), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\064' + chr(370 - 318), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(111) + chr(50) + '\066' + chr(0b1101 + 0o46), 0o10), ehT0Px3KOsy9(chr(327 - 279) + chr(3086 - 2975) + chr(0b110011) + chr(55) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(0b110010) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(53) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b100100 + 0o22) + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10 + 0o60) + chr(0b11010 + 0o30) + chr(2319 - 2268), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1010 + 0o51) + chr(0b100110 + 0o17) + chr(0b101100 + 0o10), 8), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\x6f' + '\062' + chr(0b101010 + 0o6) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(1944 - 1896) + '\157' + chr(50) + '\x37' + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(5012 - 4901) + chr(0b10111 + 0o34) + chr(2413 - 2359) + chr(643 - 588), 63058 - 63050), ehT0Px3KOsy9(chr(1371 - 1323) + chr(0b1101111) + chr(968 - 919) + chr(55) + chr(526 - 475), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\063' + chr(0b10010 + 0o36) + chr(0b11010 + 0o26), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(51) + chr(0b110000 + 0o0), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\065' + chr(1252 - 1204), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9'), chr(100) + chr(8495 - 8394) + chr(0b1100011) + '\157' + chr(0b1100100) + '\145')(chr(0b10011 + 0o142) + chr(6411 - 6295) + chr(0b1001100 + 0o32) + chr(0b100 + 0o51) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Q6AAkD3OoGdM(oVre8I6UXc3b, Y3jVKaC8LEDU, KvSmPUitKt7D): if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x88\x85\xf6\x16\x08\x97\x9f\xe7\xae\x1a]\x08\xd8`\x8a\xe0\xb1\xe8'), chr(0b111100 + 0o50) + '\145' + chr(99) + '\157' + '\x64' + chr(0b111001 + 0o54))(chr(0b100 + 0o161) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b110001 + 0o7)))(Y3jVKaC8LEDU): return Y3jVKaC8LEDU cid_uaYJYOSx = YyaZ4tpXu4lf(Y3jVKaC8LEDU.keys())[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2258 - 2210), 0o10)] return xafqLlk3kkUe(oVre8I6UXc3b.supported_intrinsics[cid_uaYJYOSx], xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5\x89\xf6&\r\x8f\x8e\xca\xb5\x11]\x0e\xceM\x8d\xec\x8d\xee\x1b\xb3W'), chr(100) + '\145' + '\143' + '\x6f' + chr(6943 - 6843) + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(0b111000)))(Y3jVKaC8LEDU, KvSmPUitKt7D)
awslabs/serverless-application-model
samtranslator/intrinsics/resolver.py
IntrinsicsResolver._try_resolve_sam_resource_id_refs
def _try_resolve_sam_resource_id_refs(self, input, supported_resource_id_refs): """ Try to resolve SAM resource id references on the given template. If the given object looks like one of the supported intrinsics, it calls the appropriate resolution on it. If not, this method returns the original input unmodified. :param dict input: Dictionary that may represent an intrinsic function :param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones. :return: Modified input dictionary with id references resolved """ if not self._is_intrinsic_dict(input): return input function_type = list(input.keys())[0] return self.supported_intrinsics[function_type].resolve_resource_id_refs(input, supported_resource_id_refs)
python
def _try_resolve_sam_resource_id_refs(self, input, supported_resource_id_refs): """ Try to resolve SAM resource id references on the given template. If the given object looks like one of the supported intrinsics, it calls the appropriate resolution on it. If not, this method returns the original input unmodified. :param dict input: Dictionary that may represent an intrinsic function :param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones. :return: Modified input dictionary with id references resolved """ if not self._is_intrinsic_dict(input): return input function_type = list(input.keys())[0] return self.supported_intrinsics[function_type].resolve_resource_id_refs(input, supported_resource_id_refs)
[ "def", "_try_resolve_sam_resource_id_refs", "(", "self", ",", "input", ",", "supported_resource_id_refs", ")", ":", "if", "not", "self", ".", "_is_intrinsic_dict", "(", "input", ")", ":", "return", "input", "function_type", "=", "list", "(", "input", ".", "keys", "(", ")", ")", "[", "0", "]", "return", "self", ".", "supported_intrinsics", "[", "function_type", "]", ".", "resolve_resource_id_refs", "(", "input", ",", "supported_resource_id_refs", ")" ]
Try to resolve SAM resource id references on the given template. If the given object looks like one of the supported intrinsics, it calls the appropriate resolution on it. If not, this method returns the original input unmodified. :param dict input: Dictionary that may represent an intrinsic function :param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones. :return: Modified input dictionary with id references resolved
[ "Try", "to", "resolve", "SAM", "resource", "id", "references", "on", "the", "given", "template", ".", "If", "the", "given", "object", "looks", "like", "one", "of", "the", "supported", "intrinsics", "it", "calls", "the", "appropriate", "resolution", "on", "it", ".", "If", "not", "this", "method", "returns", "the", "original", "input", "unmodified", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/resolver.py#L196-L210
train
Try to resolve SAM resource id references on the given 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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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' + '\157' + chr(49) + chr(0b110001) + chr(48), 36218 - 36210), ehT0Px3KOsy9(chr(48) + chr(7138 - 7027) + '\063', 0o10), ehT0Px3KOsy9(chr(541 - 493) + chr(11216 - 11105) + chr(0b110110) + '\x30', 7931 - 7923), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(55) + '\x30', 0o10), ehT0Px3KOsy9(chr(1427 - 1379) + chr(0b111110 + 0o61) + '\062' + chr(53) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(111) + chr(386 - 336) + '\x36' + chr(1896 - 1843), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(0b110110) + chr(0b101111 + 0o2), 0o10), ehT0Px3KOsy9('\x30' + chr(6301 - 6190) + '\x31' + '\x34' + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(0b11010 + 0o125) + '\067' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(1428 - 1380) + chr(0b1101111) + chr(0b110101) + '\064', 55051 - 55043), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(50) + '\x35', 0b1000), ehT0Px3KOsy9(chr(1352 - 1304) + chr(0b110 + 0o151) + chr(51) + chr(2026 - 1976) + '\061', 58045 - 58037), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1100000 + 0o17) + chr(0b101111 + 0o7), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(0b100011 + 0o20) + chr(0b100101 + 0o14), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x36' + chr(0b110010 + 0o2), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\065' + chr(0b110111), 50984 - 50976), ehT0Px3KOsy9('\x30' + '\157' + '\062' + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\x30' + chr(52), 0b1000), ehT0Px3KOsy9(chr(1251 - 1203) + '\x6f' + chr(0b110110) + chr(0b10000 + 0o47), 10666 - 10658), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\x31' + chr(1379 - 1329), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + chr(0b110011) + '\x30' + chr(825 - 770), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(0b1100 + 0o47) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1010001 + 0o36) + '\062' + '\x33' + chr(0b110000), 45783 - 45775), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(0b110010) + chr(0b110011) + chr(1898 - 1849), 0o10), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + chr(0b110011) + chr(53), 48177 - 48169), ehT0Px3KOsy9(chr(882 - 834) + chr(0b1101111) + chr(49) + '\061' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b100100 + 0o113) + '\065' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b111100 + 0o63) + chr(54) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110101 + 0o72) + chr(391 - 341) + chr(49) + chr(0b110100), 55545 - 55537), ehT0Px3KOsy9('\060' + chr(111) + chr(0b100101 + 0o15) + chr(0b110010) + chr(0b1001 + 0o47), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(0b10110 + 0o41) + chr(55), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101100 + 0o3) + '\x32' + '\065' + chr(1014 - 959), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11494 - 11383) + chr(714 - 663) + '\x36', 58497 - 58489), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(54) + chr(968 - 917), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(0b110110) + '\x32', 0b1000), ehT0Px3KOsy9('\060' + chr(6093 - 5982) + chr(0b100011 + 0o16) + '\x30' + chr(0b11111 + 0o25), 8), ehT0Px3KOsy9(chr(48) + chr(0b101 + 0o152) + chr(0b110011) + '\063' + '\064', 654 - 646), ehT0Px3KOsy9(chr(1270 - 1222) + chr(0b1101111) + chr(0b101001 + 0o12) + chr(2485 - 2432) + chr(0b11110 + 0o26), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(314 - 264) + '\x32' + chr(2584 - 2531), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1011 + 0o50) + chr(0b110110) + '\066', 15647 - 15639)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x35' + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'f'), '\144' + chr(0b1011001 + 0o14) + chr(99) + chr(11462 - 11351) + '\x64' + chr(101))(chr(13090 - 12973) + chr(0b1110100) + chr(6328 - 6226) + '\x2d' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def wBJkvZTspiq6(oVre8I6UXc3b, Y3jVKaC8LEDU, Xwr_NWMclJnm): if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x17jC\xe7\xc3\xdb\x85\x14RB\xe6\xb8e\x86PFw0'), '\144' + chr(0b1100101) + '\143' + chr(0b111 + 0o150) + chr(100) + '\x65')(chr(117) + chr(0b1011010 + 0o32) + '\x66' + chr(596 - 551) + chr(56)))(Y3jVKaC8LEDU): return Y3jVKaC8LEDU cid_uaYJYOSx = YyaZ4tpXu4lf(Y3jVKaC8LEDU.keys())[ehT0Px3KOsy9(chr(48) + chr(111) + chr(48), 0o10)] return xafqLlk3kkUe(oVre8I6UXc3b.supported_intrinsics[cid_uaYJYOSx], xafqLlk3kkUe(SXOLrMavuUCe(b':fC\xd7\xc6\xc3\x949II\xe6\xbes\xabWJK-S\x95\xb5=\xfe\xea'), chr(0b1100100) + chr(2243 - 2142) + chr(99) + chr(0b1101001 + 0o6) + chr(100) + '\145')(chr(0b11100 + 0o131) + '\x74' + chr(1922 - 1820) + '\x2d' + '\070'))(Y3jVKaC8LEDU, Xwr_NWMclJnm)
awslabs/serverless-application-model
samtranslator/intrinsics/resolver.py
IntrinsicsResolver._is_intrinsic_dict
def _is_intrinsic_dict(self, input): """ Can the input represent an intrinsic function in it? :param input: Object to be checked :return: True, if the input contains a supported intrinsic function. False otherwise """ # All intrinsic functions are dictionaries with just one key return isinstance(input, dict) \ and len(input) == 1 \ and list(input.keys())[0] in self.supported_intrinsics
python
def _is_intrinsic_dict(self, input): """ Can the input represent an intrinsic function in it? :param input: Object to be checked :return: True, if the input contains a supported intrinsic function. False otherwise """ # All intrinsic functions are dictionaries with just one key return isinstance(input, dict) \ and len(input) == 1 \ and list(input.keys())[0] in self.supported_intrinsics
[ "def", "_is_intrinsic_dict", "(", "self", ",", "input", ")", ":", "# All intrinsic functions are dictionaries with just one key", "return", "isinstance", "(", "input", ",", "dict", ")", "and", "len", "(", "input", ")", "==", "1", "and", "list", "(", "input", ".", "keys", "(", ")", ")", "[", "0", "]", "in", "self", ".", "supported_intrinsics" ]
Can the input represent an intrinsic function in it? :param input: Object to be checked :return: True, if the input contains a supported intrinsic function. False otherwise
[ "Can", "the", "input", "represent", "an", "intrinsic", "function", "in", "it?" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/resolver.py#L212-L222
train
Checks if the input represent an intrinsic function in it.
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,QWgp4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M16l2KDPD,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) + '\x36' + chr(52), 0o10), ehT0Px3KOsy9(chr(1172 - 1124) + chr(0b10111 + 0o130) + '\x31' + '\x35' + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + chr(6748 - 6637) + '\061' + chr(0b110100) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + chr(2227 - 2173), 7495 - 7487), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(0b11 + 0o61) + chr(2202 - 2147), 0o10), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(111) + chr(49) + chr(0b100001 + 0o20) + '\064', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x34' + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b110 + 0o151) + '\062' + chr(2736 - 2683) + chr(1017 - 963), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1910 - 1860) + chr(0b110100) + chr(54), 14992 - 14984), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\157' + chr(0b100100 + 0o16) + chr(591 - 541) + '\064', 44706 - 44698), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(0b110101) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010011 + 0o34) + chr(0b110011) + '\061' + chr(2062 - 2009), 0b1000), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(1677 - 1624) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b1011 + 0o144) + chr(1111 - 1061) + '\060' + chr(1815 - 1763), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(2252 - 2141) + chr(1897 - 1847) + chr(52) + chr(105 - 51), 8), ehT0Px3KOsy9(chr(48) + chr(0b111100 + 0o63) + chr(0b110010) + chr(53) + '\066', 8), ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + chr(0b110001) + '\066' + chr(468 - 416), 2471 - 2463), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\x6f' + '\061' + '\061' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(2593 - 2482) + '\061' + chr(0b101100 + 0o11) + '\x33', 0o10), ehT0Px3KOsy9('\060' + chr(0b101 + 0o152) + '\061' + chr(0b110100) + '\065', 0b1000), ehT0Px3KOsy9(chr(2077 - 2029) + chr(0b111 + 0o150) + chr(0b110010) + chr(54) + chr(0b110101 + 0o0), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b110110) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(54) + chr(0b100001 + 0o21), 0b1000), ehT0Px3KOsy9(chr(1202 - 1154) + chr(0b1101111) + chr(0b110010) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10001 + 0o41) + chr(0b0 + 0o61) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\157' + '\x31' + chr(51) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(52) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(853 - 802) + chr(0b0 + 0o62) + chr(55), 0o10), ehT0Px3KOsy9(chr(2200 - 2152) + '\157' + '\x32' + chr(0b110100) + chr(0b110000 + 0o0), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + '\x31' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1010 + 0o47) + chr(426 - 375) + chr(53), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1524 - 1473) + chr(49) + chr(514 - 460), ord("\x08")), ehT0Px3KOsy9(chr(1032 - 984) + chr(111) + '\x33' + chr(0b1011 + 0o54) + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + chr(3990 - 3879) + chr(0b110101) + chr(1949 - 1901), 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(936 - 825) + chr(0b110001 + 0o0) + chr(0b11111 + 0o21) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(4958 - 4847) + chr(0b1 + 0o62) + chr(772 - 720), 35781 - 35773), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11 + 0o60) + chr(0b110000) + chr(0b11 + 0o57), 52408 - 52400), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1404 - 1350) + chr(1452 - 1397), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1101 + 0o47) + chr(50), 0b1000), ehT0Px3KOsy9(chr(1587 - 1539) + '\x6f' + chr(0b101110 + 0o11), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(2532 - 2479) + chr(197 - 149), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a'), chr(100) + chr(101) + '\x63' + chr(0b1101110 + 0o1) + chr(0b100111 + 0o75) + chr(0b110111 + 0o56))(chr(117) + chr(116) + chr(5749 - 5647) + '\x2d' + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def toIk2gzodgnu(oVre8I6UXc3b, Y3jVKaC8LEDU): return PlSM16l2KDPD(Y3jVKaC8LEDU, wLqBDw8l0eIm) and c2A0yzQpDQB3(Y3jVKaC8LEDU) == ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(279 - 230), ord("\x08")) and (YyaZ4tpXu4lf(xafqLlk3kkUe(Y3jVKaC8LEDU, xafqLlk3kkUe(SXOLrMavuUCe(b'_\x0c\x1fe'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(3840 - 3729) + '\144' + '\145')(chr(117) + chr(0b100100 + 0o120) + '\146' + '\055' + chr(0b111000)))())[ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(111) + chr(151 - 103), ord("\x08"))] in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'G\x1c\x16f\x08>P\xcb\xc2\xcb\xc4\xa3[\xf6\xcf\xc0\x07&\x08\x16'), '\144' + chr(1189 - 1088) + chr(0b1001010 + 0o31) + '\157' + '\x64' + chr(101))(chr(0b1110101) + chr(8560 - 8444) + chr(0b1100110) + chr(45) + chr(56))))
awslabs/serverless-application-model
samtranslator/model/eventsources/cloudwatchlogs.py
CloudWatchLogs.to_cloudformation
def to_cloudformation(self, **kwargs): """Returns the CloudWatch Logs Subscription Filter and Lambda Permission to which this CloudWatch Logs event source corresponds. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to which this push event expands :rtype: list """ function = kwargs.get('function') if not function: raise TypeError("Missing required keyword argument: function") source_arn = self.get_source_arn() permission = self._construct_permission(function, source_arn=source_arn) subscription_filter = self.get_subscription_filter(function, permission) resources = [permission, subscription_filter] return resources
python
def to_cloudformation(self, **kwargs): """Returns the CloudWatch Logs Subscription Filter and Lambda Permission to which this CloudWatch Logs event source corresponds. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to which this push event expands :rtype: list """ function = kwargs.get('function') if not function: raise TypeError("Missing required keyword argument: function") source_arn = self.get_source_arn() permission = self._construct_permission(function, source_arn=source_arn) subscription_filter = self.get_subscription_filter(function, permission) resources = [permission, subscription_filter] return resources
[ "def", "to_cloudformation", "(", "self", ",", "*", "*", "kwargs", ")", ":", "function", "=", "kwargs", ".", "get", "(", "'function'", ")", "if", "not", "function", ":", "raise", "TypeError", "(", "\"Missing required keyword argument: function\"", ")", "source_arn", "=", "self", ".", "get_source_arn", "(", ")", "permission", "=", "self", ".", "_construct_permission", "(", "function", ",", "source_arn", "=", "source_arn", ")", "subscription_filter", "=", "self", ".", "get_subscription_filter", "(", "function", ",", "permission", ")", "resources", "=", "[", "permission", ",", "subscription_filter", "]", "return", "resources" ]
Returns the CloudWatch Logs Subscription Filter and Lambda Permission to which this CloudWatch Logs event source corresponds. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to which this push event expands :rtype: list
[ "Returns", "the", "CloudWatch", "Logs", "Subscription", "Filter", "and", "Lambda", "Permission", "to", "which", "this", "CloudWatch", "Logs", "event", "source", "corresponds", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/eventsources/cloudwatchlogs.py#L18-L36
train
Returns the CloudWatch Logs Subscription Filter and Lambda Permission to which this CloudWatch Logs event source corresponds.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQ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fSmY,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('\x30' + chr(111) + chr(0b1001 + 0o51) + chr(1134 - 1080), ord("\x08")), ehT0Px3KOsy9(chr(87 - 39) + chr(111) + '\x37' + chr(0b110101), 7998 - 7990), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101001 + 0o6) + '\061' + '\061' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(54) + chr(0b101 + 0o61), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(50) + chr(0b10110 + 0o34), 0o10), ehT0Px3KOsy9(chr(978 - 930) + chr(1055 - 944) + chr(50) + chr(0b110101) + chr(0b100110 + 0o15), 26064 - 26056), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\x6f' + '\x31' + chr(1137 - 1084), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1010 + 0o145) + chr(0b110101) + chr(803 - 751), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x35' + chr(49), 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(1851 - 1801) + '\060' + chr(0b101011 + 0o7), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\067' + chr(55), 61197 - 61189), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(0b101010 + 0o10) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(8976 - 8865) + chr(0b110001) + '\064' + chr(0b110011 + 0o1), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(0b110100) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + '\x30' + '\060', 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(1709 - 1598) + chr(0b100101 + 0o14) + chr(0b11 + 0o64) + chr(0b11 + 0o55), 0o10), ehT0Px3KOsy9(chr(575 - 527) + chr(111) + '\x31' + '\x32' + chr(0b110100), 35475 - 35467), ehT0Px3KOsy9(chr(400 - 352) + chr(0b101111 + 0o100) + '\x33' + '\063' + chr(0b101110 + 0o11), 44026 - 44018), ehT0Px3KOsy9(chr(48) + chr(5939 - 5828) + '\062' + chr(0b100101 + 0o20) + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10010 + 0o37) + chr(0b110010) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\157' + '\x31' + chr(0b110011 + 0o3) + chr(0b10100 + 0o41), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b101101 + 0o102) + chr(1858 - 1809) + '\x35' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(7695 - 7584) + chr(0b101011 + 0o13) + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\067' + '\065', 8), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(4858 - 4747) + chr(0b110010) + chr(49), 0b1000), ehT0Px3KOsy9(chr(2141 - 2093) + chr(0b1101111) + chr(406 - 356) + chr(0b101010 + 0o15), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\066' + '\x31', 48454 - 48446), ehT0Px3KOsy9(chr(48) + chr(0b110101 + 0o72) + chr(49) + '\x35' + chr(0b10110 + 0o35), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(52) + chr(0b110010), 16780 - 16772), ehT0Px3KOsy9(chr(48) + chr(0b110011 + 0o74) + chr(1074 - 1023), 63242 - 63234), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2390 - 2340) + '\062' + '\061', 0o10), ehT0Px3KOsy9(chr(1694 - 1646) + chr(3163 - 3052) + chr(1515 - 1465) + chr(316 - 266) + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1100111 + 0o10) + chr(0b110001) + chr(0b101000 + 0o17) + chr(1124 - 1071), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(5171 - 5060) + chr(0b1111 + 0o43) + '\064' + '\066', 0o10), ehT0Px3KOsy9(chr(2301 - 2253) + '\x6f' + '\x33' + chr(0b110100) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(454 - 406) + '\157' + chr(945 - 894) + chr(0b101011 + 0o13) + chr(52), 0o10), ehT0Px3KOsy9('\060' + chr(0b10100 + 0o133) + chr(0b1011 + 0o51) + chr(1512 - 1460), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b0 + 0o157) + '\x33' + '\066' + '\062', 37978 - 37970), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1251 - 1200) + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + '\065' + chr(0b110001 + 0o4), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1100001 + 0o16) + chr(502 - 449) + chr(0b110000), 34137 - 34129)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'8'), chr(100) + chr(101) + chr(0b1001000 + 0o33) + chr(111) + chr(100) + chr(1262 - 1161))(chr(11215 - 11098) + '\x74' + chr(0b1100011 + 0o3) + '\x2d' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def NpIm0Ph3ybvM(oVre8I6UXc3b, **M8EIoTs2GJXE): bBC93MgSHzUB = M8EIoTs2GJXE.get(xafqLlk3kkUe(SXOLrMavuUCe(b'pH$\x95&\xc2bB'), '\144' + '\x65' + chr(99) + '\157' + '\x64' + '\x65')(chr(0b1110101) + '\x74' + chr(3648 - 3546) + chr(45) + '\070')) if not bBC93MgSHzUB: raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b'[T9\x85;\xc5j\x0c[\xe7N\xa2\r\xd0%\x1ct\xb4\xcf,\x02\x03@Y1vC\x0c\x17n\xf4\xfc\t\x9c\xc6\x92Q\x9c\x7f\xd9\x7fR$'), chr(0b10000 + 0o124) + '\x65' + chr(99) + '\157' + chr(0b1100100) + chr(7943 - 7842))(chr(3993 - 3876) + chr(116) + chr(2768 - 2666) + chr(0b1111 + 0o36) + chr(56))) hAQZmU1baMWF = oVre8I6UXc3b.get_source_arn() YjuVmx7ofT5i = oVre8I6UXc3b._construct_permission(bBC93MgSHzUB, source_arn=hAQZmU1baMWF) hV9mdispW7cA = oVre8I6UXc3b.get_subscription_filter(bBC93MgSHzUB, YjuVmx7ofT5i) z4Xs9XhDbg00 = [YjuVmx7ofT5i, hV9mdispW7cA] return z4Xs9XhDbg00
awslabs/serverless-application-model
samtranslator/policy_template_processor/processor.py
PolicyTemplatesProcessor.convert
def convert(self, template_name, parameter_values): """ Converts the given template to IAM-ready policy statement by substituting template parameters with the given values. :param template_name: Name of the template :param parameter_values: Values for all parameters of the template :return dict: Dictionary containing policy statement :raises ValueError: If the given inputs don't represent valid template :raises InsufficientParameterValues: If the parameter values don't have values for all required parameters """ if not self.has(template_name): raise TemplateNotFoundException(template_name) template = self.get(template_name) return template.to_statement(parameter_values)
python
def convert(self, template_name, parameter_values): """ Converts the given template to IAM-ready policy statement by substituting template parameters with the given values. :param template_name: Name of the template :param parameter_values: Values for all parameters of the template :return dict: Dictionary containing policy statement :raises ValueError: If the given inputs don't represent valid template :raises InsufficientParameterValues: If the parameter values don't have values for all required parameters """ if not self.has(template_name): raise TemplateNotFoundException(template_name) template = self.get(template_name) return template.to_statement(parameter_values)
[ "def", "convert", "(", "self", ",", "template_name", ",", "parameter_values", ")", ":", "if", "not", "self", ".", "has", "(", "template_name", ")", ":", "raise", "TemplateNotFoundException", "(", "template_name", ")", "template", "=", "self", ".", "get", "(", "template_name", ")", "return", "template", ".", "to_statement", "(", "parameter_values", ")" ]
Converts the given template to IAM-ready policy statement by substituting template parameters with the given values. :param template_name: Name of the template :param parameter_values: Values for all parameters of the template :return dict: Dictionary containing policy statement :raises ValueError: If the given inputs don't represent valid template :raises InsufficientParameterValues: If the parameter values don't have values for all required parameters
[ "Converts", "the", "given", "template", "to", "IAM", "-", "ready", "policy", "statement", "by", "substituting", "template", "parameters", "with", "the", "given", "values", "." ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/policy_template_processor/processor.py#L84-L100
train
Converts the given template to IAM - ready policy statement by substituting template parameters with the given values.
Pu7Z6IJCgH3a,vcEH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kAMbUz4aLg,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(10840 - 10729) + '\062' + '\x37' + chr(0b10001 + 0o41), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110100) + '\x32', 25102 - 25094), ehT0Px3KOsy9(chr(522 - 474) + chr(0b1101111) + chr(0b100100 + 0o16) + chr(0b110010) + chr(0b110011), 32612 - 32604), ehT0Px3KOsy9(chr(1510 - 1462) + '\157' + chr(0b110010) + '\x34' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101011 + 0o7) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(340 - 292) + chr(111) + '\062' + chr(48) + chr(50), 13716 - 13708), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110100) + chr(2047 - 1993), 11796 - 11788), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(10748 - 10637) + chr(50) + chr(768 - 720) + chr(536 - 485), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x36' + chr(2072 - 2023), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001001 + 0o46) + chr(717 - 667) + '\066' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\x6f' + '\x33' + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + chr(0b1000 + 0o57) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + '\064' + '\x31', 4714 - 4706), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + chr(2305 - 2254) + chr(0b110010) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\x6f' + chr(0b10 + 0o57) + chr(0b110101) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(0b101010 + 0o15) + chr(0b10000 + 0o45), 53917 - 53909), ehT0Px3KOsy9('\060' + chr(0b10010 + 0o135) + chr(0b110010) + chr(1695 - 1642) + chr(0b1010 + 0o50), 51303 - 51295), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1000 + 0o51) + chr(0b110110) + chr(0b10110 + 0o41), ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(6735 - 6624) + chr(50) + chr(0b110110) + chr(1345 - 1293), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(2263 - 2152) + chr(0b110001) + chr(52) + chr(205 - 155), ord("\x08")), ehT0Px3KOsy9(chr(285 - 237) + chr(9862 - 9751) + chr(0b110001) + chr(1608 - 1557) + '\x37', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(1655 - 1605) + chr(0b100000 + 0o26) + chr(0b110100), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + '\x31' + chr(1008 - 953), 49255 - 49247), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101111 + 0o3) + '\066' + chr(826 - 771), 37587 - 37579), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b100001 + 0o22) + chr(749 - 700) + chr(1885 - 1832), 14280 - 14272), ehT0Px3KOsy9(chr(48) + chr(7766 - 7655) + '\x32' + chr(2168 - 2119) + chr(0b11011 + 0o32), 0b1000), ehT0Px3KOsy9(chr(2203 - 2155) + chr(0b1100111 + 0o10) + '\x37' + '\063', 61152 - 61144), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\x37' + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1186 - 1132) + chr(54), 0o10), ehT0Px3KOsy9(chr(1799 - 1751) + chr(0b1100 + 0o143) + chr(2045 - 1995) + chr(0b11110 + 0o31) + chr(0b101110 + 0o10), 35788 - 35780), ehT0Px3KOsy9(chr(0b110000) + chr(0b100001 + 0o116) + chr(49) + chr(0b110100) + chr(0b110001 + 0o1), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(55) + chr(1291 - 1239), ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(0b110001) + chr(0b110001) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b11000 + 0o127) + '\063' + '\061' + '\x32', 13009 - 13001), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110 + 0o55) + chr(0b100100 + 0o16) + chr(50), 64714 - 64706), ehT0Px3KOsy9('\x30' + chr(11806 - 11695) + chr(1028 - 977) + '\067' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9989 - 9878) + chr(0b110 + 0o54) + chr(0b110001) + chr(0b100101 + 0o17), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11110 + 0o25) + chr(1094 - 1043) + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b101100 + 0o5) + chr(0b110110) + '\060', 56877 - 56869), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10000 + 0o43) + chr(0b110100) + '\x32', 42867 - 42859)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + chr(1998 - 1945) + chr(385 - 337), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x94'), chr(0b1100100 + 0o0) + chr(7959 - 7858) + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(5477 - 5376))(chr(117) + '\164' + chr(0b1100110) + chr(0b11100 + 0o21) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def kliTF55UmDMz(oVre8I6UXc3b, atJVpui1QHD3, PPceYe5Mkdxr): if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2C\xe0'), '\144' + chr(0b1100101) + '\x63' + chr(0b101 + 0o152) + chr(0b1100001 + 0o3) + '\x65')(chr(6596 - 6479) + chr(116) + '\146' + chr(0b101101) + chr(0b111000)))(atJVpui1QHD3): raise Qo48I9Lfg6Hz(atJVpui1QHD3) jJBnSHEgylNZ = oVre8I6UXc3b.get(atJVpui1QHD3) return xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xceM\xcc\xd2f\xe3R\xe6\\\xd3p\xcc'), '\x64' + chr(0b1100101) + chr(0b11001 + 0o112) + chr(111) + chr(0b1100100) + chr(101))('\165' + chr(2935 - 2819) + chr(0b1100110) + '\055' + chr(0b111000)))(PPceYe5Mkdxr)
awslabs/serverless-application-model
samtranslator/policy_template_processor/processor.py
PolicyTemplatesProcessor._is_valid_templates_dict
def _is_valid_templates_dict(policy_templates_dict, schema=None): """ Is this a valid policy template dictionary :param dict policy_templates_dict: Data to be validated :param dict schema: Optional, dictionary containing JSON Schema representing policy template :return: True, if it is valid. :raises ValueError: If the template dictionary doesn't match up with the schema """ if not schema: schema = PolicyTemplatesProcessor._read_schema() try: jsonschema.validate(policy_templates_dict, schema) except ValidationError as ex: # Stringifying the exception will give us useful error message raise ValueError(str(ex)) return True
python
def _is_valid_templates_dict(policy_templates_dict, schema=None): """ Is this a valid policy template dictionary :param dict policy_templates_dict: Data to be validated :param dict schema: Optional, dictionary containing JSON Schema representing policy template :return: True, if it is valid. :raises ValueError: If the template dictionary doesn't match up with the schema """ if not schema: schema = PolicyTemplatesProcessor._read_schema() try: jsonschema.validate(policy_templates_dict, schema) except ValidationError as ex: # Stringifying the exception will give us useful error message raise ValueError(str(ex)) return True
[ "def", "_is_valid_templates_dict", "(", "policy_templates_dict", ",", "schema", "=", "None", ")", ":", "if", "not", "schema", ":", "schema", "=", "PolicyTemplatesProcessor", ".", "_read_schema", "(", ")", "try", ":", "jsonschema", ".", "validate", "(", "policy_templates_dict", ",", "schema", ")", "except", "ValidationError", "as", "ex", ":", "# Stringifying the exception will give us useful error message", "raise", "ValueError", "(", "str", "(", "ex", ")", ")", "return", "True" ]
Is this a valid policy template dictionary :param dict policy_templates_dict: Data to be validated :param dict schema: Optional, dictionary containing JSON Schema representing policy template :return: True, if it is valid. :raises ValueError: If the template dictionary doesn't match up with the schema
[ "Is", "this", "a", "valid", "policy", "template", "dictionary" ]
cccb0c96b5c91e53355ebc07e542467303a5eedd
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/policy_template_processor/processor.py#L103-L122
train
Checks if the given dictionary is a valid policy 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,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,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40_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(0b11111 + 0o21) + '\157' + chr(50) + chr(0b110100) + chr(53), 25790 - 25782), ehT0Px3KOsy9(chr(799 - 751) + chr(111) + chr(50) + chr(607 - 557) + chr(0b101 + 0o56), ord("\x08")), ehT0Px3KOsy9(chr(945 - 897) + chr(111) + chr(0b110001) + chr(53) + chr(49), 38954 - 38946), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1011110 + 0o21) + chr(51) + chr(54) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x37' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + chr(49) + chr(0b10010 + 0o36) + chr(0b10 + 0o64), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(55) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(0b10111 + 0o37) + chr(2177 - 2127), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(240 - 188) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101101 + 0o5) + '\x37' + '\062', 29603 - 29595), ehT0Px3KOsy9('\060' + chr(6393 - 6282) + chr(49) + chr(50) + chr(0b101010 + 0o13), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101010 + 0o10) + '\061' + chr(0b10110 + 0o36), 0o10), ehT0Px3KOsy9(chr(2133 - 2085) + chr(0b1101111) + chr(241 - 193), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11001 + 0o35) + chr(0b1 + 0o65), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1010100 + 0o33) + '\063' + chr(0b11000 + 0o37) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(244 - 196) + chr(111) + chr(0b101 + 0o60) + chr(518 - 464), 42522 - 42514), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(11854 - 11743) + '\063' + '\x33' + '\x37', 0o10), ehT0Px3KOsy9(chr(727 - 679) + chr(0b1101111) + chr(0b10001 + 0o40) + '\x37' + chr(2260 - 2208), 60220 - 60212), ehT0Px3KOsy9(chr(48) + chr(5861 - 5750) + chr(49) + '\062' + '\063', 55800 - 55792), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + chr(0b110111) + chr(0b110111), 57032 - 57024), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + '\x31' + chr(966 - 911) + '\x36', 49508 - 49500), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001 + 0o2) + chr(0b110000) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(1755 - 1704) + chr(50), 17954 - 17946), ehT0Px3KOsy9(chr(804 - 756) + '\157' + chr(0b11001 + 0o30) + chr(0b110001) + chr(1977 - 1922), 0b1000), ehT0Px3KOsy9(chr(827 - 779) + chr(11568 - 11457) + '\x34' + chr(126 - 72), 19294 - 19286), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(111) + '\062' + chr(0b110101) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + '\x31' + chr(48) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100110 + 0o11) + chr(0b110011) + chr(2311 - 2256) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(763 - 715) + chr(111) + chr(417 - 367) + chr(50) + chr(50), 54571 - 54563), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(89 - 39) + chr(2242 - 2191) + chr(0b11111 + 0o22), 27667 - 27659), ehT0Px3KOsy9('\x30' + chr(10620 - 10509) + chr(1528 - 1478) + chr(0b110111) + chr(0b1100 + 0o52), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(218 - 169) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + '\064' + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(0b1100 + 0o45) + chr(1655 - 1606), 0o10), ehT0Px3KOsy9('\x30' + chr(6919 - 6808) + '\x31' + chr(53) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(553 - 499) + '\x31', 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(1662 - 1611) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b110110) + '\x35', 50411 - 50403), ehT0Px3KOsy9(chr(1565 - 1517) + '\x6f' + '\x31' + chr(540 - 489) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1010111 + 0o30) + chr(0b0 + 0o62) + chr(2218 - 2168) + '\x32', 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(9910 - 9799) + '\065' + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8b'), '\x64' + chr(0b1100101) + '\x63' + chr(0b110100 + 0o73) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(45) + chr(0b11100 + 0o34)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def jvdZA73ZS4jd(fHZQrbcOKI0g, P7DmIFVRivx6=None): if not P7DmIFVRivx6: P7DmIFVRivx6 = S6rXq09vaVvy._read_schema() try: xafqLlk3kkUe(kw4VUFR3mYV5, xafqLlk3kkUe(SXOLrMavuUCe(b'\xed\xfd#\xb0C7u\x07\xec\xc9\x01\xbd'), chr(2186 - 2086) + chr(0b1100101) + chr(99) + chr(9806 - 9695) + chr(0b1100100) + chr(101))(chr(0b1100111 + 0o16) + chr(116) + chr(0b101111 + 0o67) + chr(0b100100 + 0o11) + '\x38'))(fHZQrbcOKI0g, P7DmIFVRivx6) except ML1Afw72izmB as DfdhY28yEwAF: raise q1QCh3W88sgk(M8_cKLkHVB2V(DfdhY28yEwAF)) return ehT0Px3KOsy9('\x30' + chr(0b1011001 + 0o26) + chr(0b110001), 21522 - 21514)
pyecharts/pyecharts
pyecharts/render/engine.py
RenderEngine.render_chart_to_file
def render_chart_to_file(self, template_name: str, chart: Any, path: str): """ Render a chart or page to local html files. :param chart: A Chart or Page object :param path: The destination file which the html code write to :param template_name: The name of template file. """ tpl = self.env.get_template(template_name) html = tpl.render(chart=self.generate_js_link(chart)) write_utf8_html_file(path, self._reg_replace(html))
python
def render_chart_to_file(self, template_name: str, chart: Any, path: str): """ Render a chart or page to local html files. :param chart: A Chart or Page object :param path: The destination file which the html code write to :param template_name: The name of template file. """ tpl = self.env.get_template(template_name) html = tpl.render(chart=self.generate_js_link(chart)) write_utf8_html_file(path, self._reg_replace(html))
[ "def", "render_chart_to_file", "(", "self", ",", "template_name", ":", "str", ",", "chart", ":", "Any", ",", "path", ":", "str", ")", ":", "tpl", "=", "self", ".", "env", ".", "get_template", "(", "template_name", ")", "html", "=", "tpl", ".", "render", "(", "chart", "=", "self", ".", "generate_js_link", "(", "chart", ")", ")", "write_utf8_html_file", "(", "path", ",", "self", ".", "_reg_replace", "(", "html", ")", ")" ]
Render a chart or page to local html files. :param chart: A Chart or Page object :param path: The destination file which the html code write to :param template_name: The name of template file.
[ "Render", "a", "chart", "or", "page", "to", "local", "html", "files", "." ]
02050acb0e94bb9453b88a25028de7a0ce23f125
https://github.com/pyecharts/pyecharts/blob/02050acb0e94bb9453b88a25028de7a0ce23f125/pyecharts/render/engine.py#L36-L46
train
Render a chart or page to local html files.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyK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OError,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', 0o10), ehT0Px3KOsy9('\x30' + chr(0b111101 + 0o62) + '\063' + chr(51) + chr(2291 - 2242), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + '\060' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(1330 - 1282) + chr(0b100100 + 0o113) + chr(50) + '\063' + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11111 + 0o23) + chr(0b110 + 0o61) + chr(1830 - 1778), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2133 - 2084) + '\x34' + chr(0b10001 + 0o37), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001101 + 0o42) + chr(619 - 568) + chr(307 - 254), 0b1000), ehT0Px3KOsy9(chr(48) + chr(4466 - 4355) + chr(52) + chr(0b1000 + 0o52), 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1101111) + chr(51) + chr(0b10110 + 0o34), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + '\062' + '\x33', 0b1000), ehT0Px3KOsy9(chr(462 - 414) + '\157' + chr(254 - 204) + chr(0b110000) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(1027 - 979) + chr(0b1101111) + chr(50) + '\060' + chr(50), 0b1000), ehT0Px3KOsy9(chr(128 - 80) + chr(111) + chr(0b1100 + 0o45) + chr(51) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010 + 0o145) + chr(0b110011) + '\x32' + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110101) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(1385 - 1337) + chr(9196 - 9085) + chr(50) + '\061' + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(0b110101) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + '\x33' + '\x36' + chr(0b10101 + 0o36), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1747 - 1636) + chr(50) + chr(0b110111) + '\x33', 0o10), ehT0Px3KOsy9('\060' + chr(0b1100010 + 0o15) + chr(0b110010) + '\x33' + chr(914 - 863), 0o10), ehT0Px3KOsy9(chr(48) + chr(2623 - 2512) + chr(816 - 765) + '\x30' + chr(1410 - 1356), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(0b10110 + 0o36) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(1385 - 1337) + '\157' + chr(0b110011) + chr(0b110101) + '\064', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(0b11010 + 0o34) + chr(2766 - 2713), 45357 - 45349), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + '\063' + '\x31', 8), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(7520 - 7409) + chr(1488 - 1439) + '\060' + chr(0b10011 + 0o35), 0b1000), ehT0Px3KOsy9(chr(48) + chr(10055 - 9944) + chr(0b0 + 0o62) + chr(48) + chr(0b1 + 0o57), 8), ehT0Px3KOsy9(chr(48) + chr(3760 - 3649) + chr(1566 - 1517) + chr(781 - 728) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(111) + chr(49) + chr(953 - 900) + '\066', 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1001 + 0o50) + '\x34', 16919 - 16911), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(0b110010 + 0o3) + chr(0b110100), 8), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\x6f' + chr(0b1010 + 0o47) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(0b100101 + 0o112) + chr(1237 - 1186) + chr(0b110110) + chr(2049 - 2001), 2861 - 2853), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + '\067' + chr(0b11100 + 0o32), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + '\x34' + '\066', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1847 - 1796) + '\064' + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b100100 + 0o17) + '\060' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + '\064' + '\064', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(1789 - 1738) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b110111 + 0o70) + chr(50) + chr(48) + chr(0b110101), 2547 - 2539)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(8559 - 8448) + chr(0b110101) + '\x30', 59709 - 59701)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b')'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(111) + chr(100) + chr(0b1100101))('\165' + '\x74' + chr(0b111010 + 0o54) + chr(45) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def dT_7GudY1JtQ(oVre8I6UXc3b, atJVpui1QHD3, rwbe6ozwQCNO, EaCjyhZptSer): KsdWFDPCt0Uf = oVre8I6UXc3b.env.get_template(atJVpui1QHD3) kK5tVZVlLKWY = KsdWFDPCt0Uf.render(chart=oVre8I6UXc3b.generate_js_link(rwbe6ozwQCNO)) zPm5yTtLxHrw(EaCjyhZptSer, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'X\xab\xe5\xfb\xe3\x12xRv2\xe5\xe7'), '\144' + '\x65' + '\x63' + chr(0b1101111) + chr(100) + chr(4336 - 4235))(chr(117) + '\x74' + chr(0b1100110) + chr(0b101101) + '\070'))(kK5tVZVlLKWY))
pyecharts/pyecharts
pyecharts/render/snapshot.py
decode_base64
def decode_base64(data: str) -> bytes: """Decode base64, padding being optional. :param data: Base64 data as an ASCII byte string :returns: The decoded byte string. """ missing_padding = len(data) % 4 if missing_padding != 0: data += "=" * (4 - missing_padding) return base64.decodebytes(data.encode("utf-8"))
python
def decode_base64(data: str) -> bytes: """Decode base64, padding being optional. :param data: Base64 data as an ASCII byte string :returns: The decoded byte string. """ missing_padding = len(data) % 4 if missing_padding != 0: data += "=" * (4 - missing_padding) return base64.decodebytes(data.encode("utf-8"))
[ "def", "decode_base64", "(", "data", ":", "str", ")", "->", "bytes", ":", "missing_padding", "=", "len", "(", "data", ")", "%", "4", "if", "missing_padding", "!=", "0", ":", "data", "+=", "\"=\"", "*", "(", "4", "-", "missing_padding", ")", "return", "base64", ".", "decodebytes", "(", "data", ".", "encode", "(", "\"utf-8\"", ")", ")" ]
Decode base64, padding being optional. :param data: Base64 data as an ASCII byte string :returns: The decoded byte string.
[ "Decode", "base64", "padding", "being", "optional", "." ]
02050acb0e94bb9453b88a25028de7a0ce23f125
https://github.com/pyecharts/pyecharts/blob/02050acb0e94bb9453b88a25028de7a0ce23f125/pyecharts/render/snapshot.py#L58-L67
train
Decode base64 data as an ASCII byte string.
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,KlP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dP978XkGspL,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(1898 - 1850) + '\x6f' + '\x32' + chr(1708 - 1657) + chr(0b110100), 36540 - 36532), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(0b110010) + chr(51) + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(0b110011) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(9269 - 9158) + chr(0b101011 + 0o7) + '\x30' + chr(0b110111), 33514 - 33506), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(52) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1010011 + 0o34) + '\062' + '\x34' + chr(2069 - 2015), 61690 - 61682), ehT0Px3KOsy9(chr(2102 - 2054) + '\157' + chr(51) + '\x37' + chr(52), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b111 + 0o150) + chr(474 - 423) + '\065' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(8697 - 8586) + chr(0b110011) + '\063' + chr(0b101011 + 0o7), 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(3315 - 3204) + chr(0b11010 + 0o31) + '\060' + chr(1535 - 1481), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(1207 - 1158) + chr(0b110011) + chr(0b10 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b1010 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(580 - 532) + chr(9804 - 9693) + chr(0b110010) + '\060' + '\064', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1264 - 1215) + chr(55) + '\063', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(2441 - 2391) + chr(0b110101) + chr(779 - 729), 60460 - 60452), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1100100 + 0o13) + chr(50) + chr(0b10110 + 0o41), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(0b100111 + 0o16) + '\061', 0b1000), ehT0Px3KOsy9(chr(196 - 148) + '\157' + chr(2236 - 2185) + '\065' + chr(53), 27606 - 27598), ehT0Px3KOsy9('\x30' + chr(618 - 507) + chr(0b1100 + 0o47), 0o10), ehT0Px3KOsy9(chr(797 - 749) + chr(0b1011110 + 0o21) + '\062' + chr(0b110110) + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + chr(11285 - 11174) + chr(0b10010 + 0o40) + chr(0b110010) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + chr(0b1111 + 0o43) + chr(1961 - 1911) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(48) + chr(10487 - 10376) + '\067' + chr(646 - 597), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2073 - 2023) + chr(49) + chr(738 - 689), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2534 - 2483) + chr(432 - 382) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1101101 + 0o2) + chr(49) + chr(48), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(51) + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(1516 - 1466) + chr(1429 - 1379), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100101 + 0o112) + chr(50) + '\x36' + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(51), 0b1000), ehT0Px3KOsy9(chr(1446 - 1398) + chr(111) + chr(0b110010) + chr(391 - 342) + '\x31', 8), ehT0Px3KOsy9('\x30' + chr(10901 - 10790) + '\x31' + '\060' + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101100 + 0o103) + chr(49) + chr(0b110101) + chr(2046 - 1992), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(8348 - 8237) + chr(51) + chr(1717 - 1669) + chr(1377 - 1328), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1348 - 1298) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(0b110101) + chr(0b101100 + 0o5), 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\157' + chr(0b10000 + 0o41) + chr(2512 - 2458) + chr(0b110010 + 0o3), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(48) + chr(0b110110), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + '\x34' + chr(0b11000 + 0o33), 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + chr(0b101111 + 0o10) + chr(50), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(423 - 370) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2'), '\x64' + chr(0b110011 + 0o62) + chr(99) + '\x6f' + chr(0b110111 + 0o55) + chr(101))('\165' + chr(9470 - 9354) + chr(102) + chr(1498 - 1453) + chr(0b101101 + 0o13)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def LRCNL5MyjKwC(ULnjp6D6efFH) -> QOfmzcVJsrp8: FV1APu9Aw1jM = c2A0yzQpDQB3(ULnjp6D6efFH) % ehT0Px3KOsy9('\x30' + '\157' + '\064', ord("\x08")) if FV1APu9Aw1jM != ehT0Px3KOsy9('\060' + chr(0b100100 + 0o113) + '\x30', ord("\x08")): ULnjp6D6efFH += xafqLlk3kkUe(SXOLrMavuUCe(b'\xa1'), chr(0b1001 + 0o133) + chr(0b11110 + 0o107) + chr(99) + '\x6f' + chr(0b111111 + 0o45) + '\x65')('\165' + '\164' + chr(9963 - 9861) + chr(0b101101) + '\x38') * (ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\157' + '\x34', 8) - FV1APu9Aw1jM) return xafqLlk3kkUe(w4uTFQps09Ty, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\xfa\xbd\xe8\xc1\xc3\x9e\x93\xae\xa3*'), '\144' + chr(2162 - 2061) + '\x63' + chr(111) + '\x64' + chr(5051 - 4950))('\165' + chr(7230 - 7114) + '\146' + chr(0b101101) + '\070'))(xafqLlk3kkUe(ULnjp6D6efFH, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9\xf1\xbd\xe8\xc1\xc3'), chr(2596 - 2496) + '\x65' + '\143' + '\x6f' + chr(100) + chr(101))(chr(117) + chr(116) + chr(102) + chr(0b101101) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe9\xeb\xb8\xaa\x9d'), '\144' + chr(6529 - 6428) + '\143' + chr(0b101101 + 0o102) + chr(0b1100100) + chr(101))('\x75' + chr(0b1110100) + '\x66' + chr(0b110 + 0o47) + chr(0b11111 + 0o31))))
pyecharts/pyecharts
pyecharts/charts/basic_charts/tree.py
Tree._set_collapse_interval
def _set_collapse_interval(data, interval): """ 间隔折叠节点,当节点过多时可以解决节点显示过杂间隔。 :param data: 节点数据 :param interval: 指定间隔 """ if interval <= 0: return data if data and isinstance(data, list): for d in data: children = d.get("children", None) if children and interval > 0: for index, value in enumerate(children): if index % interval == 0: value.update(collapsed="false") return data
python
def _set_collapse_interval(data, interval): """ 间隔折叠节点,当节点过多时可以解决节点显示过杂间隔。 :param data: 节点数据 :param interval: 指定间隔 """ if interval <= 0: return data if data and isinstance(data, list): for d in data: children = d.get("children", None) if children and interval > 0: for index, value in enumerate(children): if index % interval == 0: value.update(collapsed="false") return data
[ "def", "_set_collapse_interval", "(", "data", ",", "interval", ")", ":", "if", "interval", "<=", "0", ":", "return", "data", "if", "data", "and", "isinstance", "(", "data", ",", "list", ")", ":", "for", "d", "in", "data", ":", "children", "=", "d", ".", "get", "(", "\"children\"", ",", "None", ")", "if", "children", "and", "interval", ">", "0", ":", "for", "index", ",", "value", "in", "enumerate", "(", "children", ")", ":", "if", "index", "%", "interval", "==", "0", ":", "value", ".", "update", "(", "collapsed", "=", "\"false\"", ")", "return", "data" ]
间隔折叠节点,当节点过多时可以解决节点显示过杂间隔。 :param data: 节点数据 :param interval: 指定间隔
[ "间隔折叠节点,当节点过多时可以解决节点显示过杂间隔。", ":", "param", "data", ":", "节点数据", ":", "param", "interval", ":", "指定间隔" ]
02050acb0e94bb9453b88a25028de7a0ce23f125
https://github.com/pyecharts/pyecharts/blob/02050acb0e94bb9453b88a25028de7a0ce23f125/pyecharts/charts/basic_charts/tree.py#L19-L35
train
Set the collapsed flag of the children of the data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo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_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(2536 - 2425) + chr(0b110011) + chr(1948 - 1898) + chr(0b10110 + 0o36), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1317 - 1268) + chr(50) + chr(52), 0b1000), ehT0Px3KOsy9(chr(763 - 715) + chr(11356 - 11245) + chr(2000 - 1949) + '\x30' + chr(54), 17060 - 17052), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b100111 + 0o13) + chr(0b110011) + chr(1337 - 1286), 0b1000), ehT0Px3KOsy9(chr(776 - 728) + chr(9333 - 9222) + '\x37', 54846 - 54838), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\x6f' + chr(0b110001) + chr(0b110 + 0o55) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + chr(49) + '\x34' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11110 + 0o24) + chr(0b110110) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1566 - 1511) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101010 + 0o5) + chr(50) + '\x32' + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(2326 - 2215) + '\061' + chr(0b110011) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b11011 + 0o32) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + '\063' + chr(0b110011 + 0o3), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110001 + 0o76) + '\x33' + '\x33' + '\x35', 59247 - 59239), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + '\065' + chr(0b110000), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x37' + '\x36', 8), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(1462 - 1408) + '\x33', 60690 - 60682), ehT0Px3KOsy9(chr(450 - 402) + chr(0b1101111) + '\x36' + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101111 + 0o4) + chr(0b110100), 61827 - 61819), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + chr(0b101011 + 0o10) + chr(189 - 137), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(1030 - 980) + '\061' + '\063', 0b1000), ehT0Px3KOsy9(chr(1046 - 998) + chr(0b1101011 + 0o4) + '\x32' + chr(0b110100) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(111) + '\062' + chr(267 - 218) + chr(51), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10110 + 0o34) + chr(0b100000 + 0o26) + chr(2609 - 2554), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(50) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + chr(0b110011) + '\x30' + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + chr(10347 - 10236) + chr(2380 - 2331) + chr(0b101010 + 0o14) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001011 + 0o44) + '\062' + chr(0b1000 + 0o57) + chr(0b1110 + 0o42), 0o10), ehT0Px3KOsy9(chr(1949 - 1901) + chr(0b1101111) + chr(1731 - 1681) + chr(51) + '\063', 8), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(50) + '\x31' + '\x34', 58035 - 58027), ehT0Px3KOsy9(chr(48) + chr(0b110011 + 0o74) + chr(276 - 227) + '\060', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1001010 + 0o45) + '\x32' + chr(54) + chr(0b110111), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\157' + chr(50) + chr(0b100000 + 0o27) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(2012 - 1964) + chr(111) + chr(0b110011 + 0o0) + chr(344 - 294) + chr(0b111 + 0o54), 62892 - 62884), ehT0Px3KOsy9(chr(48) + '\157' + chr(1827 - 1778) + chr(48) + '\x37', 0b1000), ehT0Px3KOsy9(chr(498 - 450) + chr(7613 - 7502) + '\x31' + '\x30' + chr(0b11 + 0o56), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1100000 + 0o17) + '\x34' + chr(848 - 794), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110100) + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(896 - 841) + '\x32', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b10011 + 0o134) + chr(0b110101) + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa'), '\144' + chr(1355 - 1254) + chr(5865 - 5766) + chr(0b10101 + 0o132) + chr(2529 - 2429) + chr(0b10001 + 0o124))('\165' + chr(116) + chr(5376 - 5274) + chr(0b100001 + 0o14) + chr(1437 - 1381)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def wdob_gCMFMNJ(ULnjp6D6efFH, LAc8us3cC7z2): if LAc8us3cC7z2 <= ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1220 - 1172), ord("\x08")): return ULnjp6D6efFH if ULnjp6D6efFH and PlSM16l2KDPD(ULnjp6D6efFH, YyaZ4tpXu4lf): for pd3lxn9vqWxp in ULnjp6D6efFH: fbmcheqacAus = pd3lxn9vqWxp.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7<\xaf\xf7c*\x02\xda'), chr(0b1010000 + 0o24) + chr(101) + chr(6810 - 6711) + '\157' + '\x64' + chr(4216 - 4115))('\165' + chr(0b11111 + 0o125) + chr(0b1100110) + chr(45) + chr(0b111000)), None) if fbmcheqacAus and LAc8us3cC7z2 > ehT0Px3KOsy9(chr(1856 - 1808) + chr(0b1101111) + chr(48), 8): for (XdowRbJKZWL9, QmmgWUB13VCJ) in YlkZvXL8qwsX(fbmcheqacAus): if XdowRbJKZWL9 % LAc8us3cC7z2 == ehT0Px3KOsy9(chr(1474 - 1426) + chr(0b1101111) + chr(0b11000 + 0o30), 8): xafqLlk3kkUe(QmmgWUB13VCJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e \x87\xden\x16-\xdaG\xa4:\x19'), chr(3726 - 3626) + chr(1276 - 1175) + chr(0b1010110 + 0o15) + chr(8909 - 8798) + '\x64' + chr(0b1100101))(chr(1677 - 1560) + chr(0b101110 + 0o106) + chr(0b1011 + 0o133) + '\055' + chr(0b10110 + 0o42)))(collapsed=xafqLlk3kkUe(SXOLrMavuUCe(b'\xb25\xaa\xe8b'), '\x64' + chr(0b110100 + 0o61) + chr(0b1100011) + chr(10554 - 10443) + chr(0b1100100) + chr(0b1010000 + 0o25))(chr(0b1110101) + '\x74' + '\146' + chr(45) + chr(0b10001 + 0o47))) return ULnjp6D6efFH
micropython/micropython
ports/nrf/boards/make-pins.py
parse_pin
def parse_pin(name_str): """Parses a string and returns a pin-num.""" if len(name_str) < 1: raise ValueError("Expecting pin name to be at least 4 charcters.") if name_str[0] != 'P': raise ValueError("Expecting pin name to start with P") pin_str = name_str[1:].split('/')[0] if not pin_str.isdigit(): raise ValueError("Expecting numeric pin number.") return int(pin_str)
python
def parse_pin(name_str): """Parses a string and returns a pin-num.""" if len(name_str) < 1: raise ValueError("Expecting pin name to be at least 4 charcters.") if name_str[0] != 'P': raise ValueError("Expecting pin name to start with P") pin_str = name_str[1:].split('/')[0] if not pin_str.isdigit(): raise ValueError("Expecting numeric pin number.") return int(pin_str)
[ "def", "parse_pin", "(", "name_str", ")", ":", "if", "len", "(", "name_str", ")", "<", "1", ":", "raise", "ValueError", "(", "\"Expecting pin name to be at least 4 charcters.\"", ")", "if", "name_str", "[", "0", "]", "!=", "'P'", ":", "raise", "ValueError", "(", "\"Expecting pin name to start with P\"", ")", "pin_str", "=", "name_str", "[", "1", ":", "]", ".", "split", "(", "'/'", ")", "[", "0", "]", "if", "not", "pin_str", ".", "isdigit", "(", ")", ":", "raise", "ValueError", "(", "\"Expecting numeric pin number.\"", ")", "return", "int", "(", "pin_str", ")" ]
Parses a string and returns a pin-num.
[ "Parses", "a", "string", "and", "returns", "a", "pin", "-", "num", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/bl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K2y6HRbn,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(0b100 + 0o54) + chr(111) + chr(1860 - 1810) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + chr(0b110011 + 0o74) + '\x35' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(873 - 825) + '\157' + '\062' + chr(0b0 + 0o62) + chr(2486 - 2434), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(1765 - 1714) + '\065', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b100111 + 0o12) + chr(52) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(460 - 410) + chr(0b10 + 0o64) + '\x34', 62880 - 62872), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(0b10001 + 0o45) + '\x32', 4072 - 4064), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1011111 + 0o20) + chr(1331 - 1279) + chr(0b110011 + 0o3), ord("\x08")), ehT0Px3KOsy9(chr(1897 - 1849) + chr(11833 - 11722) + '\x33' + chr(1019 - 970) + chr(0b11100 + 0o33), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(0b110011) + chr(0b100 + 0o60), 0o10), ehT0Px3KOsy9(chr(48) + chr(6021 - 5910) + chr(0b110001) + chr(0b110110) + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b110011 + 0o3) + '\067', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(2452 - 2399) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(5730 - 5619) + '\x33' + chr(55) + chr(0b11110 + 0o22), 30362 - 30354), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + '\065' + '\x37', 0b1000), ehT0Px3KOsy9(chr(2284 - 2236) + chr(6068 - 5957) + chr(0b110011) + chr(0b10000 + 0o43) + '\x33', 41733 - 41725), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(53) + chr(78 - 23), 8), ehT0Px3KOsy9('\060' + chr(0b10010 + 0o135) + chr(49) + chr(1685 - 1635) + chr(1957 - 1905), 0o10), ehT0Px3KOsy9(chr(1852 - 1804) + chr(0b1101111) + chr(0b11 + 0o57) + chr(50) + chr(0b10010 + 0o44), 61157 - 61149), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(111) + chr(0b10011 + 0o36) + '\x37' + chr(1989 - 1934), 0o10), ehT0Px3KOsy9(chr(223 - 175) + chr(11517 - 11406) + chr(2049 - 1998) + '\x37' + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b100111 + 0o14) + chr(0b110001 + 0o1) + chr(1781 - 1731), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101011 + 0o4) + '\067' + chr(0b110010), 50399 - 50391), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(5958 - 5847) + '\x34', 0o10), ehT0Px3KOsy9('\060' + chr(516 - 405) + chr(54) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1010001 + 0o36) + chr(55) + chr(0b110101 + 0o2), 0b1000), ehT0Px3KOsy9('\060' + chr(11366 - 11255) + chr(0b110001) + '\064' + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(0b1110 + 0o47), 0b1000), ehT0Px3KOsy9(chr(1947 - 1899) + '\x6f' + chr(50) + '\060' + chr(53), 0b1000), ehT0Px3KOsy9('\060' + chr(5077 - 4966) + chr(51) + '\x37' + chr(0b100111 + 0o15), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(626 - 576) + '\065' + '\065', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101010 + 0o10) + chr(0b10011 + 0o44) + '\065', 49320 - 49312), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b101110 + 0o101) + chr(49) + chr(0b110001) + chr(0b11101 + 0o32), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + '\x37' + chr(2340 - 2288), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11054 - 10943) + chr(0b110001) + '\063' + chr(2818 - 2763), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(54), 56034 - 56026), ehT0Px3KOsy9('\x30' + '\157' + '\x36', 30705 - 30697), ehT0Px3KOsy9(chr(48) + chr(8348 - 8237) + chr(2795 - 2742) + chr(1854 - 1799), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1973 - 1921) + chr(50), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1421 - 1373) + '\157' + chr(0b110101) + chr(0b101 + 0o53), 24694 - 24686)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'='), chr(100) + chr(101) + chr(99) + chr(0b110101 + 0o72) + chr(0b1100100) + '\x65')('\165' + chr(5398 - 5282) + chr(102) + chr(456 - 411) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def M4yNuKVJfFEI(lOIp6cZfqen3): if c2A0yzQpDQB3(lOIp6cZfqen3) < ehT0Px3KOsy9(chr(0b110000) + chr(10706 - 10595) + chr(0b110001), ord("\x08")): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'VU\xe4x\x01\xc0[H\xa8|\x01\xde\x03\xd8\xc1\xba\xc21\xb6\x0b\x94?\xb0_$TKEy\xe0\x9d\xde\xc9oH\x7f}nNPpY\xf1o\x11\x9a'), chr(9188 - 9088) + '\x65' + chr(0b1100011) + chr(0b1101111) + chr(0b1011110 + 0o6) + chr(0b1100101))(chr(117) + '\164' + chr(3881 - 3779) + '\055' + chr(0b111000))) if lOIp6cZfqen3[ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x30', ord("\x08"))] != xafqLlk3kkUe(SXOLrMavuUCe(b'C'), chr(0b1100100) + '\145' + chr(99) + chr(111) + chr(0b1000111 + 0o35) + chr(0b1000 + 0o135))(chr(0b1110101) + '\164' + '\x66' + '\x2d' + chr(0b111000)): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'VU\xe4x\x01\xc0[H\xa8|\x01\xde\x03\xd8\xc1\xba\xc21\xb6\x0b\x94?\xa1NeGKEb\xec\x88\xc5\x9d\x1f'), '\144' + '\145' + '\143' + chr(10290 - 10179) + '\x64' + chr(9580 - 9479))(chr(117) + chr(116) + '\x66' + chr(0b101101) + chr(56))) GpkZxDMMzeOO = lOIp6cZfqen3[ehT0Px3KOsy9('\x30' + chr(3443 - 3332) + '\061', 8):].split(xafqLlk3kkUe(SXOLrMavuUCe(b'<'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(0b100011 + 0o101) + '\145')(chr(11683 - 11566) + chr(0b1000111 + 0o55) + chr(0b1100110) + '\x2d' + '\x38'))[ehT0Px3KOsy9('\060' + chr(0b10110 + 0o131) + chr(2158 - 2110), 8)] if not xafqLlk3kkUe(GpkZxDMMzeOO, xafqLlk3kkUe(SXOLrMavuUCe(b'z^\xf0t\x05\xddF'), '\144' + chr(0b1100101) + chr(0b1010111 + 0o14) + chr(0b1101111) + chr(100) + chr(0b1100101))('\165' + chr(116) + chr(10224 - 10122) + chr(0b10001 + 0o34) + chr(56)))(): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'VU\xe4x\x01\xc0[H\xa8|\x1f\xc2\x00\x9d\xdd\xb2\xcct\xe6\x16\x95?\xbcOiWZ\x17;'), chr(0b1100001 + 0o3) + chr(2927 - 2826) + chr(7903 - 7804) + '\157' + chr(4038 - 3938) + chr(0b1011000 + 0o15))(chr(117) + chr(8534 - 8418) + '\x66' + chr(0b101101) + '\x38')) return ehT0Px3KOsy9(GpkZxDMMzeOO)
micropython/micropython
ports/nrf/boards/make-pins.py
AlternateFunction.ptr
def ptr(self): """Returns the numbered function (i.e. USART6) for this AF.""" if self.fn_num is None: return self.func return '{:s}{:d}'.format(self.func, self.fn_num)
python
def ptr(self): """Returns the numbered function (i.e. USART6) for this AF.""" if self.fn_num is None: return self.func return '{:s}{:d}'.format(self.func, self.fn_num)
[ "def", "ptr", "(", "self", ")", ":", "if", "self", ".", "fn_num", "is", "None", ":", "return", "self", ".", "func", "return", "'{:s}{:d}'", ".", "format", "(", "self", ".", "func", ",", "self", ".", "fn_num", ")" ]
Returns the numbered function (i.e. USART6) for this AF.
[ "Returns", "the", "numbered", "function", "(", "i", ".", "e", ".", "USART6", ")", "for", "this", "AF", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/ports/nrf/boards/make-pins.py#L61-L65
train
Returns the numbered function name for this AF.
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,QWgp4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M16l2KDPD,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(0b101100 + 0o103) + '\x33' + chr(155 - 102) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + '\063', 20843 - 20835), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(1472 - 1361) + '\x32' + chr(50) + '\x34', 29661 - 29653), ehT0Px3KOsy9(chr(1257 - 1209) + chr(111) + chr(0b10 + 0o61) + '\060', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(1596 - 1545) + chr(0b110010) + chr(0b101010 + 0o10), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(0b110010) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(51) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + chr(982 - 931) + chr(0b110001) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(111) + chr(0b10010 + 0o43) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(50) + chr(2070 - 2017), 47263 - 47255), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(1450 - 1402) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(1297 - 1249) + '\x6f' + chr(0b11011 + 0o26) + chr(0b110101) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(55) + chr(0b110100), 54998 - 54990), ehT0Px3KOsy9(chr(0b110000) + chr(0b101110 + 0o101) + chr(0b10101 + 0o35) + chr(0b110000) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1001001 + 0o46) + chr(0b101001 + 0o10) + '\063' + chr(51), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10110 + 0o33) + chr(0b100000 + 0o23) + chr(49), 45584 - 45576), ehT0Px3KOsy9(chr(1116 - 1068) + chr(3302 - 3191) + '\x32' + chr(0b110110) + chr(2972 - 2917), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10 + 0o61) + chr(49) + chr(0b11111 + 0o30), 8), ehT0Px3KOsy9(chr(927 - 879) + '\157' + chr(0b110001) + chr(54) + '\x34', 51608 - 51600), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(111) + chr(0b10000 + 0o42) + chr(0b110011) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(579 - 528) + '\067' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + chr(1179 - 1130) + chr(1955 - 1905) + '\064', 21739 - 21731), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11011 + 0o31) + chr(0b110001), 59162 - 59154), ehT0Px3KOsy9('\x30' + chr(11638 - 11527) + chr(57 - 8) + '\x35' + chr(0b110101), 157 - 149), ehT0Px3KOsy9('\x30' + chr(0b1010101 + 0o32) + chr(51) + chr(55) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(595 - 547) + '\x6f' + chr(0b110011) + '\x33' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101111) + chr(0b1001 + 0o52) + '\x36' + chr(50), 46776 - 46768), ehT0Px3KOsy9('\x30' + chr(0b101001 + 0o106) + chr(2232 - 2183) + chr(0b110110) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b1101 + 0o52) + chr(53), 37708 - 37700), ehT0Px3KOsy9(chr(1690 - 1642) + chr(7877 - 7766) + chr(0b110011) + chr(0b110001) + '\x34', 61499 - 61491), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(0b110000 + 0o7) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101100 + 0o103) + chr(49) + chr(52) + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(0b11110 + 0o22) + '\x35', 0o10), ehT0Px3KOsy9(chr(1878 - 1830) + chr(10863 - 10752) + '\064' + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + chr(0b1010000 + 0o37) + chr(0b110001) + chr(55) + chr(0b101010 + 0o11), 0b1000), ehT0Px3KOsy9(chr(543 - 495) + '\157' + '\x32' + chr(0b110011) + chr(48), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + '\066' + chr(0b110011 + 0o4), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + '\062' + '\x34', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b110011) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011 + 0o4) + chr(52), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + '\x35' + chr(1560 - 1512), 54280 - 54272)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc6'), '\144' + chr(101) + '\143' + chr(111) + '\144' + chr(0b1001101 + 0o30))('\x75' + '\164' + chr(0b1010111 + 0o17) + '\055' + chr(0b110100 + 0o4)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def fPrm__kfjfnQ(oVre8I6UXc3b): if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8ee\xcbv\xa7\xfc'), '\144' + chr(7161 - 7060) + chr(0b1010011 + 0o20) + chr(0b1101111) + chr(0b111000 + 0o54) + chr(0b1001000 + 0o35))(chr(0b1110101) + chr(116) + chr(6058 - 5956) + '\x2d' + chr(0b111000))) is None: return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xadq\xdbl\x98\xa24\xade\xe0\xb8Z'), '\144' + chr(597 - 496) + chr(3291 - 3192) + chr(0b1101111) + '\x64' + '\145')('\x75' + chr(116) + '\146' + chr(0b101101) + chr(2410 - 2354))) return xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x931\xe7e\xa9\xab;\xb2'), chr(0b1010100 + 0o20) + chr(0b1100101) + '\143' + chr(7573 - 7462) + '\x64' + chr(101))(chr(0b1110101) + chr(116) + chr(102) + chr(1232 - 1187) + chr(1879 - 1823)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe?\xe6w\x9a\xf0\x0c\xfc~\xa5\xa5\x04'), '\144' + chr(8803 - 8702) + chr(0b1100011) + chr(111) + chr(2978 - 2878) + '\x65')(chr(0b10101 + 0o140) + chr(0b1110100) + chr(102) + '\x2d' + '\070'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xadq\xdbl\x98\xa24\xade\xe0\xb8Z'), chr(0b100000 + 0o104) + chr(101) + '\x63' + '\x6f' + '\x64' + '\x65')(chr(8409 - 8292) + chr(116) + chr(0b1100110) + chr(2021 - 1976) + '\x38')), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8ee\xcbv\xa7\xfc'), '\x64' + '\145' + chr(0b1100011) + chr(5274 - 5163) + '\x64' + chr(101))(chr(0b1110101) + chr(11620 - 11504) + chr(3450 - 3348) + chr(45) + '\070')))
micropython/micropython
ports/nrf/boards/make-pins.py
AlternateFunction.print
def print(self): """Prints the C representation of this AF.""" if self.supported: print(' AF', end='') else: print(' //', end='') fn_num = self.fn_num if fn_num is None: fn_num = 0 print('({:2d}, {:8s}, {:2d}, {:10s}, {:8s}), // {:s}'.format(self.idx, self.func, fn_num, self.pin_type, self.ptr(), self.af_str))
python
def print(self): """Prints the C representation of this AF.""" if self.supported: print(' AF', end='') else: print(' //', end='') fn_num = self.fn_num if fn_num is None: fn_num = 0 print('({:2d}, {:8s}, {:2d}, {:10s}, {:8s}), // {:s}'.format(self.idx, self.func, fn_num, self.pin_type, self.ptr(), self.af_str))
[ "def", "print", "(", "self", ")", ":", "if", "self", ".", "supported", ":", "print", "(", "' AF'", ",", "end", "=", "''", ")", "else", ":", "print", "(", "' //'", ",", "end", "=", "''", ")", "fn_num", "=", "self", ".", "fn_num", "if", "fn_num", "is", "None", ":", "fn_num", "=", "0", "print", "(", "'({:2d}, {:8s}, {:2d}, {:10s}, {:8s}), // {:s}'", ".", "format", "(", "self", ".", "idx", ",", "self", ".", "func", ",", "fn_num", ",", "self", ".", "pin_type", ",", "self", ".", "ptr", "(", ")", ",", "self", ".", "af_str", ")", ")" ]
Prints the C representation of this AF.
[ "Prints", "the", "C", "representation", "of", "this", "AF", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/ports/nrf/boards/make-pins.py#L70-L80
train
Prints the C representation of this AF.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB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cessError,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(0b10011 + 0o35) + chr(6595 - 6484) + chr(0b100001 + 0o25) + '\062', 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + chr(0b11011 + 0o26) + chr(0b110000) + '\066', 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(8580 - 8469) + chr(0b110000 + 0o3) + chr(272 - 223) + chr(665 - 615), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(1968 - 1914) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101001 + 0o106) + chr(331 - 281) + chr(454 - 405) + chr(0b101110 + 0o5), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\x6f' + '\x31' + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1010 + 0o145) + chr(621 - 572) + chr(50) + chr(2011 - 1960), 46994 - 46986), ehT0Px3KOsy9(chr(1118 - 1070) + chr(2246 - 2135) + '\061' + '\061' + chr(0b110000), 13090 - 13082), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(55) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b10000 + 0o137) + chr(2058 - 2009) + chr(2182 - 2131) + '\x32', 20795 - 20787), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + '\x36' + chr(889 - 834), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111 + 0o0) + '\063' + chr(54) + chr(0b110000), 9486 - 9478), ehT0Px3KOsy9(chr(637 - 589) + '\x6f' + chr(679 - 628) + '\x37' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11449 - 11338) + chr(2286 - 2237) + chr(1095 - 1046) + chr(2446 - 2391), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(49) + chr(0b1 + 0o60), 20429 - 20421), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + '\067' + '\x31', 45204 - 45196), ehT0Px3KOsy9('\060' + chr(9179 - 9068) + chr(0b101000 + 0o12) + chr(0b110001) + chr(0b110011), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100001 + 0o20) + '\x30' + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\x6f' + chr(0b110011) + '\062' + chr(2842 - 2788), 16248 - 16240), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(388 - 338) + chr(49), 0b1000), ehT0Px3KOsy9('\060' + chr(0b111000 + 0o67) + chr(0b1000 + 0o51) + '\x37' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1517 - 1468) + '\x37' + chr(819 - 767), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(55) + '\065', 25111 - 25103), ehT0Px3KOsy9('\x30' + '\x6f' + chr(936 - 885), 0b1000), ehT0Px3KOsy9(chr(1497 - 1449) + chr(3948 - 3837) + '\x32' + chr(313 - 258) + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(1085 - 1035) + '\065' + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10111 + 0o130) + '\x31' + chr(55) + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(50) + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(48) + chr(1138 - 1090), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101111) + '\062' + '\x30', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(1868 - 1819) + chr(54) + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11100 + 0o123) + '\x31' + chr(0b110111) + chr(719 - 670), 8), ehT0Px3KOsy9(chr(1590 - 1542) + '\x6f' + chr(0b110010) + '\x34' + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(0b1111 + 0o47) + chr(2373 - 2319), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(0b100111 + 0o14) + chr(0b100101 + 0o21), 47211 - 47203), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + chr(2056 - 2002) + chr(0b110110), 8), ehT0Px3KOsy9(chr(48) + chr(2186 - 2075) + chr(251 - 202) + chr(53) + '\064', 3677 - 3669), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + '\x31' + chr(0b110100) + chr(0b110010), 5229 - 5221)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1001111 + 0o40) + chr(0b110101) + chr(0b11000 + 0o30), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x1c'), '\x64' + chr(0b1100101) + chr(99) + '\157' + chr(0b1100100) + '\145')(chr(0b1110101) + '\164' + '\x66' + chr(981 - 936) + chr(741 - 685)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def zLUzGokYBM2Z(oVre8I6UXc3b): if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'A3\xba\xc2a\xf9|l7'), chr(4971 - 4871) + chr(0b1100101) + '\x63' + chr(111) + '\x64' + chr(6429 - 6328))('\x75' + '\164' + chr(4238 - 4136) + '\x2d' + chr(2321 - 2265))): zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\x12f\x8b\xf4'), '\144' + chr(5278 - 5177) + chr(0b1110 + 0o125) + '\157' + chr(0b1100100) + chr(101))(chr(6064 - 5947) + chr(0b1110100) + chr(2659 - 2557) + chr(45) + chr(56)), end=xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(5405 - 5305) + '\145' + '\143' + '\x6f' + chr(3911 - 3811) + chr(4289 - 4188))('\165' + chr(0b10101 + 0o137) + chr(0b1000 + 0o136) + chr(45) + chr(1155 - 1099))) else: zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\x12f\xe5\x9d'), '\x64' + chr(101) + chr(0b1100011) + '\157' + chr(100) + chr(0b1001 + 0o134))(chr(117) + chr(116) + '\146' + chr(0b100010 + 0o13) + chr(0b111000)), end=xafqLlk3kkUe(SXOLrMavuUCe(b''), '\144' + chr(101) + chr(99) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(5067 - 4950) + '\164' + chr(0b11001 + 0o115) + chr(0b11101 + 0o20) + '\x38')) hy7cXWa6yez2 = oVre8I6UXc3b.fn_num if hy7cXWa6yez2 is None: hy7cXWa6yez2 = ehT0Px3KOsy9(chr(48) + chr(6764 - 6653) + chr(0b110000), ord("\x08")) zLUzGokYBM2Z(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a=\xf0\x80j\xf6$)(r\x07)\xca\xdc\xd84\xf3K\xef<\xfa\xf1\x00F\x0c3\xcd\xd3V\xb0\xfb*L\n\xdb\xdf\xf2\xd6CM\x12=\xf0\xc1s'), '\144' + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(6287 - 6187) + '\145')('\x75' + chr(116) + chr(102) + '\055' + chr(0b1000 + 0o60)), xafqLlk3kkUe(SXOLrMavuUCe(b'dr\xb8\xddF\xea[:\x038Z0'), '\144' + chr(0b10111 + 0o116) + '\x63' + '\x6f' + chr(9122 - 9022) + '\x65')('\165' + '\164' + '\146' + chr(45) + '\070'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'k*\xbb\xc7}\xd2J?\x1a&T\x17'), chr(0b1100100) + chr(0b1000110 + 0o37) + chr(99) + chr(0b1101111) + chr(0b1100100) + '\x65')('\165' + chr(0b1110100) + chr(0b1100110) + chr(0b1101 + 0o40) + '\070')), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'w<\x85\xc6D\xb8ck\x18}Gn'), chr(0b1100100) + chr(101) + chr(9354 - 9255) + chr(11660 - 11549) + chr(100) + '\x65')(chr(0b1011000 + 0o35) + '\164' + chr(4782 - 4680) + '\x2d' + chr(0b101000 + 0o20))), hy7cXWa6yez2, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'B/\xa4\xedz\xf2xl'), '\144' + chr(0b110 + 0o137) + chr(0b1100011) + chr(111) + chr(5218 - 5118) + '\145')(chr(0b1110010 + 0o3) + '\x74' + chr(0b101111 + 0o67) + chr(0b101100 + 0o1) + chr(0b110101 + 0o3))), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'B2\xb8'), '\x64' + chr(0b1100101) + chr(0b110010 + 0o61) + chr(650 - 539) + chr(0b1100100) + chr(435 - 334))('\165' + chr(0b1110100) + chr(924 - 822) + '\x2d' + '\x38'))(), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'S \x95\xc1z\xf9'), '\144' + chr(5450 - 5349) + chr(99) + chr(0b1101111) + chr(0b1010 + 0o132) + chr(0b101101 + 0o70))(chr(0b1110101) + chr(116) + '\x66' + chr(800 - 755) + chr(56)))))
micropython/micropython
examples/switch.py
run_loop
def run_loop(leds=all_leds): """ Start the loop. :param `leds`: Which LEDs to light up upon switch press. :type `leds`: sequence of LED objects """ print('Loop started.\nPress Ctrl+C to break out of the loop.') while 1: try: if switch(): [led.on() for led in leds] else: [led.off() for led in leds] except OSError: # VCPInterrupt # Ctrl+C in interpreter mode. break
python
def run_loop(leds=all_leds): """ Start the loop. :param `leds`: Which LEDs to light up upon switch press. :type `leds`: sequence of LED objects """ print('Loop started.\nPress Ctrl+C to break out of the loop.') while 1: try: if switch(): [led.on() for led in leds] else: [led.off() for led in leds] except OSError: # VCPInterrupt # Ctrl+C in interpreter mode. break
[ "def", "run_loop", "(", "leds", "=", "all_leds", ")", ":", "print", "(", "'Loop started.\\nPress Ctrl+C to break out of the loop.'", ")", "while", "1", ":", "try", ":", "if", "switch", "(", ")", ":", "[", "led", ".", "on", "(", ")", "for", "led", "in", "leds", "]", "else", ":", "[", "led", ".", "off", "(", ")", "for", "led", "in", "leds", "]", "except", "OSError", ":", "# VCPInterrupt # Ctrl+C in interpreter mode.", "break" ]
Start the loop. :param `leds`: Which LEDs to light up upon switch press. :type `leds`: sequence of LED objects
[ "Start", "the", "loop", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/examples/switch.py#L27-L42
train
Start the loop.
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,_bikz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IaWE,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(0b101101 + 0o4) + '\x31' + chr(53), 58259 - 58251), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1122 - 1071) + chr(48), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + '\x33' + chr(0b10011 + 0o42), 0b1000), ehT0Px3KOsy9(chr(48) + chr(4674 - 4563) + chr(54) + chr(49), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101100 + 0o5) + chr(707 - 654) + '\064', 30738 - 30730), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(51) + '\065', 41310 - 41302), ehT0Px3KOsy9(chr(1813 - 1765) + chr(0b1101111) + chr(1455 - 1402) + '\062', 0o10), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1001101 + 0o42) + chr(0b110001) + chr(0b100111 + 0o17) + chr(0b100111 + 0o16), 0b1000), ehT0Px3KOsy9(chr(451 - 403) + '\x6f' + chr(51) + chr(53) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(175 - 126) + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + '\060' + chr(0b101100 + 0o6), 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(1747 - 1636) + chr(0b10101 + 0o36) + chr(0b110 + 0o53) + chr(1106 - 1058), 0b1000), ehT0Px3KOsy9(chr(48) + chr(8912 - 8801) + chr(0b101110 + 0o10), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1001011 + 0o44) + chr(0b110010) + '\x34' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101100 + 0o103) + chr(50) + chr(0b110011) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + chr(6526 - 6415) + chr(0b11000 + 0o32) + chr(0b11 + 0o56) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + chr(0b110011) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(5027 - 4916) + '\061' + chr(49) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(52) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11295 - 11184) + chr(1692 - 1642) + chr(0b110000) + chr(1663 - 1612), ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(9918 - 9807) + chr(2092 - 2041) + chr(2358 - 2306) + chr(2464 - 2411), 0b1000), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1000000 + 0o57) + chr(2087 - 2036) + chr(0b1011 + 0o47) + chr(0b110100), 30753 - 30745), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011 + 0o4) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(11537 - 11426) + chr(2387 - 2338) + chr(0b11001 + 0o31) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(11209 - 11098) + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b110111) + chr(52), 42047 - 42039), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(4513 - 4402) + chr(0b100010 + 0o24) + chr(49), 8), ehT0Px3KOsy9(chr(48) + chr(0b10101 + 0o132) + '\061' + chr(1519 - 1470) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(0b10111 + 0o37) + '\x35', 8), ehT0Px3KOsy9(chr(745 - 697) + '\157' + chr(51) + chr(0b1010 + 0o50) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(4386 - 4275) + '\x33' + chr(0b11010 + 0o32) + '\065', 8), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1001001 + 0o46) + chr(2530 - 2479) + chr(1829 - 1777) + chr(0b110101), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(710 - 659) + chr(0b0 + 0o65), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1001 + 0o52) + '\x36' + '\x35', 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1011001 + 0o26) + '\x32' + chr(52), 63735 - 63727), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(53) + chr(52), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110100) + chr(0b11111 + 0o27), 0b1000), ehT0Px3KOsy9('\060' + chr(0b101111 + 0o100) + '\x33' + '\x33' + chr(53), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + '\x35' + chr(0b11110 + 0o22), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'c'), chr(0b1100100) + chr(0b100111 + 0o76) + chr(0b100010 + 0o101) + '\x6f' + chr(0b1100100) + chr(0b1100101))('\x75' + chr(1732 - 1616) + '\146' + chr(45) + chr(0b100 + 0o64)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def JTMT93GTHFMN(TRu_QKUUwk0S=i5mUFawyh259): zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\x01whm\x11\x1f\xa9K\x07\x9bj\xe6\xe6\x0c\xf3\xef\xechzjc\xf7\x97\xb8\x15\x12%\x88^o\x17\xa5\x80\x84\xf6\xd5{\x19R\xfd"~\'iY\t\xfdF\x1a\x80\x7f\xac'), chr(0b1100100) + chr(4522 - 4421) + chr(0b1100011) + chr(0b1101111) + '\144' + '\145')(chr(0b111111 + 0o66) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + '\070')) while ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001), 26162 - 26154): try: if GkrBTAdgX8F6(): [xafqLlk3kkUe(uIPV0C3Ih5d8, xafqLlk3kkUe(SXOLrMavuUCe(b'"v'), chr(1148 - 1048) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(7732 - 7632) + chr(2693 - 2592))(chr(2738 - 2621) + chr(116) + chr(102) + '\x2d' + chr(0b111000)))() for uIPV0C3Ih5d8 in TRu_QKUUwk0S] else: [xafqLlk3kkUe(uIPV0C3Ih5d8, xafqLlk3kkUe(SXOLrMavuUCe(b'"~a'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b110000 + 0o77) + chr(0b1100100) + '\x65')(chr(2580 - 2463) + '\x74' + '\146' + '\055' + '\x38'))() for uIPV0C3Ih5d8 in TRu_QKUUwk0S] except KlPSljPzIJ_u: break
micropython/micropython
py/makemoduledefs.py
find_c_file
def find_c_file(obj_file, vpath): """ Search vpaths for the c file that matches the provided object_file. :param str obj_file: object file to find the matching c file for :param List[str] vpath: List of base paths, similar to gcc vpath :return: str path to c file or None """ c_file = None relative_c_file = os.path.splitext(obj_file)[0] + ".c" relative_c_file = relative_c_file.lstrip('/\\') for p in vpath: possible_c_file = os.path.join(p, relative_c_file) if os.path.exists(possible_c_file): c_file = possible_c_file break return c_file
python
def find_c_file(obj_file, vpath): """ Search vpaths for the c file that matches the provided object_file. :param str obj_file: object file to find the matching c file for :param List[str] vpath: List of base paths, similar to gcc vpath :return: str path to c file or None """ c_file = None relative_c_file = os.path.splitext(obj_file)[0] + ".c" relative_c_file = relative_c_file.lstrip('/\\') for p in vpath: possible_c_file = os.path.join(p, relative_c_file) if os.path.exists(possible_c_file): c_file = possible_c_file break return c_file
[ "def", "find_c_file", "(", "obj_file", ",", "vpath", ")", ":", "c_file", "=", "None", "relative_c_file", "=", "os", ".", "path", ".", "splitext", "(", "obj_file", ")", "[", "0", "]", "+", "\".c\"", "relative_c_file", "=", "relative_c_file", ".", "lstrip", "(", "'/\\\\'", ")", "for", "p", "in", "vpath", ":", "possible_c_file", "=", "os", ".", "path", ".", "join", "(", "p", ",", "relative_c_file", ")", "if", "os", ".", "path", ".", "exists", "(", "possible_c_file", ")", ":", "c_file", "=", "possible_c_file", "break", "return", "c_file" ]
Search vpaths for the c file that matches the provided object_file. :param str obj_file: object file to find the matching c file for :param List[str] vpath: List of base paths, similar to gcc vpath :return: str path to c file or None
[ "Search", "vpaths", "for", "the", "c", "file", "that", "matches", "the", "provided", "object_file", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/py/makemoduledefs.py#L22-L38
train
Search vpaths for the c file that matches the provided object file.
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,FXUco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9a1WNS,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' + chr(48) + chr(0b110101), 45023 - 45015), ehT0Px3KOsy9(chr(48) + chr(0b1001 + 0o146) + chr(49) + '\067' + chr(53), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101101 + 0o5) + chr(54) + chr(54), 0b1000), ehT0Px3KOsy9(chr(226 - 178) + chr(111) + '\x33' + chr(132 - 84) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b10100 + 0o133) + '\x33' + '\x37' + chr(0b101 + 0o54), 43446 - 43438), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b110101) + chr(55), 6393 - 6385), ehT0Px3KOsy9(chr(702 - 654) + '\157' + chr(0b101101 + 0o10) + chr(54), 49473 - 49465), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + '\066' + chr(2636 - 2584), 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + '\x31' + chr(0b11 + 0o63) + chr(0b110001), 18287 - 18279), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2381 - 2332) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(0b1011 + 0o53) + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b100 + 0o55) + '\x34' + chr(0b101010 + 0o10), 0b1000), ehT0Px3KOsy9('\060' + chr(0b101 + 0o152) + '\061' + chr(0b11000 + 0o30), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(50) + '\x31' + chr(53), 55664 - 55656), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b101100 + 0o4) + chr(1374 - 1319), ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1101111) + '\061' + chr(0b110011) + chr(0b100010 + 0o21), 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\157' + chr(0b110001 + 0o2) + '\062' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(300 - 252) + '\157' + chr(0b110101) + chr(55), 0b1000), ehT0Px3KOsy9(chr(1660 - 1612) + '\157' + '\063' + chr(0b110010 + 0o3) + chr(1846 - 1791), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1821 - 1771) + chr(52) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(111) + chr(1910 - 1860) + chr(0b110111) + '\063', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b101001 + 0o11) + '\062' + chr(485 - 434), 0b1000), ehT0Px3KOsy9('\x30' + chr(5210 - 5099) + chr(0b110111) + chr(55), 41319 - 41311), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(55) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(417 - 369) + chr(0b1101111) + chr(0b1110 + 0o47) + chr(0b1111 + 0o50), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b0 + 0o63) + '\x37' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(3258 - 3147) + chr(0b110 + 0o54) + '\x37', 28660 - 28652), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + '\x35' + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\x6f' + chr(0b110001) + '\060', 8), ehT0Px3KOsy9(chr(48) + chr(1221 - 1110) + chr(0b100000 + 0o21) + chr(0b110100) + '\060', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101 + 0o54) + '\x31' + chr(51), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b110001) + '\x31', 33056 - 33048), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(565 - 515) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(8347 - 8236) + chr(51) + chr(52) + chr(0b100 + 0o57), 0o10), ehT0Px3KOsy9(chr(1280 - 1232) + '\x6f' + chr(90 - 40) + '\066' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(10469 - 10358) + chr(0b1110 + 0o45) + '\x35' + chr(48), 0b1000), ehT0Px3KOsy9(chr(307 - 259) + '\157' + chr(0b10100 + 0o35) + chr(50) + chr(0b10001 + 0o42), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(0b110011) + chr(1810 - 1760), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(924 - 874) + '\x31' + chr(49), 26750 - 26742), ehT0Px3KOsy9('\060' + chr(9123 - 9012) + chr(0b1101 + 0o44) + chr(972 - 918) + chr(0b101010 + 0o10), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1100001 + 0o16) + chr(0b1101 + 0o50) + chr(2011 - 1963), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xab'), chr(100) + chr(101) + '\143' + '\x6f' + chr(0b101 + 0o137) + '\x65')(chr(0b1110101 + 0o0) + chr(3278 - 3162) + chr(0b10001 + 0o125) + '\055' + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Y6tNsKuVT_mv(SmiyjUKEV2S9, g_BAeGFUIQL0): UCIf1EYfndJp = None QC853qePai8t = oqhJDdMJfuwx.path.splitext(SmiyjUKEV2S9)[ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(0b1101 + 0o43), 0b1000)] + xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\x1e'), chr(100) + chr(0b1100101) + chr(0b1000010 + 0o41) + chr(0b1 + 0o156) + chr(0b1100100) + '\x65')(chr(5094 - 4977) + '\164' + chr(10368 - 10266) + chr(45) + '\070') QC853qePai8t = QC853qePai8t.lstrip(xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa!'), '\144' + chr(0b1100101) + '\143' + '\157' + '\144' + chr(0b111001 + 0o54))('\x75' + chr(0b1000000 + 0o64) + chr(102) + chr(0b0 + 0o55) + chr(56))) for UyakMW2IMFEj in g_BAeGFUIQL0: r0xYwQU392gZ = oqhJDdMJfuwx.path._oWXztVNnqHF(UyakMW2IMFEj, QC853qePai8t) if xafqLlk3kkUe(oqhJDdMJfuwx.path, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0\x05\xdf\xb0\x8d\xdc'), chr(0b0 + 0o144) + chr(101) + chr(0b11101 + 0o106) + chr(4813 - 4702) + chr(8631 - 8531) + chr(101))(chr(0b1001101 + 0o50) + '\164' + '\146' + chr(0b101101) + chr(56)))(r0xYwQU392gZ): UCIf1EYfndJp = r0xYwQU392gZ break return UCIf1EYfndJp
micropython/micropython
py/makemoduledefs.py
find_module_registrations
def find_module_registrations(c_file): """ Find any MP_REGISTER_MODULE definitions in the provided c file. :param str c_file: path to c file to check :return: List[(module_name, obj_module, enabled_define)] """ global pattern if c_file is None: # No c file to match the object file, skip return set() with io.open(c_file, encoding='utf-8') as c_file_obj: return set(re.findall(pattern, c_file_obj.read()))
python
def find_module_registrations(c_file): """ Find any MP_REGISTER_MODULE definitions in the provided c file. :param str c_file: path to c file to check :return: List[(module_name, obj_module, enabled_define)] """ global pattern if c_file is None: # No c file to match the object file, skip return set() with io.open(c_file, encoding='utf-8') as c_file_obj: return set(re.findall(pattern, c_file_obj.read()))
[ "def", "find_module_registrations", "(", "c_file", ")", ":", "global", "pattern", "if", "c_file", "is", "None", ":", "# No c file to match the object file, skip", "return", "set", "(", ")", "with", "io", ".", "open", "(", "c_file", ",", "encoding", "=", "'utf-8'", ")", "as", "c_file_obj", ":", "return", "set", "(", "re", ".", "findall", "(", "pattern", ",", "c_file_obj", ".", "read", "(", ")", ")", ")" ]
Find any MP_REGISTER_MODULE definitions in the provided c file. :param str c_file: path to c file to check :return: List[(module_name, obj_module, enabled_define)]
[ "Find", "any", "MP_REGISTER_MODULE", "definitions", "in", "the", "provided", "c", "file", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/py/makemoduledefs.py#L41-L54
train
Find any MP_REGISTER_MODULE definitions in the provided c file.
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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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(56 - 8) + chr(111) + chr(0b110001) + chr(0b100000 + 0o21), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b111101 + 0o62) + '\x31' + '\x30' + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10101 + 0o36) + '\x35' + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + chr(11166 - 11055) + '\x33' + '\x32' + chr(0b10001 + 0o41), 54750 - 54742), ehT0Px3KOsy9('\060' + chr(0b11100 + 0o123) + '\x33' + '\x35', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b0 + 0o157) + chr(50) + chr(0b11110 + 0o23) + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + '\x36', 15577 - 15569), ehT0Px3KOsy9(chr(222 - 174) + chr(5359 - 5248) + chr(0b11000 + 0o31) + '\x32' + '\066', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(2249 - 2195) + '\060', 0o10), ehT0Px3KOsy9(chr(1739 - 1691) + '\x6f' + chr(0b11110 + 0o30) + '\067', 31304 - 31296), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2216 - 2166) + '\060' + chr(48), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10111 + 0o34) + chr(0b110010) + '\x37', 3760 - 3752), ehT0Px3KOsy9('\060' + chr(7942 - 7831) + chr(50) + '\x36' + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11101 + 0o26) + '\060' + chr(0b10010 + 0o36), 57543 - 57535), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b10101 + 0o35) + '\x30', 0o10), ehT0Px3KOsy9(chr(1336 - 1288) + chr(0b110001 + 0o76) + chr(55) + chr(988 - 940), 50111 - 50103), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(2007 - 1958) + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + chr(6941 - 6830) + chr(2353 - 2304) + chr(54) + chr(0b100111 + 0o11), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9607 - 9496) + '\062' + chr(0b110101) + '\063', 52756 - 52748), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1101 + 0o52), 0o10), ehT0Px3KOsy9('\x30' + chr(789 - 678) + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + chr(8036 - 7925) + chr(0b101 + 0o55) + '\x34' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x35' + chr(0b10100 + 0o43), 0b1000), ehT0Px3KOsy9(chr(1002 - 954) + chr(7588 - 7477) + chr(0b1001 + 0o50) + chr(0b110000) + chr(51), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(5698 - 5587) + '\061' + '\064' + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(5756 - 5645) + chr(51) + '\065' + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(2220 - 2171) + chr(1056 - 1008) + chr(1000 - 948), 51517 - 51509), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(0b110101) + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9358 - 9247) + '\062' + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(88 - 38) + chr(0b110101), 8), ehT0Px3KOsy9(chr(1664 - 1616) + chr(11595 - 11484) + chr(1749 - 1699) + '\x34' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1492 - 1437) + '\x32', 7385 - 7377), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(51) + '\066', 60643 - 60635), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(91 - 39) + '\061', 10002 - 9994), ehT0Px3KOsy9(chr(1030 - 982) + chr(0b1101111) + chr(50) + chr(0b1010 + 0o50) + '\067', 32382 - 32374), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + '\x34' + chr(928 - 876), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x36' + chr(0b110000), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(0b110100) + chr(0b101001 + 0o14), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(926 - 877) + '\x32' + chr(0b11010 + 0o31), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(50), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(4672 - 4561) + chr(0b101 + 0o60) + chr(48), 48401 - 48393)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b"'"), chr(3545 - 3445) + chr(101) + chr(0b1010000 + 0o23) + chr(0b10110 + 0o131) + chr(0b1100100) + chr(8523 - 8422))('\165' + chr(0b10100 + 0o140) + chr(0b1010000 + 0o26) + '\055' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def DapdUbW8L_my(UCIf1EYfndJp): global D7PcF8SpuWmc if UCIf1EYfndJp is None: return MVEN8G6CxlvR() with xafqLlk3kkUe(Bey9a5LqdaFa, xafqLlk3kkUe(SXOLrMavuUCe(b'f5\x8d\xbc'), chr(739 - 639) + chr(8778 - 8677) + chr(7940 - 7841) + chr(111) + '\144' + chr(0b10111 + 0o116))('\165' + '\164' + chr(102) + '\x2d' + chr(0b111000)))(UCIf1EYfndJp, encoding=xafqLlk3kkUe(SXOLrMavuUCe(b'|1\x8e\xff%'), '\x64' + chr(0b1100101) + chr(8899 - 8800) + '\x6f' + chr(100) + chr(0b1100101))(chr(0b1100001 + 0o24) + chr(0b101111 + 0o105) + chr(0b1100110) + chr(45) + chr(0b111000))) as WDXb5Y87YPOC: return MVEN8G6CxlvR(xafqLlk3kkUe(_7u55U49WwX2, xafqLlk3kkUe(SXOLrMavuUCe(b'o,\x86\xb6|\xe1r'), chr(0b1101 + 0o127) + '\145' + chr(3324 - 3225) + chr(8224 - 8113) + '\144' + '\145')(chr(117) + '\164' + '\146' + chr(2018 - 1973) + '\070'))(D7PcF8SpuWmc, xafqLlk3kkUe(WDXb5Y87YPOC, xafqLlk3kkUe(SXOLrMavuUCe(b'\\s\xa5\xbbJ\xffv#s^\xb2\x8e'), chr(0b1100100) + chr(101) + chr(0b1100011) + '\x6f' + '\x64' + '\x65')('\165' + chr(0b1011000 + 0o34) + '\146' + chr(0b10 + 0o53) + chr(0b111000)))()))
micropython/micropython
py/makemoduledefs.py
generate_module_table_header
def generate_module_table_header(modules): """ Generate header with module table entries for builtin modules. :param List[(module_name, obj_module, enabled_define)] modules: module defs :return: None """ # Print header file for all external modules. mod_defs = [] print("// Automatically generated by makemoduledefs.py.\n") for module_name, obj_module, enabled_define in modules: mod_def = "MODULE_DEF_{}".format(module_name.upper()) mod_defs.append(mod_def) print(( "#if ({enabled_define})\n" " extern const struct _mp_obj_module_t {obj_module};\n" " #define {mod_def} {{ MP_ROM_QSTR({module_name}), MP_ROM_PTR(&{obj_module}) }},\n" "#else\n" " #define {mod_def}\n" "#endif\n" ).format(module_name=module_name, obj_module=obj_module, enabled_define=enabled_define, mod_def=mod_def) ) print("\n#define MICROPY_REGISTERED_MODULES \\") for mod_def in mod_defs: print(" {mod_def} \\".format(mod_def=mod_def)) print("// MICROPY_REGISTERED_MODULES")
python
def generate_module_table_header(modules): """ Generate header with module table entries for builtin modules. :param List[(module_name, obj_module, enabled_define)] modules: module defs :return: None """ # Print header file for all external modules. mod_defs = [] print("// Automatically generated by makemoduledefs.py.\n") for module_name, obj_module, enabled_define in modules: mod_def = "MODULE_DEF_{}".format(module_name.upper()) mod_defs.append(mod_def) print(( "#if ({enabled_define})\n" " extern const struct _mp_obj_module_t {obj_module};\n" " #define {mod_def} {{ MP_ROM_QSTR({module_name}), MP_ROM_PTR(&{obj_module}) }},\n" "#else\n" " #define {mod_def}\n" "#endif\n" ).format(module_name=module_name, obj_module=obj_module, enabled_define=enabled_define, mod_def=mod_def) ) print("\n#define MICROPY_REGISTERED_MODULES \\") for mod_def in mod_defs: print(" {mod_def} \\".format(mod_def=mod_def)) print("// MICROPY_REGISTERED_MODULES")
[ "def", "generate_module_table_header", "(", "modules", ")", ":", "# Print header file for all external modules.", "mod_defs", "=", "[", "]", "print", "(", "\"// Automatically generated by makemoduledefs.py.\\n\"", ")", "for", "module_name", ",", "obj_module", ",", "enabled_define", "in", "modules", ":", "mod_def", "=", "\"MODULE_DEF_{}\"", ".", "format", "(", "module_name", ".", "upper", "(", ")", ")", "mod_defs", ".", "append", "(", "mod_def", ")", "print", "(", "(", "\"#if ({enabled_define})\\n\"", "\" extern const struct _mp_obj_module_t {obj_module};\\n\"", "\" #define {mod_def} {{ MP_ROM_QSTR({module_name}), MP_ROM_PTR(&{obj_module}) }},\\n\"", "\"#else\\n\"", "\" #define {mod_def}\\n\"", "\"#endif\\n\"", ")", ".", "format", "(", "module_name", "=", "module_name", ",", "obj_module", "=", "obj_module", ",", "enabled_define", "=", "enabled_define", ",", "mod_def", "=", "mod_def", ")", ")", "print", "(", "\"\\n#define MICROPY_REGISTERED_MODULES \\\\\"", ")", "for", "mod_def", "in", "mod_defs", ":", "print", "(", "\" {mod_def} \\\\\"", ".", "format", "(", "mod_def", "=", "mod_def", ")", ")", "print", "(", "\"// MICROPY_REGISTERED_MODULES\"", ")" ]
Generate header with module table entries for builtin modules. :param List[(module_name, obj_module, enabled_define)] modules: module defs :return: None
[ "Generate", "header", "with", "module", "table", "entries", "for", "builtin", "modules", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/py/makemoduledefs.py#L57-L86
train
Generate header file for all external modules.
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,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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(1810 - 1762) + chr(0b1101111) + chr(53) + chr(50), 60207 - 60199), ehT0Px3KOsy9('\060' + chr(0b1101110 + 0o1) + chr(50) + chr(0b110010) + chr(0b10011 + 0o44), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b110111 + 0o70) + chr(51) + chr(2094 - 2043) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(6573 - 6462) + chr(1698 - 1649) + chr(0b110011) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10111 + 0o34) + '\x36' + chr(634 - 583), 0o10), ehT0Px3KOsy9(chr(2097 - 2049) + chr(10712 - 10601) + chr(49) + '\064' + chr(50), 15865 - 15857), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1011 + 0o47) + '\067' + chr(0b101110 + 0o5), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011001 + 0o26) + chr(51) + chr(1746 - 1694) + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101011 + 0o4) + chr(0b110001) + chr(50) + chr(53), 28083 - 28075), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(7255 - 7144) + chr(0b110100) + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(0b1100 + 0o50) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(2163 - 2114) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + '\066' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(2620 - 2567) + chr(0b1 + 0o65), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(55) + chr(55), 0b1000), ehT0Px3KOsy9(chr(1058 - 1010) + chr(11803 - 11692) + chr(0b110010) + chr(0b11100 + 0o31) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1010110 + 0o31) + chr(0b110001) + chr(0b110011) + chr(0b1111 + 0o41), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(0b1010 + 0o50) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100011 + 0o114) + chr(0b1100 + 0o47) + chr(0b110111) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(0b110001) + chr(1155 - 1104), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(703 - 653) + '\062' + chr(54), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(0b110111) + chr(1554 - 1503), 0b1000), ehT0Px3KOsy9(chr(592 - 544) + chr(111) + '\x32' + chr(0b110001) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(1055 - 1007) + chr(4291 - 4180) + chr(0b100111 + 0o12) + chr(0b11010 + 0o33) + '\060', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3826 - 3715) + chr(0b110100) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + '\067' + chr(2386 - 2335), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1690 - 1635), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + '\x35' + chr(0b100110 + 0o20), 8), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(10681 - 10570) + chr(1233 - 1182) + chr(0b110100) + '\x34', 33246 - 33238), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + '\x33' + chr(54) + '\063', 8), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(111) + '\061' + chr(0b110000 + 0o7) + '\066', 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + chr(0b110011) + chr(55) + chr(2355 - 2304), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1111 + 0o41), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + '\063' + chr(0b110111), 42314 - 42306), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(2464 - 2413), ord("\x08")), ehT0Px3KOsy9(chr(1403 - 1355) + '\x6f' + '\x31' + chr(0b11111 + 0o25) + '\066', 61788 - 61780), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(2693 - 2639) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(454 - 405) + chr(0b110111) + chr(0b101101 + 0o11), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11010 + 0o27) + chr(50) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11101 + 0o25) + '\063' + chr(0b101010 + 0o12), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + chr(0b110101) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x04'), chr(4458 - 4358) + chr(0b1100101) + chr(4515 - 4416) + '\157' + chr(0b1100100) + chr(0b101000 + 0o75))(chr(10082 - 9965) + '\164' + chr(102) + '\055' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def auiWYYEmvSTS(Dm5UcjkJnFvy): jsWNMCFn4Q1l = [] zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b"\x05\xb8\xf9\x1d\x86\x16\xd4\x8b4U\xcbo\xd4\x82\x13\xd5x\xf2\x9c%\xf3\x89\xef\x1cA\xdf'\x8c\x9d\xd3\x13\x9ak\xfav\t\x90\x0b8\xf9N\xf2\xbf/\xdd\x12\xc2\xc8_"), chr(0b1100100) + chr(0b10 + 0o143) + chr(0b1000101 + 0o36) + chr(12278 - 12167) + '\x64' + chr(101))(chr(117) + chr(8505 - 8389) + chr(4225 - 4123) + chr(0b100100 + 0o11) + '\070')) for (Iu0XkROSvs3d, mzyCO95aCEUO, EcHzq4k7iZ5Q) in Dm5UcjkJnFvy: VIekzcilGuX9 = xafqLlk3kkUe(SXOLrMavuUCe(b"g\xd8\x9d\t\xbf'\xe4\xa2\x10g\xfdw\xc8"), chr(5908 - 5808) + chr(185 - 84) + chr(99) + chr(5172 - 5061) + '\144' + chr(0b1100101))(chr(12388 - 12271) + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(0b1000 + 0o60)).V4roHaS3Ppej(Iu0XkROSvs3d.upper()) xafqLlk3kkUe(jsWNMCFn4Q1l, xafqLlk3kkUe(SXOLrMavuUCe(b'K\xe7\xa99\x9d\x06'), '\x64' + chr(3945 - 3844) + chr(99) + '\x6f' + chr(0b1100100) + chr(101))(chr(117) + chr(116) + '\x66' + chr(1906 - 1861) + chr(1397 - 1341)))(VIekzcilGuX9) zLUzGokYBM2Z(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\t\xfe\xbf|\xdb\x19\xde\x884C\xcei\xd1\xb1\x1b\xc9>\xfc\x97.\xeb\xd2\x84H\x04\x9b'\x8b\x9c\x87\x1b\x89n\xbfx\t\x9a\r \xbcY\xe3\xab)\x90\x16\x9b\xb98Q\xfdc\xd7\x84 \xc17\xf1\x8c'\xf3\xa4\xfaH_\xd4e\x84\xbb\x9e\x11\x9fu\xf3~\x1b\xcftt\xbc\n\xb7\xfa8\x96\x04\xd2\x880\x01\xd9a\xda\x8a \xc8=\xf3\x84k\xed\x80\xae%t\xe4U\xa1\xa9\xac/\xa8T\xcd3\x1d\x99\x110\xe9F\xf2\x862\x92\x0f\xde\x9b|\r\x82A\xe5\xb1-\xe3\x15\xca\xa9\x1f\xc4\xd3\xa8\x13K\xd9m\xb1\x89\x9c\x1a\x8el\xfafO\xd4\x03)\xb0 \xb4\xbc0\x80\x07\xb1\xc6u\x01\x82/\xd1\x8b\x19\xc56\xf0\xd90\xfb\x94\xea7@\xdea\x93\xee\xd0\x1b\x95d\xf6}l"), '\x64' + '\x65' + '\x63' + chr(2589 - 2478) + chr(2564 - 2464) + chr(0b1100101))(chr(2403 - 2286) + chr(0b1110100) + chr(102) + chr(546 - 501) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'|\xa3\xab3\xbb\x03\xe8\xd5\x05Q\xc7f'), '\x64' + chr(101) + '\143' + chr(111) + chr(100) + '\145')(chr(542 - 425) + chr(11961 - 11845) + chr(565 - 463) + chr(1627 - 1582) + '\x38'))(module_name=Iu0XkROSvs3d, obj_module=mzyCO95aCEUO, enabled_define=EcHzq4k7iZ5Q, mod_def=VIekzcilGuX9)) zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b' \xb4\xbd9\x95\x0b\xd5\x83ul\xebO\xe7\xa1/\xf5\x07\xc7\xbc\x0c\xdf\xa8\xda-v\xfeC\xb1\xa9\xbc:\xaeL\xdaHF\xa8'), '\144' + chr(0b1100101) + chr(7060 - 6961) + chr(0b1101111) + chr(9992 - 9892) + '\x65')(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(2683 - 2627))) for VIekzcilGuX9 in jsWNMCFn4Q1l: zLUzGokYBM2Z(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\n\xb7\xf9|\x88\x0f\xd4\x82\nE\xc7j\xc8\xce#'), chr(100) + chr(101) + chr(0b1100011) + '\157' + chr(2633 - 2533) + chr(5856 - 5755))(chr(0b1110101) + chr(9041 - 8925) + '\146' + chr(45) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'|\xa3\xab3\xbb\x03\xe8\xd5\x05Q\xc7f'), chr(0b1000010 + 0o42) + chr(0b1001011 + 0o32) + chr(99) + chr(9632 - 9521) + chr(3507 - 3407) + chr(0b1100101))('\165' + chr(3663 - 3547) + chr(0b1100110) + chr(0b101101) + '\x38'))(mod_def=VIekzcilGuX9)) zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b"\x05\xb8\xf9\x11\xba!\xe9\xa9\x05x\xfd^\xf0\xa96\xff\x0c\xd0\xab\x0e\xd2\xa4\xc3'`\xeeK\xab\xb7"), chr(5995 - 5895) + '\x65' + '\x63' + chr(111) + '\x64' + chr(101))(chr(117) + chr(0b1110100) + '\146' + '\x2d' + chr(729 - 673)))
micropython/micropython
tools/gen-cpydiff.py
readfiles
def readfiles(): """ Reads test files """ tests = list(filter(lambda x: x.endswith('.py'), os.listdir(TESTPATH))) tests.sort() files = [] for test in tests: text = open(TESTPATH + test, 'r').read() try: class_, desc, cause, workaround, code = [x.rstrip() for x in \ list(filter(None, re.split(SPLIT, text)))] output = Output(test, class_, desc, cause, workaround, code, '', '', '') files.append(output) except IndexError: print('Incorrect format in file ' + TESTPATH + test) return files
python
def readfiles(): """ Reads test files """ tests = list(filter(lambda x: x.endswith('.py'), os.listdir(TESTPATH))) tests.sort() files = [] for test in tests: text = open(TESTPATH + test, 'r').read() try: class_, desc, cause, workaround, code = [x.rstrip() for x in \ list(filter(None, re.split(SPLIT, text)))] output = Output(test, class_, desc, cause, workaround, code, '', '', '') files.append(output) except IndexError: print('Incorrect format in file ' + TESTPATH + test) return files
[ "def", "readfiles", "(", ")", ":", "tests", "=", "list", "(", "filter", "(", "lambda", "x", ":", "x", ".", "endswith", "(", "'.py'", ")", ",", "os", ".", "listdir", "(", "TESTPATH", ")", ")", ")", "tests", ".", "sort", "(", ")", "files", "=", "[", "]", "for", "test", "in", "tests", ":", "text", "=", "open", "(", "TESTPATH", "+", "test", ",", "'r'", ")", ".", "read", "(", ")", "try", ":", "class_", ",", "desc", ",", "cause", ",", "workaround", ",", "code", "=", "[", "x", ".", "rstrip", "(", ")", "for", "x", "in", "list", "(", "filter", "(", "None", ",", "re", ".", "split", "(", "SPLIT", ",", "text", ")", ")", ")", "]", "output", "=", "Output", "(", "test", ",", "class_", ",", "desc", ",", "cause", ",", "workaround", ",", "code", ",", "''", ",", "''", ",", "''", ")", "files", ".", "append", "(", "output", ")", "except", "IndexError", ":", "print", "(", "'Incorrect format in file '", "+", "TESTPATH", "+", "test", ")", "return", "files" ]
Reads test files
[ "Reads", "test", "files" ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/gen-cpydiff.py#L63-L80
train
Reads test files and returns a list of Output objects
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,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1V0ySZcNds,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(1410 - 1362) + '\157' + chr(0b110001) + chr(2401 - 2348) + '\x30', 62309 - 62301), ehT0Px3KOsy9(chr(163 - 115) + chr(111) + chr(521 - 470) + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2260 - 2209) + chr(0b101010 + 0o6) + chr(2738 - 2685), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(365 - 313) + chr(770 - 717), 29768 - 29760), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(54) + chr(1863 - 1813), 43019 - 43011), ehT0Px3KOsy9(chr(0b110000) + chr(0b101001 + 0o106) + chr(0b110011) + '\062' + chr(0b1111 + 0o41), 56168 - 56160), ehT0Px3KOsy9(chr(48) + chr(1760 - 1649) + chr(0b110001) + chr(0b100111 + 0o20) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + chr(1421 - 1310) + chr(51) + '\061' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(1637 - 1589) + chr(111) + chr(0b10101 + 0o34) + chr(113 - 62) + chr(0b110110), 26533 - 26525), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100101 + 0o14) + '\x33' + '\063', 28612 - 28604), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(674 - 619) + '\065', 0b1000), ehT0Px3KOsy9(chr(921 - 873) + chr(0b1101111) + chr(0b11011 + 0o27) + chr(49) + chr(0b11111 + 0o26), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(2255 - 2201) + '\x37', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\067', 22482 - 22474), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b101010 + 0o105) + chr(0b110010) + '\x36' + chr(2110 - 2059), ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(0b110010) + chr(0b111 + 0o56) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(50) + chr(0b110110) + chr(0b110011), 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + '\065' + '\x34', 0o10), ehT0Px3KOsy9('\x30' + chr(1184 - 1073) + chr(0b110001) + chr(49) + chr(0b10010 + 0o45), 16154 - 16146), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(1253 - 1199) + chr(48), 21013 - 21005), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000100 + 0o53) + chr(2563 - 2512) + chr(48) + '\x34', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(0b10011 + 0o37) + chr(2251 - 2197), 0o10), ehT0Px3KOsy9(chr(48) + chr(7293 - 7182) + chr(54) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(1175 - 1127) + '\157' + '\x32' + chr(0b110000) + chr(0b110110), 24062 - 24054), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100100 + 0o15) + '\x36' + chr(2372 - 2317), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + '\x33' + chr(55), 31062 - 31054), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(3939 - 3828) + chr(0b11010 + 0o30) + chr(0b101100 + 0o5) + chr(0b1001 + 0o51), 12145 - 12137), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(111) + chr(51) + chr(0b101101 + 0o10) + '\063', 23930 - 23922), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b110111 + 0o70) + '\x31' + chr(0b11110 + 0o24) + chr(1918 - 1869), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(11686 - 11575) + chr(1638 - 1589) + chr(52) + chr(0b110 + 0o52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b110111) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(926 - 871) + chr(1115 - 1060), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10111 + 0o37) + chr(0b1011 + 0o46), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(571 - 520) + chr(55), 8), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(53) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(2206 - 2158) + chr(0b1101111) + '\x31' + chr(53) + chr(53), 20902 - 20894), ehT0Px3KOsy9(chr(48) + chr(0b10101 + 0o132) + chr(49) + chr(0b110100) + '\063', 1143 - 1135), ehT0Px3KOsy9(chr(592 - 544) + chr(0b11100 + 0o123) + '\x33' + chr(0b110010) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101011 + 0o4) + chr(0b11010 + 0o27) + '\062' + '\060', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(574 - 526) + chr(2840 - 2729) + chr(422 - 369) + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'F'), chr(100) + chr(0b100110 + 0o77) + chr(847 - 748) + '\157' + chr(0b1 + 0o143) + chr(0b1100101))('\165' + chr(8852 - 8736) + '\146' + chr(0b100000 + 0o15) + chr(1386 - 1330)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def nzZGL5zQ78y6(): FNTxqxPcLni8 = vUlqIvNSaRMa(hi1V0ySZcNds(lambda OeWW0F1dBPRQ: OeWW0F1dBPRQ.endswith(xafqLlk3kkUe(SXOLrMavuUCe(b'Fj\xbc'), chr(100) + chr(0b1001 + 0o134) + chr(8867 - 8768) + chr(0b1101111) + chr(100) + '\x65')('\165' + '\164' + '\x66' + chr(0b101101) + chr(0b111000))), oqhJDdMJfuwx.listdir(IzmWvxfCriwX))) uyc48vokp5OE = [] for o1nnuQUCchP4 in FNTxqxPcLni8: Ah1rInvg48Hb = _fwkIVCGgtAN(IzmWvxfCriwX + o1nnuQUCchP4, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a'), chr(7458 - 7358) + '\x65' + chr(99) + '\157' + chr(100) + chr(101))('\165' + '\164' + '\146' + chr(45) + '\x38')).U6MiWrhuCi2Y() try: (PP81Xh5bKXUp, XQWhGt09O88Z, bY5_GMM2hEOg, haKfyQYOEy1_, ZWRNGxZ3R69y) = [OeWW0F1dBPRQ.rstrip() for OeWW0F1dBPRQ in YyaZ4tpXu4lf(hi1V0ySZcNds(None, _7u55U49WwX2.split(f_PqiKFDRuxb, Ah1rInvg48Hb)))] e1jVqMSBZ01Y = Qoo4G06KIRyz(o1nnuQUCchP4, PP81Xh5bKXUp, XQWhGt09O88Z, bY5_GMM2hEOg, haKfyQYOEy1_, ZWRNGxZ3R69y, xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(100) + chr(101) + '\x63' + chr(111) + chr(0b1100100) + chr(0b1100101))(chr(0b111001 + 0o74) + chr(0b1101100 + 0o10) + chr(0b1100110) + chr(0b101101) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(1161 - 1061) + '\x65' + chr(0b1100011) + '\157' + chr(0b10010 + 0o122) + chr(7124 - 7023))('\x75' + '\164' + chr(0b1100110) + '\055' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b1100100) + '\145' + '\x63' + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(0b11100 + 0o131) + chr(116) + '\146' + '\055' + '\x38')) xafqLlk3kkUe(uyc48vokp5OE, xafqLlk3kkUe(SXOLrMavuUCe(b'\tj\xb5\x00\xdc\xb4'), chr(0b1100100) + '\x65' + chr(1038 - 939) + '\157' + '\144' + chr(0b1010110 + 0o17))(chr(0b1110101) + chr(0b1110100) + chr(899 - 797) + '\x2d' + chr(0b111000)))(e1jVqMSBZ01Y) except _fsda0v2_OKU: zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'!t\xa6\n\xc0\xa2\x1eq\xbf~=R\xff\xdaf\xc7\x8d\xda\x02o\x16\xad\xbaW\xa6'), chr(100) + '\x65' + chr(0b1000000 + 0o43) + chr(0b1101111) + '\x64' + chr(0b111101 + 0o50))(chr(117) + chr(0b100011 + 0o121) + chr(102) + '\055' + '\x38') + IzmWvxfCriwX + o1nnuQUCchP4) return uyc48vokp5OE
micropython/micropython
tools/gen-cpydiff.py
uimports
def uimports(code): """ converts CPython module names into MicroPython equivalents """ for uimport in UIMPORTLIST: uimport = bytes(uimport, 'utf8') code = code.replace(uimport, b'u' + uimport) return code
python
def uimports(code): """ converts CPython module names into MicroPython equivalents """ for uimport in UIMPORTLIST: uimport = bytes(uimport, 'utf8') code = code.replace(uimport, b'u' + uimport) return code
[ "def", "uimports", "(", "code", ")", ":", "for", "uimport", "in", "UIMPORTLIST", ":", "uimport", "=", "bytes", "(", "uimport", ",", "'utf8'", ")", "code", "=", "code", ".", "replace", "(", "uimport", ",", "b'u'", "+", "uimport", ")", "return", "code" ]
converts CPython module names into MicroPython equivalents
[ "converts", "CPython", "module", "names", "into", "MicroPython", "equivalents" ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/gen-cpydiff.py#L82-L87
train
convert CPython module names into MicroPython equivalents
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,koCe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6mjyZZT,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(779 - 731) + '\x6f' + '\x33' + chr(49) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b110101 + 0o72) + '\062' + '\066' + chr(0b10 + 0o60), 0o10), ehT0Px3KOsy9(chr(2178 - 2130) + chr(0b1101111) + chr(2338 - 2287) + chr(0b110100) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + chr(51) + '\x33' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(955 - 907) + chr(111) + chr(0b110011) + chr(0b100110 + 0o21) + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1479 - 1429) + chr(55) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1679 - 1630) + chr(134 - 81) + chr(0b11001 + 0o36), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(49) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(1317 - 1264) + '\063', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + '\x30' + chr(1059 - 1011), 0b1000), ehT0Px3KOsy9(chr(2015 - 1967) + chr(111) + chr(0b11000 + 0o33) + '\060' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\157' + '\062' + chr(51) + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110000 + 0o7), 17674 - 17666), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(52) + '\x37', 0b1000), ehT0Px3KOsy9(chr(790 - 742) + chr(0b10110 + 0o131) + chr(0b100111 + 0o13) + chr(1086 - 1032) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\157' + '\x32' + '\062' + chr(0b1111 + 0o45), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1111 + 0o140) + chr(54) + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101101 + 0o2) + chr(0b110010) + chr(0b110000) + chr(0b100011 + 0o24), ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1011111 + 0o20) + chr(2244 - 2191) + '\064', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(53) + chr(826 - 776), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8841 - 8730) + chr(0b110011) + chr(1576 - 1521) + chr(0b10100 + 0o35), ord("\x08")), ehT0Px3KOsy9(chr(1811 - 1763) + '\x6f' + chr(0b11110 + 0o25) + '\065' + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\x33' + '\067', 35328 - 35320), ehT0Px3KOsy9(chr(335 - 287) + chr(0b1101111) + '\x37' + chr(55), 62303 - 62295), ehT0Px3KOsy9('\x30' + chr(0b10110 + 0o131) + '\062' + '\061' + '\060', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(1374 - 1320), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(52), 0b1000), ehT0Px3KOsy9(chr(255 - 207) + chr(10002 - 9891) + chr(0b110110) + chr(2258 - 2208), 35974 - 35966), ehT0Px3KOsy9(chr(1174 - 1126) + chr(0b1101111) + '\062' + chr(0b100001 + 0o23) + '\x32', 38530 - 38522), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1488 - 1438) + '\064' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011 + 0o144) + '\x31' + '\x30' + chr(0b1100 + 0o45), 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(0b11100 + 0o27) + chr(1094 - 1042) + chr(0b110010 + 0o4), 0o10), ehT0Px3KOsy9(chr(48) + chr(9705 - 9594) + chr(0b110010) + '\x31' + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + '\061' + chr(247 - 195), 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1011111 + 0o20) + chr(1875 - 1823) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\x6f' + chr(1943 - 1894) + '\064' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b11 + 0o154) + chr(0b1110 + 0o43) + '\060' + chr(50), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(1409 - 1359) + chr(0b110110) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10011 + 0o40) + '\063' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(2028 - 1980) + '\157' + chr(2863 - 2809) + chr(49), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(1030 - 977) + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6'), chr(100) + chr(101) + '\143' + '\157' + '\144' + '\x65')('\x75' + chr(0b1110100) + chr(9568 - 9466) + chr(0b101101) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def JostzLUcXWEa(ZWRNGxZ3R69y): for ZA1IgTX8UZMD in Ah1a2zYESvVY: ZA1IgTX8UZMD = QOfmzcVJsrp8(ZA1IgTX8UZMD, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\xc6\x87\xe2'), chr(0b1100100) + '\x65' + chr(99) + chr(0b1101111) + chr(0b111000 + 0o54) + '\145')('\165' + chr(116) + chr(7382 - 7280) + '\055' + chr(0b101111 + 0o11))) ZWRNGxZ3R69y = ZWRNGxZ3R69y.replace(ZA1IgTX8UZMD, SXOLrMavuUCe(b'\xbd') + ZA1IgTX8UZMD) return ZWRNGxZ3R69y
micropython/micropython
tools/gen-cpydiff.py
indent
def indent(block, spaces): """ indents paragraphs of text for rst formatting """ new_block = '' for line in block.split('\n'): new_block += spaces + line + '\n' return new_block
python
def indent(block, spaces): """ indents paragraphs of text for rst formatting """ new_block = '' for line in block.split('\n'): new_block += spaces + line + '\n' return new_block
[ "def", "indent", "(", "block", ",", "spaces", ")", ":", "new_block", "=", "''", "for", "line", "in", "block", ".", "split", "(", "'\\n'", ")", ":", "new_block", "+=", "spaces", "+", "line", "+", "'\\n'", "return", "new_block" ]
indents paragraphs of text for rst formatting
[ "indents", "paragraphs", "of", "text", "for", "rst", "formatting" ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/gen-cpydiff.py#L116-L121
train
indents paragraphs of text for rst formatting
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,hIlP7994qj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,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(0b100101 + 0o14) + chr(0b1111 + 0o41) + '\060', 63143 - 63135), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(631 - 580) + '\061' + chr(0b101000 + 0o12), ord("\x08")), ehT0Px3KOsy9(chr(2072 - 2024) + '\x6f' + chr(0b10011 + 0o37) + chr(959 - 911) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1219 - 1167) + chr(0b1110 + 0o43), 14894 - 14886), ehT0Px3KOsy9(chr(48) + chr(7833 - 7722) + chr(0b110001) + chr(1053 - 1003) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + '\x31' + '\x30' + chr(1507 - 1459), 8), ehT0Px3KOsy9(chr(48) + chr(0b10101 + 0o132) + chr(51) + '\x31' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9719 - 9608) + '\x31' + '\062' + '\063', 15713 - 15705), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + '\x33' + chr(0b1101 + 0o52), 58029 - 58021), ehT0Px3KOsy9('\060' + '\157' + chr(0b10011 + 0o37) + '\060' + chr(0b1001 + 0o52), 3026 - 3018), ehT0Px3KOsy9('\060' + chr(3644 - 3533) + '\065' + chr(0b110010), 55102 - 55094), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(0b110100) + chr(0b11101 + 0o27), 0b1000), ehT0Px3KOsy9(chr(1456 - 1408) + chr(0b1101111) + chr(53) + chr(0b100 + 0o55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4678 - 4567) + chr(0b110011) + '\063' + '\064', 50164 - 50156), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + '\062' + chr(2629 - 2575) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\065' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(8313 - 8202) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + '\x30' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1273 - 1223) + chr(2970 - 2915) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(10945 - 10834) + '\x32' + chr(48) + '\x33', 8), ehT0Px3KOsy9(chr(0b110000) + chr(5382 - 5271) + chr(0b101000 + 0o12) + chr(52) + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(64 - 10) + '\063', 16088 - 16080), ehT0Px3KOsy9(chr(48) + chr(0b100110 + 0o111) + '\x37' + chr(55), 41672 - 41664), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + '\062' + '\x36' + chr(165 - 112), ord("\x08")), ehT0Px3KOsy9(chr(2277 - 2229) + chr(0b1101111) + '\x32' + '\066' + chr(48), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(0b1010 + 0o47) + chr(0b110001 + 0o1), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x37' + chr(55), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(52) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(977 - 929) + chr(0b1101111) + '\063' + chr(0b11011 + 0o26) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + '\060' + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + '\061' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + '\x33' + chr(51) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011001 + 0o26) + '\062' + chr(634 - 581) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(203 - 154) + '\062' + '\x37', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111 + 0o0) + chr(0b1001 + 0o55) + '\x30', 65057 - 65049), ehT0Px3KOsy9(chr(63 - 15) + chr(111) + chr(51) + chr(54) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(2405 - 2354) + '\067' + '\067', 59396 - 59388), ehT0Px3KOsy9(chr(1168 - 1120) + '\x6f' + chr(0b100010 + 0o21) + chr(2384 - 2333) + chr(0b110010), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + '\x34' + '\064', 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(53) + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'n'), '\x64' + '\x65' + chr(1504 - 1405) + chr(876 - 765) + '\x64' + '\x65')('\165' + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def rxwJk_g4F6Db(cid3MTmW5yAA, OI40a7o14TIm): ie2ko4akVnb_ = xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(8599 - 8499) + '\x65' + '\143' + chr(0b1101111) + '\144' + chr(101))('\165' + chr(116) + '\x66' + '\055' + '\x38') for LycYkDpyelF6 in xafqLlk3kkUe(cid3MTmW5yAA, xafqLlk3kkUe(SXOLrMavuUCe(b'3\xba\xe8H$'), chr(100) + '\145' + chr(99) + '\157' + '\144' + chr(3923 - 3822))(chr(6707 - 6590) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b100010 + 0o26)))(xafqLlk3kkUe(SXOLrMavuUCe(b'J'), chr(0b11010 + 0o112) + chr(0b1100101) + chr(0b10010 + 0o121) + '\x6f' + chr(0b1011000 + 0o14) + chr(0b1100101))('\165' + chr(116) + '\x66' + chr(0b1110 + 0o37) + chr(0b111000))): ie2ko4akVnb_ += OI40a7o14TIm + LycYkDpyelF6 + xafqLlk3kkUe(SXOLrMavuUCe(b'J'), chr(0b1100100) + chr(101) + chr(3437 - 3338) + '\x6f' + '\144' + chr(0b1010001 + 0o24))('\165' + chr(6319 - 6203) + chr(1426 - 1324) + chr(45) + chr(1969 - 1913)) return ie2ko4akVnb_
micropython/micropython
tools/gen-cpydiff.py
gen_table
def gen_table(contents): """ creates a table given any set of columns """ xlengths = [] ylengths = [] for column in contents: col_len = 0 for entry in column: lines = entry.split('\n') for line in lines: col_len = max(len(line) + 2, col_len) xlengths.append(col_len) for i in range(len(contents[0])): ymax = 0 for j in range(len(contents)): ymax = max(ymax, len(contents[j][i].split('\n'))) ylengths.append(ymax) table_divider = '+' + ''.join(['-' * i + '+' for i in xlengths]) + '\n' table = table_divider for i in range(len(ylengths)): row = [column[i] for column in contents] row = [entry + '\n' * (ylengths[i]-len(entry.split('\n'))) for entry in row] row = [entry.split('\n') for entry in row] for j in range(ylengths[i]): k = 0 for entry in row: width = xlengths[k] table += ''.join(['| {:{}}'.format(entry[j], width - 1)]) k += 1 table += '|\n' table += table_divider return table + '\n'
python
def gen_table(contents): """ creates a table given any set of columns """ xlengths = [] ylengths = [] for column in contents: col_len = 0 for entry in column: lines = entry.split('\n') for line in lines: col_len = max(len(line) + 2, col_len) xlengths.append(col_len) for i in range(len(contents[0])): ymax = 0 for j in range(len(contents)): ymax = max(ymax, len(contents[j][i].split('\n'))) ylengths.append(ymax) table_divider = '+' + ''.join(['-' * i + '+' for i in xlengths]) + '\n' table = table_divider for i in range(len(ylengths)): row = [column[i] for column in contents] row = [entry + '\n' * (ylengths[i]-len(entry.split('\n'))) for entry in row] row = [entry.split('\n') for entry in row] for j in range(ylengths[i]): k = 0 for entry in row: width = xlengths[k] table += ''.join(['| {:{}}'.format(entry[j], width - 1)]) k += 1 table += '|\n' table += table_divider return table + '\n'
[ "def", "gen_table", "(", "contents", ")", ":", "xlengths", "=", "[", "]", "ylengths", "=", "[", "]", "for", "column", "in", "contents", ":", "col_len", "=", "0", "for", "entry", "in", "column", ":", "lines", "=", "entry", ".", "split", "(", "'\\n'", ")", "for", "line", "in", "lines", ":", "col_len", "=", "max", "(", "len", "(", "line", ")", "+", "2", ",", "col_len", ")", "xlengths", ".", "append", "(", "col_len", ")", "for", "i", "in", "range", "(", "len", "(", "contents", "[", "0", "]", ")", ")", ":", "ymax", "=", "0", "for", "j", "in", "range", "(", "len", "(", "contents", ")", ")", ":", "ymax", "=", "max", "(", "ymax", ",", "len", "(", "contents", "[", "j", "]", "[", "i", "]", ".", "split", "(", "'\\n'", ")", ")", ")", "ylengths", ".", "append", "(", "ymax", ")", "table_divider", "=", "'+'", "+", "''", ".", "join", "(", "[", "'-'", "*", "i", "+", "'+'", "for", "i", "in", "xlengths", "]", ")", "+", "'\\n'", "table", "=", "table_divider", "for", "i", "in", "range", "(", "len", "(", "ylengths", ")", ")", ":", "row", "=", "[", "column", "[", "i", "]", "for", "column", "in", "contents", "]", "row", "=", "[", "entry", "+", "'\\n'", "*", "(", "ylengths", "[", "i", "]", "-", "len", "(", "entry", ".", "split", "(", "'\\n'", ")", ")", ")", "for", "entry", "in", "row", "]", "row", "=", "[", "entry", ".", "split", "(", "'\\n'", ")", "for", "entry", "in", "row", "]", "for", "j", "in", "range", "(", "ylengths", "[", "i", "]", ")", ":", "k", "=", "0", "for", "entry", "in", "row", ":", "width", "=", "xlengths", "[", "k", "]", "table", "+=", "''", ".", "join", "(", "[", "'| {:{}}'", ".", "format", "(", "entry", "[", "j", "]", ",", "width", "-", "1", ")", "]", ")", "k", "+=", "1", "table", "+=", "'|\\n'", "table", "+=", "table_divider", "return", "table", "+", "'\\n'" ]
creates a table given any set of columns
[ "creates", "a", "table", "given", "any", "set", "of", "columns" ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/gen-cpydiff.py#L123-L154
train
Generates a table given any set of columns
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,bdLuls3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ZiX,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(553 - 505) + chr(0b110000 + 0o77) + chr(866 - 816) + chr(52) + chr(0b1100 + 0o45), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\062' + '\062' + chr(0b110001), 46376 - 46368), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b10000 + 0o137) + chr(53) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b110100) + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11010 + 0o27) + chr(1905 - 1853) + chr(1582 - 1534), 16287 - 16279), ehT0Px3KOsy9('\x30' + chr(0b110000 + 0o77) + chr(0b110010) + chr(0b110110) + '\x34', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b110011 + 0o0) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(1423 - 1372) + chr(55) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(5979 - 5868) + '\x32' + chr(0b11110 + 0o23) + '\x35', 0o10), ehT0Px3KOsy9(chr(1516 - 1468) + '\x6f' + '\x32' + '\x37' + chr(1178 - 1128), ord("\x08")), ehT0Px3KOsy9(chr(1209 - 1161) + chr(0b1101111) + '\061' + '\x37' + chr(0b10000 + 0o41), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(0b110110), 17611 - 17603), ehT0Px3KOsy9(chr(0b110000) + chr(10858 - 10747) + '\061' + '\067' + chr(0b1010 + 0o46), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + chr(485 - 435) + chr(719 - 669), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + '\061', 9495 - 9487), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b100110 + 0o111) + chr(0b110101) + chr(774 - 726), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b1110 + 0o50) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5937 - 5826) + chr(0b110010) + '\x31' + '\065', 8), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + chr(51) + chr(0b110110 + 0o0) + chr(53), 25192 - 25184), ehT0Px3KOsy9('\x30' + chr(7320 - 7209) + chr(49) + chr(0b110110) + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b10 + 0o155) + '\062' + '\x37' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(738 - 687) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(4936 - 4825) + '\x31' + '\x37' + chr(772 - 722), 33990 - 33982), ehT0Px3KOsy9('\060' + chr(4539 - 4428) + chr(0b110011) + '\x30' + chr(1128 - 1079), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(0b110000 + 0o3) + chr(0b11110 + 0o27), ord("\x08")), ehT0Px3KOsy9(chr(2076 - 2028) + chr(8951 - 8840) + '\067' + chr(0b10000 + 0o43), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + '\x37' + chr(979 - 930), 8), ehT0Px3KOsy9(chr(0b110000) + chr(2669 - 2558) + chr(0b110001) + chr(54) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(489 - 441) + chr(50), 29925 - 29917), ehT0Px3KOsy9(chr(301 - 253) + '\157' + chr(0b110010) + '\063' + chr(50), 45314 - 45306), ehT0Px3KOsy9(chr(0b110000) + chr(10555 - 10444) + chr(824 - 774) + chr(54) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b111111 + 0o60) + '\063' + chr(52) + '\x33', 8), ehT0Px3KOsy9(chr(48) + chr(0b100011 + 0o114) + '\063' + chr(0b110011) + chr(1589 - 1541), 0o10), ehT0Px3KOsy9('\060' + chr(0b100000 + 0o117) + '\x33' + chr(51) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + chr(1950 - 1901) + chr(1336 - 1286) + chr(0b110011), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1010000 + 0o37) + chr(821 - 768) + chr(0b101 + 0o53), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8f'), '\x64' + chr(0b101011 + 0o72) + chr(99) + chr(0b101011 + 0o104) + chr(0b1100100) + chr(5107 - 5006))('\165' + '\164' + '\146' + '\x2d' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ZXzvZDu7Bduy(aqpRP5sxx_oP): Rw50tivZERUq = [] Fi4rSe0UiOkK = [] for Pl0JgJDv0QqN in aqpRP5sxx_oP: g9vHcJKUClJz = ehT0Px3KOsy9('\x30' + chr(6600 - 6489) + chr(0b110000), 0b1000) for DuP5x7rEFa7R in Pl0JgJDv0QqN: izUh4XSf7tJY = DuP5x7rEFa7R.split(xafqLlk3kkUe(SXOLrMavuUCe(b'\xab'), chr(7982 - 7882) + chr(0b101111 + 0o66) + '\143' + chr(0b1101111) + '\x64' + chr(101))(chr(7220 - 7103) + chr(116) + '\146' + chr(0b101101) + chr(0b1011 + 0o55))) for LycYkDpyelF6 in izUh4XSf7tJY: g9vHcJKUClJz = tsdjvlgh9gDP(c2A0yzQpDQB3(LycYkDpyelF6) + ehT0Px3KOsy9(chr(1921 - 1873) + '\x6f' + '\x32', 8554 - 8546), g9vHcJKUClJz) xafqLlk3kkUe(Rw50tivZERUq, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0\xe1Z\x86\x0e\xd0'), '\144' + '\x65' + '\143' + chr(111) + chr(0b101111 + 0o65) + '\x65')(chr(117) + chr(0b1010101 + 0o37) + chr(0b110011 + 0o63) + '\x2d' + chr(605 - 549)))(g9vHcJKUClJz) for WVxHKyX45z_L in vQr8gNKaIaWE(c2A0yzQpDQB3(aqpRP5sxx_oP[ehT0Px3KOsy9('\x30' + '\x6f' + chr(48), 8)])): gMlDWMAO4ir9 = ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(5858 - 5747) + chr(427 - 379), 8) for tlORBuYsiw3X in vQr8gNKaIaWE(c2A0yzQpDQB3(aqpRP5sxx_oP)): gMlDWMAO4ir9 = tsdjvlgh9gDP(gMlDWMAO4ir9, c2A0yzQpDQB3(aqpRP5sxx_oP[tlORBuYsiw3X][WVxHKyX45z_L].split(xafqLlk3kkUe(SXOLrMavuUCe(b'\xab'), '\x64' + '\x65' + chr(99) + chr(111) + '\144' + '\145')(chr(0b1110101) + chr(116) + chr(0b1100110) + '\x2d' + chr(0b110111 + 0o1))))) xafqLlk3kkUe(Fi4rSe0UiOkK, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0\xe1Z\x86\x0e\xd0'), chr(0b1100100) + chr(3609 - 3508) + chr(0b1100011) + '\x6f' + chr(3005 - 2905) + chr(0b1100101))('\165' + chr(0b111011 + 0o71) + chr(102) + '\x2d' + '\070'))(gMlDWMAO4ir9) N8Npp0PCg92W = xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a'), chr(100) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + '\x65')('\x75' + chr(0b1000 + 0o154) + chr(0b1010011 + 0o23) + chr(45) + chr(56)) + xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(100) + chr(9099 - 8998) + '\143' + chr(10294 - 10183) + chr(0b1100100) + chr(7591 - 7490))(chr(10978 - 10861) + chr(116) + chr(0b1010110 + 0o20) + chr(45) + '\x38')._oWXztVNnqHF([xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c'), '\x64' + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(0b1110101) + '\164' + '\146' + chr(657 - 612) + '\070') * WVxHKyX45z_L + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(7203 - 7086) + chr(0b1011110 + 0o26) + chr(0b101100 + 0o72) + chr(0b101101) + chr(0b111000)) for WVxHKyX45z_L in Rw50tivZERUq]) + xafqLlk3kkUe(SXOLrMavuUCe(b'\xab'), chr(1385 - 1285) + chr(101) + chr(0b1100011) + '\157' + chr(0b1011011 + 0o11) + '\145')('\x75' + chr(6446 - 6330) + chr(966 - 864) + chr(0b10100 + 0o31) + '\070') YbLi4ide0_3E = N8Npp0PCg92W for WVxHKyX45z_L in vQr8gNKaIaWE(c2A0yzQpDQB3(Fi4rSe0UiOkK)): TAK9K32TkBdA = [Pl0JgJDv0QqN[WVxHKyX45z_L] for Pl0JgJDv0QqN in aqpRP5sxx_oP] TAK9K32TkBdA = [DuP5x7rEFa7R + xafqLlk3kkUe(SXOLrMavuUCe(b'\xab'), chr(0b1100100) + chr(101) + '\x63' + chr(1843 - 1732) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(0b101101 + 0o0) + '\x38') * (Fi4rSe0UiOkK[WVxHKyX45z_L] - c2A0yzQpDQB3(DuP5x7rEFa7R.split(xafqLlk3kkUe(SXOLrMavuUCe(b'\xab'), chr(100) + '\x65' + chr(0b10011 + 0o120) + '\157' + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(0b10101 + 0o137) + chr(102) + chr(45) + '\070')))) for DuP5x7rEFa7R in TAK9K32TkBdA] TAK9K32TkBdA = [DuP5x7rEFa7R.split(xafqLlk3kkUe(SXOLrMavuUCe(b'\xab'), '\144' + chr(7260 - 7159) + chr(5444 - 5345) + '\157' + '\x64' + chr(5597 - 5496))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(45) + chr(0b111000))) for DuP5x7rEFa7R in TAK9K32TkBdA] for tlORBuYsiw3X in vQr8gNKaIaWE(Fi4rSe0UiOkK[WVxHKyX45z_L]): OolUPRJhRaJd = ehT0Px3KOsy9('\060' + '\157' + '\060', 8) for DuP5x7rEFa7R in TAK9K32TkBdA: mPx09rBTrGXR = Rw50tivZERUq[OolUPRJhRaJd] YbLi4ide0_3E += xafqLlk3kkUe(SXOLrMavuUCe(b''), '\x64' + chr(0b1100101) + chr(7306 - 7207) + chr(0b1101111) + '\144' + chr(0b1100101))('\165' + chr(0b1101100 + 0o10) + chr(102) + '\x2d' + chr(56))._oWXztVNnqHF([xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1Q\xd9\x1b\xc9v'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(0b1000010 + 0o55) + '\x64' + chr(0b110110 + 0o57))(chr(0b100 + 0o161) + chr(9049 - 8933) + '\x66' + chr(815 - 770) + chr(0b111000)).V4roHaS3Ppej(DuP5x7rEFa7R[tlORBuYsiw3X], mPx09rBTrGXR - ehT0Px3KOsy9(chr(48) + '\157' + '\x31', 0b1000))]) OolUPRJhRaJd += ehT0Px3KOsy9(chr(0b110000) + chr(0b111000 + 0o67) + chr(738 - 689), 8) YbLi4ide0_3E += xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\x9b'), chr(0b110011 + 0o61) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b101110 + 0o67))('\165' + '\164' + chr(0b1011010 + 0o14) + chr(0b11 + 0o52) + '\070') YbLi4ide0_3E += N8Npp0PCg92W return YbLi4ide0_3E + xafqLlk3kkUe(SXOLrMavuUCe(b'\xab'), chr(0b1100100) + '\145' + chr(99) + chr(0b1101111) + '\x64' + '\x65')(chr(164 - 47) + chr(0b1110100) + chr(9499 - 9397) + chr(45) + '\070')
micropython/micropython
tools/gen-cpydiff.py
gen_rst
def gen_rst(results): """ creates restructured text documents to display tests """ # make sure the destination directory exists try: os.mkdir(DOCPATH) except OSError as e: if e.args[0] != errno.EEXIST and e.args[0] != errno.EISDIR: raise toctree = [] class_ = [] for output in results: section = output.class_.split(',') for i in range(len(section)): section[i] = section[i].rstrip() if section[i] in CLASSMAP: section[i] = CLASSMAP[section[i]] if i >= len(class_) or section[i] != class_[i]: if i == 0: filename = section[i].replace(' ', '_').lower() rst = open(DOCPATH + filename + '.rst', 'w') rst.write(HEADER) rst.write(section[i] + '\n') rst.write(RSTCHARS[0] * len(section[i])) rst.write(time.strftime("\nGenerated %a %d %b %Y %X UTC\n\n", time.gmtime())) toctree.append(filename) else: rst.write(section[i] + '\n') rst.write(RSTCHARS[min(i, len(RSTCHARS)-1)] * len(section[i])) rst.write('\n\n') class_ = section rst.write('.. _cpydiff_%s:\n\n' % output.name.rsplit('.', 1)[0]) rst.write(output.desc + '\n') rst.write('~' * len(output.desc) + '\n\n') if output.cause != 'Unknown': rst.write('**Cause:** ' + output.cause + '\n\n') if output.workaround != 'Unknown': rst.write('**Workaround:** ' + output.workaround + '\n\n') rst.write('Sample code::\n\n' + indent(output.code, TAB) + '\n') output_cpy = indent(''.join(output.output_cpy[0:2]), TAB).rstrip() output_cpy = ('::\n\n' if output_cpy != '' else '') + output_cpy output_upy = indent(''.join(output.output_upy[0:2]), TAB).rstrip() output_upy = ('::\n\n' if output_upy != '' else '') + output_upy table = gen_table([['CPy output:', output_cpy], ['uPy output:', output_upy]]) rst.write(table) template = open(INDEXTEMPLATE, 'r') index = open(DOCPATH + INDEX, 'w') index.write(HEADER) index.write(template.read()) for section in INDEXPRIORITY: if section in toctree: index.write(indent(section + '.rst', TAB)) toctree.remove(section) for section in toctree: index.write(indent(section + '.rst', TAB))
python
def gen_rst(results): """ creates restructured text documents to display tests """ # make sure the destination directory exists try: os.mkdir(DOCPATH) except OSError as e: if e.args[0] != errno.EEXIST and e.args[0] != errno.EISDIR: raise toctree = [] class_ = [] for output in results: section = output.class_.split(',') for i in range(len(section)): section[i] = section[i].rstrip() if section[i] in CLASSMAP: section[i] = CLASSMAP[section[i]] if i >= len(class_) or section[i] != class_[i]: if i == 0: filename = section[i].replace(' ', '_').lower() rst = open(DOCPATH + filename + '.rst', 'w') rst.write(HEADER) rst.write(section[i] + '\n') rst.write(RSTCHARS[0] * len(section[i])) rst.write(time.strftime("\nGenerated %a %d %b %Y %X UTC\n\n", time.gmtime())) toctree.append(filename) else: rst.write(section[i] + '\n') rst.write(RSTCHARS[min(i, len(RSTCHARS)-1)] * len(section[i])) rst.write('\n\n') class_ = section rst.write('.. _cpydiff_%s:\n\n' % output.name.rsplit('.', 1)[0]) rst.write(output.desc + '\n') rst.write('~' * len(output.desc) + '\n\n') if output.cause != 'Unknown': rst.write('**Cause:** ' + output.cause + '\n\n') if output.workaround != 'Unknown': rst.write('**Workaround:** ' + output.workaround + '\n\n') rst.write('Sample code::\n\n' + indent(output.code, TAB) + '\n') output_cpy = indent(''.join(output.output_cpy[0:2]), TAB).rstrip() output_cpy = ('::\n\n' if output_cpy != '' else '') + output_cpy output_upy = indent(''.join(output.output_upy[0:2]), TAB).rstrip() output_upy = ('::\n\n' if output_upy != '' else '') + output_upy table = gen_table([['CPy output:', output_cpy], ['uPy output:', output_upy]]) rst.write(table) template = open(INDEXTEMPLATE, 'r') index = open(DOCPATH + INDEX, 'w') index.write(HEADER) index.write(template.read()) for section in INDEXPRIORITY: if section in toctree: index.write(indent(section + '.rst', TAB)) toctree.remove(section) for section in toctree: index.write(indent(section + '.rst', TAB))
[ "def", "gen_rst", "(", "results", ")", ":", "# make sure the destination directory exists", "try", ":", "os", ".", "mkdir", "(", "DOCPATH", ")", "except", "OSError", "as", "e", ":", "if", "e", ".", "args", "[", "0", "]", "!=", "errno", ".", "EEXIST", "and", "e", ".", "args", "[", "0", "]", "!=", "errno", ".", "EISDIR", ":", "raise", "toctree", "=", "[", "]", "class_", "=", "[", "]", "for", "output", "in", "results", ":", "section", "=", "output", ".", "class_", ".", "split", "(", "','", ")", "for", "i", "in", "range", "(", "len", "(", "section", ")", ")", ":", "section", "[", "i", "]", "=", "section", "[", "i", "]", ".", "rstrip", "(", ")", "if", "section", "[", "i", "]", "in", "CLASSMAP", ":", "section", "[", "i", "]", "=", "CLASSMAP", "[", "section", "[", "i", "]", "]", "if", "i", ">=", "len", "(", "class_", ")", "or", "section", "[", "i", "]", "!=", "class_", "[", "i", "]", ":", "if", "i", "==", "0", ":", "filename", "=", "section", "[", "i", "]", ".", "replace", "(", "' '", ",", "'_'", ")", ".", "lower", "(", ")", "rst", "=", "open", "(", "DOCPATH", "+", "filename", "+", "'.rst'", ",", "'w'", ")", "rst", ".", "write", "(", "HEADER", ")", "rst", ".", "write", "(", "section", "[", "i", "]", "+", "'\\n'", ")", "rst", ".", "write", "(", "RSTCHARS", "[", "0", "]", "*", "len", "(", "section", "[", "i", "]", ")", ")", "rst", ".", "write", "(", "time", ".", "strftime", "(", "\"\\nGenerated %a %d %b %Y %X UTC\\n\\n\"", ",", "time", ".", "gmtime", "(", ")", ")", ")", "toctree", ".", "append", "(", "filename", ")", "else", ":", "rst", ".", "write", "(", "section", "[", "i", "]", "+", "'\\n'", ")", "rst", ".", "write", "(", "RSTCHARS", "[", "min", "(", "i", ",", "len", "(", "RSTCHARS", ")", "-", "1", ")", "]", "*", "len", "(", "section", "[", "i", "]", ")", ")", "rst", ".", "write", "(", "'\\n\\n'", ")", "class_", "=", "section", "rst", ".", "write", "(", "'.. _cpydiff_%s:\\n\\n'", "%", "output", ".", "name", ".", "rsplit", "(", "'.'", ",", "1", ")", "[", "0", "]", ")", "rst", ".", "write", "(", "output", ".", "desc", "+", "'\\n'", ")", "rst", ".", "write", "(", "'~'", "*", "len", "(", "output", ".", "desc", ")", "+", "'\\n\\n'", ")", "if", "output", ".", "cause", "!=", "'Unknown'", ":", "rst", ".", "write", "(", "'**Cause:** '", "+", "output", ".", "cause", "+", "'\\n\\n'", ")", "if", "output", ".", "workaround", "!=", "'Unknown'", ":", "rst", ".", "write", "(", "'**Workaround:** '", "+", "output", ".", "workaround", "+", "'\\n\\n'", ")", "rst", ".", "write", "(", "'Sample code::\\n\\n'", "+", "indent", "(", "output", ".", "code", ",", "TAB", ")", "+", "'\\n'", ")", "output_cpy", "=", "indent", "(", "''", ".", "join", "(", "output", ".", "output_cpy", "[", "0", ":", "2", "]", ")", ",", "TAB", ")", ".", "rstrip", "(", ")", "output_cpy", "=", "(", "'::\\n\\n'", "if", "output_cpy", "!=", "''", "else", "''", ")", "+", "output_cpy", "output_upy", "=", "indent", "(", "''", ".", "join", "(", "output", ".", "output_upy", "[", "0", ":", "2", "]", ")", ",", "TAB", ")", ".", "rstrip", "(", ")", "output_upy", "=", "(", "'::\\n\\n'", "if", "output_upy", "!=", "''", "else", "''", ")", "+", "output_upy", "table", "=", "gen_table", "(", "[", "[", "'CPy output:'", ",", "output_cpy", "]", ",", "[", "'uPy output:'", ",", "output_upy", "]", "]", ")", "rst", ".", "write", "(", "table", ")", "template", "=", "open", "(", "INDEXTEMPLATE", ",", "'r'", ")", "index", "=", "open", "(", "DOCPATH", "+", "INDEX", ",", "'w'", ")", "index", ".", "write", "(", "HEADER", ")", "index", ".", "write", "(", "template", ".", "read", "(", ")", ")", "for", "section", "in", "INDEXPRIORITY", ":", "if", "section", "in", "toctree", ":", "index", ".", "write", "(", "indent", "(", "section", "+", "'.rst'", ",", "TAB", ")", ")", "toctree", ".", "remove", "(", "section", ")", "for", "section", "in", "toctree", ":", "index", ".", "write", "(", "indent", "(", "section", "+", "'.rst'", ",", "TAB", ")", ")" ]
creates restructured text documents to display tests
[ "creates", "restructured", "text", "documents", "to", "display", "tests" ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/gen-cpydiff.py#L156-L213
train
Generates the rst file for the given list of results.
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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DU,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(0b11001 + 0o27) + '\x6f' + '\x32' + chr(53) + chr(0b1111 + 0o43), 20444 - 20436), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(6863 - 6752) + '\x33' + chr(48) + chr(367 - 316), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(6272 - 6161) + chr(50) + '\x32' + chr(55), 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1000100 + 0o53) + '\x31' + chr(0b110100) + '\062', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(50) + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + chr(3725 - 3614) + chr(0b101011 + 0o13) + chr(0b1011 + 0o45), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(6892 - 6781) + chr(2180 - 2126) + chr(1174 - 1122), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(0b110001) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110 + 0o151) + '\x31' + chr(2611 - 2556) + chr(48), 53578 - 53570), ehT0Px3KOsy9(chr(0b110000) + chr(0b100000 + 0o117) + chr(0b110010) + '\063' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(2251 - 2203) + chr(3654 - 3543) + chr(49) + chr(0b110110) + chr(0b111 + 0o52), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(5600 - 5489) + '\063' + chr(0b10100 + 0o35) + chr(0b110010), 51896 - 51888), ehT0Px3KOsy9(chr(1658 - 1610) + chr(0b1000001 + 0o56) + '\x33' + '\x36' + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(0b110001) + '\063', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(54) + '\066', 59750 - 59742), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + chr(0b110010) + chr(0b110000) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110 + 0o151) + chr(0b10110 + 0o33) + chr(0b10100 + 0o36) + '\x35', 50474 - 50466), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(117 - 65) + chr(0b110100), 39511 - 39503), ehT0Px3KOsy9(chr(1042 - 994) + '\x6f' + chr(0b110010) + chr(0b110111) + chr(54), 0b1000), ehT0Px3KOsy9('\x30' + chr(5064 - 4953) + '\x31' + chr(1807 - 1758) + chr(0b10 + 0o62), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + '\x32' + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(5339 - 5228) + '\063' + '\x31' + chr(0b110010), 8), ehT0Px3KOsy9('\060' + chr(3071 - 2960) + chr(0b110001 + 0o1) + chr(255 - 206) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(3928 - 3817) + chr(0b110011) + chr(0b10111 + 0o33) + chr(0b110010 + 0o1), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(1559 - 1506) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\157' + chr(0b110010) + chr(0b10110 + 0o34) + chr(2460 - 2407), 42667 - 42659), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + '\066' + chr(323 - 273), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b0 + 0o63) + '\x33' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1000111 + 0o50) + chr(0b10000 + 0o43) + '\067' + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(53) + '\x34', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(0b1000 + 0o51) + chr(1556 - 1506), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111 + 0o0) + chr(0b110010) + chr(52) + chr(753 - 705), 0o10), ehT0Px3KOsy9(chr(435 - 387) + '\x6f' + '\x31' + '\x32' + chr(2482 - 2429), 8), ehT0Px3KOsy9(chr(1684 - 1636) + '\157' + chr(51) + chr(55) + chr(2177 - 2124), 8), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(2321 - 2267), ord("\x08")), ehT0Px3KOsy9(chr(252 - 204) + chr(0b1101111) + '\062' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1000010 + 0o55) + '\064' + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(52) + chr(50), 2149 - 2141), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(111) + chr(1062 - 1013) + '\062' + chr(0b10001 + 0o42), 8), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(1514 - 1460), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + '\065' + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x84'), chr(0b1100001 + 0o3) + '\145' + chr(0b1010110 + 0o15) + '\x6f' + chr(0b1100100) + '\145')(chr(117) + '\x74' + chr(0b1100110) + '\x2d' + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def I89s_eKuaHpr(iIGKX2zSEGYP): try: xafqLlk3kkUe(oqhJDdMJfuwx, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc7\xa8\xf3\x0b!'), '\144' + '\145' + '\143' + '\157' + chr(0b1100100) + '\145')('\165' + chr(0b1010011 + 0o41) + chr(2595 - 2493) + chr(1463 - 1418) + '\x38'))(AXOK9exqoE10) except KlPSljPzIJ_u as GlnVAPeT6CUe: if xafqLlk3kkUe(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1\x89\xd305b\\o"\xd7\x1b\x99'), '\144' + chr(2912 - 2811) + chr(0b1100001 + 0o2) + '\157' + chr(0b1 + 0o143) + '\x65')(chr(0b1100100 + 0o21) + chr(0b100100 + 0o120) + chr(0b1100110) + chr(1371 - 1326) + chr(0b11 + 0o65)))[ehT0Px3KOsy9(chr(48) + chr(111) + chr(2023 - 1975), ord("\x08"))] != xafqLlk3kkUe(lKz5VhncMjGe, xafqLlk3kkUe(SXOLrMavuUCe(b'\xef\x86\xcf+\x00d'), chr(0b1100100) + chr(0b1000 + 0o135) + chr(0b100111 + 0o74) + chr(111) + chr(0b1001010 + 0o32) + '\145')(chr(0b1110101) + chr(116) + '\x66' + '\x2d' + '\070')) and xafqLlk3kkUe(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1\x89\xd305b\\o"\xd7\x1b\x99'), '\144' + '\145' + chr(380 - 281) + chr(10753 - 10642) + chr(0b1100100) + chr(2548 - 2447))(chr(4603 - 4486) + chr(0b1110100) + '\x66' + '\x2d' + '\070'))[ehT0Px3KOsy9(chr(491 - 443) + chr(0b1101111) + chr(1962 - 1914), 8)] != xafqLlk3kkUe(lKz5VhncMjGe, xafqLlk3kkUe(SXOLrMavuUCe(b'\xef\x8a\xc4&\x1ab'), chr(100) + chr(0b1100101) + '\143' + '\x6f' + chr(0b1100100) + chr(101))('\x75' + chr(6455 - 6339) + chr(0b100101 + 0o101) + chr(0b10100 + 0o31) + '\x38')): raise tWkFH_wjzyeH = [] PP81Xh5bKXUp = [] for e1jVqMSBZ01Y in iIGKX2zSEGYP: zhibvHFgaDZW = e1jVqMSBZ01Y.class_.split(xafqLlk3kkUe(SXOLrMavuUCe(b'\x86'), chr(0b1100100) + '\145' + '\143' + chr(12035 - 11924) + chr(3445 - 3345) + '\x65')('\x75' + chr(116) + '\x66' + '\x2d' + '\x38')) for WVxHKyX45z_L in vQr8gNKaIaWE(c2A0yzQpDQB3(zhibvHFgaDZW)): zhibvHFgaDZW[WVxHKyX45z_L] = zhibvHFgaDZW[WVxHKyX45z_L].rstrip() if zhibvHFgaDZW[WVxHKyX45z_L] in kTHdM1g3CRIF: zhibvHFgaDZW[WVxHKyX45z_L] = kTHdM1g3CRIF[zhibvHFgaDZW[WVxHKyX45z_L]] if WVxHKyX45z_L >= c2A0yzQpDQB3(PP81Xh5bKXUp) or zhibvHFgaDZW[WVxHKyX45z_L] != PP81Xh5bKXUp[WVxHKyX45z_L]: if WVxHKyX45z_L == ehT0Px3KOsy9(chr(1161 - 1113) + '\x6f' + chr(0b110000), 8): xw4DsBfIJ22E = zhibvHFgaDZW[WVxHKyX45z_L].replace(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a'), '\x64' + chr(0b1100101) + '\143' + '\x6f' + chr(0b1100100) + chr(0b1000001 + 0o44))(chr(686 - 569) + chr(0b1110100) + chr(0b11101 + 0o111) + '\x2d' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5'), '\x64' + chr(0b1010101 + 0o20) + chr(99) + chr(0b1101111 + 0o0) + '\x64' + chr(4174 - 4073))('\165' + chr(6798 - 6682) + '\x66' + '\x2d' + '\070')).lower() _ZhLnqmS2SaO = _fwkIVCGgtAN(AXOK9exqoE10 + xw4DsBfIJ22E + xafqLlk3kkUe(SXOLrMavuUCe(b'\x84\xb1\xe4\x16'), chr(4213 - 4113) + '\145' + chr(0b1100011) + chr(0b101 + 0o152) + chr(395 - 295) + '\x65')('\x75' + '\x74' + chr(0b1000101 + 0o41) + chr(265 - 220) + chr(0b11000 + 0o40)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd'), chr(0b1100100 + 0o0) + chr(0b1000101 + 0o40) + '\x63' + chr(0b111000 + 0o67) + chr(0b110001 + 0o63) + chr(0b1100101))(chr(5065 - 4948) + chr(0b1110100) + chr(0b100010 + 0o104) + '\x2d' + '\x38')) xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), '\x64' + chr(101) + chr(0b1100011) + '\157' + '\144' + '\145')('\x75' + chr(116) + chr(102) + chr(0b101101) + chr(56)))(lLacMCMSfP99) xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), chr(0b1011000 + 0o14) + '\145' + chr(0b100110 + 0o75) + chr(0b1101111) + chr(5597 - 5497) + '\145')(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b1001 + 0o44) + chr(0b111000)))(zhibvHFgaDZW[WVxHKyX45z_L] + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0'), chr(0b101101 + 0o67) + '\145' + chr(0b1100011) + chr(0b1101100 + 0o3) + chr(2683 - 2583) + chr(0b1100101))('\x75' + chr(0b1000011 + 0o61) + chr(2248 - 2146) + '\055' + chr(0b111000))) xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), '\x64' + '\145' + chr(99) + '\x6f' + chr(819 - 719) + chr(503 - 402))(chr(0b1110101) + '\x74' + chr(0b101010 + 0o74) + '\055' + chr(56)))(tYrGGTv0qmqB[ehT0Px3KOsy9(chr(1613 - 1565) + chr(1406 - 1295) + chr(0b110000), 8)] * c2A0yzQpDQB3(zhibvHFgaDZW[WVxHKyX45z_L])) xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), chr(100) + chr(5094 - 4993) + '\x63' + chr(111) + chr(0b100100 + 0o100) + chr(101))(chr(0b1110101) + '\164' + '\x66' + chr(0b101101) + '\x38'))(xafqLlk3kkUe(ltvhPP4VhXre, xafqLlk3kkUe(SXOLrMavuUCe(b"\xd9\xb7\xe5\x04'YYi"), chr(0b1100100) + chr(0b100101 + 0o100) + '\143' + chr(111) + '\144' + chr(0b1100101))(chr(117) + '\x74' + '\146' + '\x2d' + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0\x84\xf2\x0c6BUx\x1d\xfbQ\xef\x92k\x13\xe4u\x81\xdclq\x93\xae\xf6\xf6\xb5\xa7\x8f\xbe\xa6\xc0'), '\144' + '\x65' + chr(9275 - 9176) + chr(0b1000010 + 0o55) + chr(100) + chr(101))(chr(0b1110101) + chr(728 - 612) + chr(102) + chr(45) + chr(407 - 351)), xafqLlk3kkUe(ltvhPP4VhXre, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd\xae\xe3\x0b>U'), '\x64' + '\145' + chr(0b11101 + 0o106) + chr(0b1000 + 0o147) + chr(0b1100100) + '\145')(chr(117) + chr(7430 - 7314) + '\x66' + '\055' + chr(0b111000)))())) xafqLlk3kkUe(tWkFH_wjzyeH, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcb\xb3\xe7\x07=T'), chr(425 - 325) + '\x65' + chr(4584 - 4485) + chr(0b1101111) + chr(100) + '\x65')('\x75' + '\164' + chr(8406 - 8304) + '\x2d' + chr(0b1 + 0o67)))(xw4DsBfIJ22E) else: xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), chr(0b110110 + 0o56) + chr(0b111000 + 0o55) + chr(0b1100011) + '\157' + '\144' + '\x65')('\x75' + '\x74' + '\146' + chr(0b10 + 0o53) + chr(0b111000)))(zhibvHFgaDZW[WVxHKyX45z_L] + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0'), chr(0b1001011 + 0o31) + chr(0b1001001 + 0o34) + '\143' + '\x6f' + '\x64' + '\145')(chr(0b1110101) + chr(10082 - 9966) + chr(102) + '\x2d' + chr(56))) xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), chr(0b1010100 + 0o20) + chr(0b1011 + 0o132) + '\x63' + chr(0b1101111) + chr(0b10010 + 0o122) + '\145')(chr(5901 - 5784) + chr(6911 - 6795) + '\146' + '\x2d' + '\070'))(tYrGGTv0qmqB[Dx22bkKPdt5d(WVxHKyX45z_L, c2A0yzQpDQB3(tYrGGTv0qmqB) - ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49), 15017 - 15009))] * c2A0yzQpDQB3(zhibvHFgaDZW[WVxHKyX45z_L])) xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), '\x64' + chr(0b1100101) + chr(3755 - 3656) + chr(0b1001101 + 0o42) + '\144' + chr(101))(chr(13671 - 13554) + chr(0b1101 + 0o147) + chr(0b1100110) + chr(0b101101) + chr(2882 - 2826)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0\xc9'), '\144' + chr(0b1100101) + '\143' + chr(0b1101111) + chr(100) + '\145')(chr(2452 - 2335) + '\164' + chr(0b1010101 + 0o21) + chr(0b101101) + '\x38')) PP81Xh5bKXUp = zhibvHFgaDZW xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(111) + chr(2385 - 2285) + chr(101))(chr(0b1110101) + '\x74' + chr(645 - 543) + '\055' + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x84\xed\xb7=0@Mh\x11\xf9\x17\x95\xd68\x0c\x8a_'), chr(4781 - 4681) + chr(0b1010000 + 0o25) + '\x63' + chr(0b1101111) + chr(100) + chr(0b11110 + 0o107))(chr(0b111010 + 0o73) + chr(0b1110100) + chr(0b100000 + 0o106) + chr(0b10010 + 0o33) + chr(2045 - 1989)) % xafqLlk3kkUe(e1jVqMSBZ01Y.name, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\xb0\xe7\x0e:D'), '\144' + chr(0b1000111 + 0o36) + chr(99) + chr(12287 - 12176) + chr(100) + '\x65')('\165' + chr(116) + chr(102) + '\x2d' + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x84'), chr(100) + '\x65' + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(8189 - 8088))(chr(117) + '\164' + chr(0b10011 + 0o123) + '\x2d' + chr(0b10 + 0o66)), ehT0Px3KOsy9(chr(1846 - 1798) + chr(0b1010001 + 0o36) + '\x31', 8))[ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b111000 + 0o67) + chr(48), 8)]) xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), chr(0b1010101 + 0o17) + chr(101) + chr(0b100011 + 0o100) + chr(7081 - 6970) + chr(2645 - 2545) + chr(101))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(0b111000)))(xafqLlk3kkUe(e1jVqMSBZ01Y, xafqLlk3kkUe(SXOLrMavuUCe(b'\xce\xa6\xe4\x01'), chr(0b1100100) + '\145' + '\x63' + chr(0b1101111) + chr(0b1100100) + '\145')('\165' + chr(12936 - 12820) + chr(0b11100 + 0o112) + chr(0b100001 + 0o14) + chr(56))) + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0'), chr(0b1100100) + chr(0b1100101) + chr(0b100101 + 0o76) + '\x6f' + '\144' + '\145')('\165' + chr(0b1110100) + '\x66' + chr(45) + chr(0b111000))) xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), chr(0b1001010 + 0o32) + '\145' + chr(0b110011 + 0o60) + '\x6f' + chr(0b1100100) + chr(6874 - 6773))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(0b100000 + 0o15) + chr(2217 - 2161)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd4'), '\x64' + '\145' + '\143' + chr(111) + '\144' + chr(0b1001111 + 0o26))(chr(117) + chr(116) + '\x66' + '\x2d' + chr(1466 - 1410)) * c2A0yzQpDQB3(xafqLlk3kkUe(e1jVqMSBZ01Y, xafqLlk3kkUe(SXOLrMavuUCe(b'\xce\xa6\xe4\x01'), chr(0b1100100) + '\x65' + chr(6030 - 5931) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(117) + chr(116) + chr(102) + chr(0b11111 + 0o16) + chr(0b101000 + 0o20)))) + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0\xc9'), chr(0b1010011 + 0o21) + chr(101) + chr(0b1100011) + chr(111) + chr(100) + '\x65')('\x75' + chr(116) + '\146' + '\055' + chr(196 - 140))) if xafqLlk3kkUe(e1jVqMSBZ01Y, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9\xa2\xe2\x116'), '\144' + '\145' + '\x63' + chr(0b101111 + 0o100) + '\x64' + '\145')('\x75' + '\164' + '\146' + chr(1553 - 1508) + chr(3035 - 2979))) != xafqLlk3kkUe(SXOLrMavuUCe(b'\xff\xad\xfc\x0c<GZ'), chr(0b0 + 0o144) + '\145' + '\x63' + chr(0b111110 + 0o61) + chr(0b1100100) + chr(0b1100101))('\x75' + chr(6120 - 6004) + '\146' + chr(802 - 757) + chr(2187 - 2131)): xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), '\144' + chr(101) + '\x63' + chr(111) + chr(6311 - 6211) + '\x65')(chr(0b1110101) + '\x74' + chr(1427 - 1325) + '\055' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x80\xe9\xd4\x03&CQ6R\xb5Q'), chr(0b1011 + 0o131) + chr(0b1010100 + 0o21) + '\143' + '\157' + '\x64' + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(3575 - 3473) + chr(0b101101) + '\x38') + xafqLlk3kkUe(e1jVqMSBZ01Y, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9\xa2\xe2\x116'), chr(350 - 250) + chr(0b1100101) + '\143' + '\157' + chr(0b11001 + 0o113) + chr(0b100010 + 0o103))('\x75' + '\x74' + chr(102) + chr(0b101101) + chr(56))) + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0\xc9'), chr(0b1100100) + chr(0b1001011 + 0o32) + chr(0b11 + 0o140) + chr(0b1101111) + '\x64' + chr(0b1100101))('\x75' + '\x74' + chr(0b1010001 + 0o25) + '\055' + chr(0b11001 + 0o37))) if xafqLlk3kkUe(e1jVqMSBZ01Y, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xac\xe5\t2B[y\x16\xfb'), chr(0b1100100) + chr(0b1100001 + 0o4) + chr(0b101001 + 0o72) + chr(0b1101111) + '\x64' + '\145')(chr(0b1101001 + 0o14) + chr(1353 - 1237) + chr(0b1100110) + '\055' + '\x38')) != xafqLlk3kkUe(SXOLrMavuUCe(b'\xff\xad\xfc\x0c<GZ'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(0b1101101 + 0o2) + chr(0b1100100) + '\x65')(chr(0b1000110 + 0o57) + chr(0b1110100) + '\146' + chr(0b101 + 0o50) + chr(0b110000 + 0o10)): xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), chr(723 - 623) + chr(101) + chr(0b100110 + 0o75) + '\157' + '\144' + chr(101))('\165' + '\x74' + chr(0b110 + 0o140) + chr(0b0 + 0o55) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x80\xe9\xc0\r![U~\x17\xea\x1f\xae\xc9a\x1c\xa0'), chr(0b1011000 + 0o14) + chr(0b111001 + 0o54) + '\143' + '\x6f' + '\144' + '\x65')('\x75' + '\x74' + chr(0b1100110) + chr(45) + chr(0b111000)) + xafqLlk3kkUe(e1jVqMSBZ01Y, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xac\xe5\t2B[y\x16\xfb'), chr(100) + chr(0b1010001 + 0o24) + '\x63' + '\157' + chr(100) + chr(101))(chr(0b1110101) + '\x74' + chr(2129 - 2027) + chr(859 - 814) + chr(56))) + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0\xc9'), '\144' + chr(6541 - 6440) + chr(8261 - 8162) + '\157' + chr(8595 - 8495) + chr(0b1100000 + 0o5))('\165' + chr(0b1100001 + 0o23) + chr(0b110000 + 0o66) + chr(1182 - 1137) + chr(0b111000))) xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), chr(6130 - 6030) + chr(919 - 818) + chr(1889 - 1790) + chr(0b1101111) + chr(100) + chr(101))('\x75' + '\x74' + chr(102) + '\055' + chr(0b101001 + 0o17)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9\xa2\xfa\x12?U\x14o\x17\xfb\x14\xf0\xc9A<'), chr(1495 - 1395) + chr(0b1100101) + chr(9112 - 9013) + chr(11224 - 11113) + '\x64' + '\145')('\x75' + chr(2932 - 2816) + chr(0b1100110) + chr(45) + '\070') + rxwJk_g4F6Db(xafqLlk3kkUe(e1jVqMSBZ01Y, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9\xac\xf3\x07'), chr(0b1100100) + chr(0b1011110 + 0o7) + chr(0b101001 + 0o72) + '\157' + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(0b11 + 0o161) + chr(0b101001 + 0o75) + chr(0b101101) + chr(0b111000))), ua6t90a7LHA2) + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0'), chr(962 - 862) + chr(7324 - 7223) + chr(99) + '\x6f' + '\144' + chr(0b10000 + 0o125))(chr(0b1110101) + '\164' + chr(2176 - 2074) + '\x2d' + '\x38')) wyJYxDO2SdCB = rxwJk_g4F6Db(xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(100) + chr(3776 - 3675) + chr(932 - 833) + chr(111) + chr(0b111100 + 0o50) + '\x65')(chr(117) + chr(0b1001101 + 0o47) + '\146' + chr(0b101101) + '\x38').join(e1jVqMSBZ01Y.output_cpy[ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(9518 - 9407) + '\x30', 8):ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b111110 + 0o61) + chr(2036 - 1986), ord("\x08"))]), ua6t90a7LHA2).rstrip() wyJYxDO2SdCB = (xafqLlk3kkUe(SXOLrMavuUCe(b'\x90\xf9\x9dh'), chr(100) + '\145' + '\x63' + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(116) + chr(102) + chr(0b111 + 0o46) + chr(56)) if wyJYxDO2SdCB != xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b110001 + 0o63) + '\145' + '\x63' + chr(4364 - 4253) + chr(0b1100100) + '\x65')(chr(7119 - 7002) + chr(0b1110100) + '\146' + chr(0b101101 + 0o0) + chr(0b111000)) else xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(100) + '\x65' + chr(99) + chr(10215 - 10104) + chr(3597 - 3497) + chr(0b1100101))('\x75' + chr(0b101100 + 0o110) + chr(0b1100110) + chr(45) + '\070')) + wyJYxDO2SdCB __QfJtRLZiFV = rxwJk_g4F6Db(xafqLlk3kkUe(SXOLrMavuUCe(b''), '\x64' + chr(0b1001100 + 0o31) + chr(4828 - 4729) + '\157' + chr(3983 - 3883) + chr(0b101 + 0o140))('\165' + '\x74' + chr(0b10111 + 0o117) + chr(1150 - 1105) + '\070').join(e1jVqMSBZ01Y.output_upy[ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(2156 - 2045) + '\060', 8):ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062', 8)]), ua6t90a7LHA2).rstrip() __QfJtRLZiFV = (xafqLlk3kkUe(SXOLrMavuUCe(b'\x90\xf9\x9dh'), '\x64' + '\x65' + chr(0b110100 + 0o57) + '\157' + chr(0b1100100) + '\145')(chr(4342 - 4225) + chr(0b1000101 + 0o57) + chr(102) + chr(1677 - 1632) + chr(0b10011 + 0o45)) if __QfJtRLZiFV != xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b1100100) + chr(0b1100101) + chr(7530 - 7431) + '\x6f' + '\x64' + chr(0b1001110 + 0o27))('\x75' + chr(13425 - 13309) + chr(330 - 228) + chr(0b101101) + chr(0b111000)) else xafqLlk3kkUe(SXOLrMavuUCe(b''), '\144' + '\145' + chr(99) + '\157' + chr(100) + '\145')(chr(8046 - 7929) + '\164' + chr(102) + chr(0b101101) + '\x38')) + __QfJtRLZiFV YbLi4ide0_3E = ZXzvZDu7Bduy([[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe9\x93\xeeB<E@|\r\xebK'), chr(0b11 + 0o141) + '\145' + '\143' + chr(111) + '\x64' + chr(101))(chr(117) + chr(13241 - 13125) + '\x66' + '\055' + chr(0b111000)), wyJYxDO2SdCB], [xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf\x93\xeeB<E@|\r\xebK'), chr(100) + chr(0b11110 + 0o107) + chr(99) + chr(3301 - 3190) + '\144' + '\x65')(chr(0b1110101) + chr(0b1110100) + '\146' + chr(0b101101) + '\x38'), __QfJtRLZiFV]]) xafqLlk3kkUe(_ZhLnqmS2SaO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(0b111010 + 0o65) + '\x64' + chr(0b1100101))('\165' + '\164' + chr(0b1100110) + chr(0b10111 + 0o26) + chr(2508 - 2452)))(YbLi4ide0_3E) jJBnSHEgylNZ = _fwkIVCGgtAN(f2DqEMkISHIL, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8'), chr(100) + '\145' + chr(99) + '\157' + chr(0b1100100) + chr(0b101111 + 0o66))(chr(0b1110101) + chr(0b1000101 + 0o57) + '\x66' + chr(45) + '\070')) XdowRbJKZWL9 = _fwkIVCGgtAN(AXOK9exqoE10 + Qxn_6zDeL8b7, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd'), chr(0b0 + 0o144) + chr(0b111100 + 0o51) + chr(99) + '\157' + chr(100) + chr(101))(chr(0b1011110 + 0o27) + chr(2547 - 2431) + '\x66' + chr(45) + chr(0b10100 + 0o44))) xafqLlk3kkUe(XdowRbJKZWL9, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), chr(0b1100100) + '\x65' + chr(2844 - 2745) + '\157' + chr(100) + '\145')(chr(2176 - 2059) + chr(3082 - 2966) + chr(8767 - 8665) + chr(45) + chr(864 - 808)))(lLacMCMSfP99) xafqLlk3kkUe(XdowRbJKZWL9, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), '\x64' + chr(0b1100101) + chr(0b1001010 + 0o31) + '\x6f' + chr(100) + '\145')(chr(0b111000 + 0o75) + chr(0b1110100) + chr(6776 - 6674) + chr(0b10111 + 0o26) + chr(1551 - 1495)))(xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xff\xf5\xda\x0b\x04B\\y;\xf6C\x93'), '\144' + chr(0b1100101) + '\x63' + chr(111) + chr(704 - 604) + chr(0b1100101))(chr(0b1110101) + '\x74' + '\x66' + chr(0b101101) + chr(1676 - 1620)))()) for zhibvHFgaDZW in JTIzkyK7TxsG: if zhibvHFgaDZW in tWkFH_wjzyeH: xafqLlk3kkUe(XdowRbJKZWL9, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), chr(0b1 + 0o143) + chr(0b1100101) + chr(5917 - 5818) + '\x6f' + '\144' + '\145')(chr(0b1110101) + chr(1645 - 1529) + '\146' + chr(0b101101) + chr(56)))(rxwJk_g4F6Db(zhibvHFgaDZW + xafqLlk3kkUe(SXOLrMavuUCe(b'\x84\xb1\xe4\x16'), '\144' + chr(101) + '\x63' + '\x6f' + chr(2950 - 2850) + chr(101))(chr(0b1010110 + 0o37) + '\x74' + chr(0b1100110) + '\x2d' + chr(56)), ua6t90a7LHA2)) xafqLlk3kkUe(tWkFH_wjzyeH, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\xa6\xfa\r%U'), chr(0b1000010 + 0o42) + chr(0b1111 + 0o126) + chr(0b100011 + 0o100) + chr(111) + chr(0b1100000 + 0o4) + chr(6002 - 5901))(chr(11616 - 11499) + chr(0b1110100) + chr(102) + '\x2d' + '\x38'))(zhibvHFgaDZW) for zhibvHFgaDZW in tWkFH_wjzyeH: xafqLlk3kkUe(XdowRbJKZWL9, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xb1\xfe\x166'), '\x64' + chr(101) + chr(0b1100011) + '\x6f' + '\x64' + chr(0b1010110 + 0o17))(chr(1355 - 1238) + chr(2715 - 2599) + '\146' + '\055' + chr(0b111000)))(rxwJk_g4F6Db(zhibvHFgaDZW + xafqLlk3kkUe(SXOLrMavuUCe(b'\x84\xb1\xe4\x16'), '\144' + chr(8680 - 8579) + chr(0b1001010 + 0o31) + chr(0b1101111) + '\144' + '\x65')(chr(7315 - 7198) + chr(0b111101 + 0o67) + chr(0b1100110) + chr(1287 - 1242) + '\070'), ua6t90a7LHA2))
micropython/micropython
tools/gen-cpydiff.py
main
def main(): """ Main function """ # set search path so that test scripts find the test modules (and no other ones) os.environ['PYTHONPATH'] = TESTPATH os.environ['MICROPYPATH'] = TESTPATH files = readfiles() results = run_tests(files) gen_rst(results)
python
def main(): """ Main function """ # set search path so that test scripts find the test modules (and no other ones) os.environ['PYTHONPATH'] = TESTPATH os.environ['MICROPYPATH'] = TESTPATH files = readfiles() results = run_tests(files) gen_rst(results)
[ "def", "main", "(", ")", ":", "# set search path so that test scripts find the test modules (and no other ones)", "os", ".", "environ", "[", "'PYTHONPATH'", "]", "=", "TESTPATH", "os", ".", "environ", "[", "'MICROPYPATH'", "]", "=", "TESTPATH", "files", "=", "readfiles", "(", ")", "results", "=", "run_tests", "(", "files", ")", "gen_rst", "(", "results", ")" ]
Main function
[ "Main", "function" ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/gen-cpydiff.py#L215-L224
train
Main function for the test.
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('\x30' + '\x6f' + chr(0b11100 + 0o26) + chr(51) + chr(55), 51594 - 51586), ehT0Px3KOsy9(chr(743 - 695) + '\x6f' + '\x32' + chr(832 - 782) + chr(0b11 + 0o63), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b110010) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000111 + 0o50) + chr(2559 - 2508) + chr(49) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(4338 - 4227) + chr(0b110011) + chr(0b11101 + 0o31) + '\065', 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\x6f' + chr(1046 - 996) + chr(663 - 609) + chr(635 - 581), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110100) + '\x32', 24143 - 24135), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1 + 0o62) + '\x31' + chr(55), 49450 - 49442), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10001 + 0o42) + chr(0b110000) + chr(1805 - 1750), 35908 - 35900), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + '\x36' + chr(2315 - 2261), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + '\x35' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + '\061' + chr(49), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10111 + 0o130) + chr(0b110111) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(2127 - 2079) + '\157' + chr(1364 - 1314) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(2238 - 2190) + chr(111) + chr(49) + chr(0b110001) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1011111 + 0o20) + chr(0b110010) + chr(0b110010) + '\066', 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(0b110110) + chr(0b110110), 44433 - 44425), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(1508 - 1459) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + chr(50) + chr(2279 - 2225), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100010 + 0o15) + chr(53) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(2400 - 2346), 39647 - 39639), ehT0Px3KOsy9('\060' + chr(9530 - 9419) + chr(0b1 + 0o62) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11100 + 0o27) + chr(0b10011 + 0o44) + '\x30', 0o10), ehT0Px3KOsy9(chr(1903 - 1855) + chr(111) + chr(0b110111) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + chr(0b110010) + '\067' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(1234 - 1185) + chr(494 - 440) + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + '\065' + chr(0b100101 + 0o16), 0o10), ehT0Px3KOsy9(chr(425 - 377) + chr(386 - 275) + chr(50) + chr(0b110101) + chr(731 - 683), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + '\067' + chr(1833 - 1784), 43242 - 43234), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(0b11111 + 0o26) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(53) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101010 + 0o5) + '\x33' + chr(1781 - 1730) + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(1656 - 1545) + chr(0b110001) + chr(0b111 + 0o54) + chr(48), 0o10), ehT0Px3KOsy9(chr(1121 - 1073) + chr(0b1101111) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(252 - 204) + chr(111) + chr(0b110001) + '\062' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11136 - 11025) + chr(1350 - 1301) + chr(160 - 107), ord("\x08")), ehT0Px3KOsy9(chr(1540 - 1492) + '\157' + '\x33' + '\x37' + chr(1317 - 1266), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\063' + '\061' + '\061', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(2037 - 1984) + chr(540 - 489), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1101111) + '\063' + chr(53) + chr(1943 - 1893), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + '\065' + chr(1527 - 1479), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1'), '\x64' + '\x65' + chr(0b10110 + 0o115) + chr(6655 - 6544) + '\x64' + chr(101))('\x75' + chr(0b1110100) + chr(0b1100110) + '\055' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def PGNrezus7XpS(): oqhJDdMJfuwx.rNK60KZ67nXB[xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf\xcf\x80\x82\xba\xf8r\x8e\x93\xfe'), chr(1439 - 1339) + chr(5370 - 5269) + chr(8883 - 8784) + '\157' + chr(0b1100100) + chr(0b1000011 + 0o42))(chr(0b1110101) + chr(0b1011011 + 0o31) + '\x66' + '\x2d' + '\x38')] = IzmWvxfCriwX oqhJDdMJfuwx.rNK60KZ67nXB[xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2\xdf\x97\x98\xba\xe6{\x9f\x86\xe2\xa2'), '\x64' + chr(0b1100101) + chr(0b1010111 + 0o14) + '\157' + chr(100) + chr(2029 - 1928))('\165' + chr(9350 - 9234) + chr(0b1100110) + '\x2d' + chr(0b101100 + 0o14))] = IzmWvxfCriwX uyc48vokp5OE = nzZGL5zQ78y6() iIGKX2zSEGYP = uco02MNW98vS(uyc48vokp5OE) I89s_eKuaHpr(iIGKX2zSEGYP)
micropython/micropython
tools/pydfu.py
init
def init(): """Initializes the found DFU device so that we can program it.""" global __dev, __cfg_descr devices = get_dfu_devices(idVendor=__VID, idProduct=__PID) if not devices: raise ValueError('No DFU device found') if len(devices) > 1: raise ValueError("Multiple DFU devices found") __dev = devices[0] __dev.set_configuration() # Claim DFU interface usb.util.claim_interface(__dev, __DFU_INTERFACE) # Find the DFU configuration descriptor, either in the device or interfaces __cfg_descr = None for cfg in __dev.configurations(): __cfg_descr = find_dfu_cfg_descr(cfg.extra_descriptors) if __cfg_descr: break for itf in cfg.interfaces(): __cfg_descr = find_dfu_cfg_descr(itf.extra_descriptors) if __cfg_descr: break # Get device into idle state for attempt in range(4): status = get_status() if status == __DFU_STATE_DFU_IDLE: break elif (status == __DFU_STATE_DFU_DOWNLOAD_IDLE or status == __DFU_STATE_DFU_UPLOAD_IDLE): abort_request() else: clr_status()
python
def init(): """Initializes the found DFU device so that we can program it.""" global __dev, __cfg_descr devices = get_dfu_devices(idVendor=__VID, idProduct=__PID) if not devices: raise ValueError('No DFU device found') if len(devices) > 1: raise ValueError("Multiple DFU devices found") __dev = devices[0] __dev.set_configuration() # Claim DFU interface usb.util.claim_interface(__dev, __DFU_INTERFACE) # Find the DFU configuration descriptor, either in the device or interfaces __cfg_descr = None for cfg in __dev.configurations(): __cfg_descr = find_dfu_cfg_descr(cfg.extra_descriptors) if __cfg_descr: break for itf in cfg.interfaces(): __cfg_descr = find_dfu_cfg_descr(itf.extra_descriptors) if __cfg_descr: break # Get device into idle state for attempt in range(4): status = get_status() if status == __DFU_STATE_DFU_IDLE: break elif (status == __DFU_STATE_DFU_DOWNLOAD_IDLE or status == __DFU_STATE_DFU_UPLOAD_IDLE): abort_request() else: clr_status()
[ "def", "init", "(", ")", ":", "global", "__dev", ",", "__cfg_descr", "devices", "=", "get_dfu_devices", "(", "idVendor", "=", "__VID", ",", "idProduct", "=", "__PID", ")", "if", "not", "devices", ":", "raise", "ValueError", "(", "'No DFU device found'", ")", "if", "len", "(", "devices", ")", ">", "1", ":", "raise", "ValueError", "(", "\"Multiple DFU devices found\"", ")", "__dev", "=", "devices", "[", "0", "]", "__dev", ".", "set_configuration", "(", ")", "# Claim DFU interface", "usb", ".", "util", ".", "claim_interface", "(", "__dev", ",", "__DFU_INTERFACE", ")", "# Find the DFU configuration descriptor, either in the device or interfaces", "__cfg_descr", "=", "None", "for", "cfg", "in", "__dev", ".", "configurations", "(", ")", ":", "__cfg_descr", "=", "find_dfu_cfg_descr", "(", "cfg", ".", "extra_descriptors", ")", "if", "__cfg_descr", ":", "break", "for", "itf", "in", "cfg", ".", "interfaces", "(", ")", ":", "__cfg_descr", "=", "find_dfu_cfg_descr", "(", "itf", ".", "extra_descriptors", ")", "if", "__cfg_descr", ":", "break", "# Get device into idle state", "for", "attempt", "in", "range", "(", "4", ")", ":", "status", "=", "get_status", "(", ")", "if", "status", "==", "__DFU_STATE_DFU_IDLE", ":", "break", "elif", "(", "status", "==", "__DFU_STATE_DFU_DOWNLOAD_IDLE", "or", "status", "==", "__DFU_STATE_DFU_UPLOAD_IDLE", ")", ":", "abort_request", "(", ")", "else", ":", "clr_status", "(", ")" ]
Initializes the found DFU device so that we can program it.
[ "Initializes", "the", "found", "DFU", "device", "so", "that", "we", "can", "program", "it", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L92-L126
train
Initializes the found DFU device so that we can program it.
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,q1QCh3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V,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) + chr(0b100011 + 0o114) + '\061' + '\060' + '\060', 5589 - 5581), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110000 + 0o2) + '\x36', 29495 - 29487), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2098 - 2047) + chr(0b110001) + chr(2149 - 2094), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001111 + 0o40) + chr(49) + chr(53) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + '\x32' + chr(1132 - 1080) + chr(0b110101 + 0o0), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10001 + 0o40) + '\x37' + chr(636 - 587), 0o10), ehT0Px3KOsy9(chr(2182 - 2134) + chr(0b111011 + 0o64) + '\063' + chr(0b110 + 0o53) + chr(0b11000 + 0o33), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(53) + chr(51), 42478 - 42470), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + '\060', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(1137 - 1088) + '\x36' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(0b11001 + 0o27) + chr(0b110101), 55584 - 55576), ehT0Px3KOsy9(chr(288 - 240) + chr(0b1000010 + 0o55) + '\067' + chr(1366 - 1313), 0b1000), ehT0Px3KOsy9(chr(1988 - 1940) + chr(111) + chr(0b1111 + 0o44) + chr(53) + '\x31', 0o10), ehT0Px3KOsy9(chr(797 - 749) + chr(0b1101111) + '\061' + '\061' + chr(54), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + chr(0b100110 + 0o20) + chr(0b1011 + 0o50), 666 - 658), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + chr(0b110010) + chr(1027 - 973) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(903 - 855) + '\x6f' + '\063' + chr(0b110110) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7319 - 7208) + chr(51) + '\060' + chr(53), 10162 - 10154), ehT0Px3KOsy9(chr(1360 - 1312) + chr(0b1011100 + 0o23) + '\063' + '\066' + '\065', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1000100 + 0o53) + chr(1802 - 1752) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(53), 27767 - 27759), ehT0Px3KOsy9(chr(622 - 574) + chr(0b1101010 + 0o5) + '\x33' + '\x32' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(559 - 506) + chr(1091 - 1036), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(1525 - 1474) + '\x33' + chr(48), 60352 - 60344), ehT0Px3KOsy9(chr(729 - 681) + chr(0b1101111) + chr(2162 - 2111) + chr(0b101101 + 0o12) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(153 - 103), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b11111 + 0o120) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + chr(55) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(3057 - 2946) + chr(0b110011) + chr(0b110101) + chr(907 - 857), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(51) + '\062' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10011 + 0o36) + chr(0b110000 + 0o5) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\067' + chr(0b11110 + 0o31), ord("\x08")), ehT0Px3KOsy9(chr(696 - 648) + chr(0b1101111) + chr(51) + chr(0b110100) + chr(145 - 93), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(2058 - 2008) + '\x37' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(1029 - 981) + chr(0b111001 + 0o66) + '\061' + chr(670 - 621) + '\063', 57600 - 57592), ehT0Px3KOsy9('\060' + chr(111) + '\064', 18648 - 18640), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(49) + '\066', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1111 + 0o140) + chr(51) + chr(52) + chr(937 - 886), 4963 - 4955), ehT0Px3KOsy9('\060' + chr(4851 - 4740) + '\063' + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\067', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101110 + 0o7) + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'n'), '\144' + chr(101) + chr(0b1100011) + chr(111) + chr(6847 - 6747) + '\145')(chr(8037 - 7920) + chr(116) + chr(0b11111 + 0o107) + chr(0b11101 + 0o20) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def A5GIpkDsgP4U(): global Mm2kAncdxr3D, ls8wT40cYddD RQnkAwZWBQUF = O1cyTKfmz3Mw(idVendor=Xzvl11ouE36T, idProduct=nCPF_NoiqhIh) if not RQnkAwZWBQUF: raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x0ey\xef/\xe3,\xeb\x8fm\x05,^\x8cnU\xdf\x87\xab\x91'), chr(0b1100100 + 0o0) + chr(6649 - 6548) + '\143' + '\x6f' + chr(3257 - 3157) + chr(101))(chr(0b1011101 + 0o30) + chr(116) + chr(102) + chr(45) + chr(279 - 223))) if c2A0yzQpDQB3(RQnkAwZWBQUF) > ehT0Px3KOsy9('\x30' + chr(9360 - 9249) + chr(0b101010 + 0o7), ord("\x08")): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\rc\xa3\x1f\xcc\t\xa7\x8e(7\x03h\xc9*V\xc6\x9b\xa6\x90c%\xb4@\xad\x95~'), chr(0b1101 + 0o127) + '\x65' + chr(0b0 + 0o143) + '\x6f' + chr(0b1100100) + '\145')(chr(0b1110101) + chr(116) + '\146' + chr(45) + '\070')) Mm2kAncdxr3D = RQnkAwZWBQUF[ehT0Px3KOsy9(chr(820 - 772) + chr(7478 - 7367) + chr(48), 0o10)] xafqLlk3kkUe(Mm2kAncdxr3D, xafqLlk3kkUe(SXOLrMavuUCe(b'3s\xbb4\xc6\x16\xa5\x8da\x140O\x88:Z\xdf\x9c'), chr(0b1100100) + chr(0b1001000 + 0o35) + '\x63' + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(4258 - 4156) + chr(45) + chr(56)))() xafqLlk3kkUe(A4AviITEgQQ3.util, xafqLlk3kkUe(SXOLrMavuUCe(b'#z\xae\x02\xc8&\xa2\x85|\x167[\x88-V'), chr(0b101001 + 0o73) + chr(101) + '\x63' + chr(111) + '\144' + '\145')('\165' + chr(7492 - 7376) + '\146' + chr(0b100101 + 0o10) + chr(0b101 + 0o63)))(Mm2kAncdxr3D, akohJYGoF6UA) ls8wT40cYddD = None for VUGOL5I886yF in xafqLlk3kkUe(Mm2kAncdxr3D, xafqLlk3kkUe(SXOLrMavuUCe(b'#y\xa1\r\xcc\x1e\xbe\x99i\x07,R\x87='), '\x64' + chr(101) + '\x63' + '\x6f' + '\144' + chr(0b1100101))(chr(0b110101 + 0o100) + '\164' + '\146' + chr(45) + chr(0b111000)))(): ls8wT40cYddD = MxlBFcYyJUvi(VUGOL5I886yF.extra_descriptors) if ls8wT40cYddD: break for EXuNZ6EipE9U in xafqLlk3kkUe(VUGOL5I886yF, xafqLlk3kkUe(SXOLrMavuUCe(b')x\xbb\x0e\xd7\x1f\xaa\x88m\x00'), '\x64' + chr(8355 - 8254) + chr(0b1100011) + '\x6f' + chr(100) + '\145')('\165' + '\164' + '\x66' + chr(1091 - 1046) + chr(0b111000)))(): ls8wT40cYddD = MxlBFcYyJUvi(EXuNZ6EipE9U.extra_descriptors) if ls8wT40cYddD: break for PeScJ2MT3CKR in vQr8gNKaIaWE(ehT0Px3KOsy9(chr(48) + '\x6f' + '\x34', 8)): vBsMWH4gAEfy = GtKMCQOcANNz() if vBsMWH4gAEfy == HRbbva6y27z5: break elif vBsMWH4gAEfy == VEz3t37IgxlQ or vBsMWH4gAEfy == V_NC7oMOJuAm: ULC0fdxi7Mcr() else: kkgkyEtrFfFW()
micropython/micropython
tools/pydfu.py
page_erase
def page_erase(addr): """Erases a single page.""" if __verbose: print("Erasing page: 0x%x..." % (addr)) # Send DNLOAD with first byte=0x41 and page address buf = struct.pack("<BI", 0x41, addr) __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 0, __DFU_INTERFACE, buf, __TIMEOUT) # Execute last command if get_status() != __DFU_STATE_DFU_DOWNLOAD_BUSY: raise Exception("DFU: erase failed") # Check command state if get_status() != __DFU_STATE_DFU_DOWNLOAD_IDLE: raise Exception("DFU: erase failed")
python
def page_erase(addr): """Erases a single page.""" if __verbose: print("Erasing page: 0x%x..." % (addr)) # Send DNLOAD with first byte=0x41 and page address buf = struct.pack("<BI", 0x41, addr) __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 0, __DFU_INTERFACE, buf, __TIMEOUT) # Execute last command if get_status() != __DFU_STATE_DFU_DOWNLOAD_BUSY: raise Exception("DFU: erase failed") # Check command state if get_status() != __DFU_STATE_DFU_DOWNLOAD_IDLE: raise Exception("DFU: erase failed")
[ "def", "page_erase", "(", "addr", ")", ":", "if", "__verbose", ":", "print", "(", "\"Erasing page: 0x%x...\"", "%", "(", "addr", ")", ")", "# Send DNLOAD with first byte=0x41 and page address", "buf", "=", "struct", ".", "pack", "(", "\"<BI\"", ",", "0x41", ",", "addr", ")", "__dev", ".", "ctrl_transfer", "(", "0x21", ",", "__DFU_DNLOAD", ",", "0", ",", "__DFU_INTERFACE", ",", "buf", ",", "__TIMEOUT", ")", "# Execute last command", "if", "get_status", "(", ")", "!=", "__DFU_STATE_DFU_DOWNLOAD_BUSY", ":", "raise", "Exception", "(", "\"DFU: erase failed\"", ")", "# Check command state", "if", "get_status", "(", ")", "!=", "__DFU_STATE_DFU_DOWNLOAD_IDLE", ":", "raise", "Exception", "(", "\"DFU: erase failed\"", ")" ]
Erases a single page.
[ "Erases", "a", "single", "page", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L163-L179
train
Erases a single page.
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,eh4B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EeM4cxI,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) + '\062' + chr(52) + '\x34', 27315 - 27307), ehT0Px3KOsy9('\x30' + chr(2191 - 2080) + chr(0b11000 + 0o33) + '\x36' + chr(218 - 163), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(53) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + '\063' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(1381 - 1333) + '\x6f' + '\064' + chr(0b11100 + 0o33), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(0b0 + 0o60) + '\x32', 0b1000), ehT0Px3KOsy9(chr(2024 - 1976) + chr(0b11100 + 0o123) + '\067' + chr(0b11 + 0o60), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(1522 - 1470) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(0b100000 + 0o117) + chr(0b101001 + 0o10) + chr(0b110101) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x36' + chr(50), 0o10), ehT0Px3KOsy9(chr(498 - 450) + '\x6f' + chr(0b1010 + 0o47) + chr(961 - 910) + chr(1513 - 1462), 23411 - 23403), ehT0Px3KOsy9('\x30' + chr(111) + chr(1623 - 1574) + chr(0b110111), 7505 - 7497), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + '\x32' + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b100110 + 0o111) + chr(0b110011) + chr(48) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1101111) + '\x32' + '\061' + chr(0b100111 + 0o13), 29836 - 29828), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1399 - 1345) + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + '\x33' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(0b110100) + chr(0b110111), 38077 - 38069), ehT0Px3KOsy9(chr(1046 - 998) + chr(111) + chr(50) + chr(0b100101 + 0o22) + '\x33', 38705 - 38697), ehT0Px3KOsy9('\060' + chr(0b10101 + 0o132) + '\061' + chr(0b110010 + 0o0) + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + chr(11513 - 11402) + chr(1897 - 1848) + '\062' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(476 - 428) + chr(111) + chr(0b11101 + 0o26) + chr(0b100010 + 0o20) + chr(0b1101 + 0o52), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + '\x37' + chr(632 - 583), 28637 - 28629), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(55) + chr(0b10011 + 0o42), 53446 - 53438), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(1868 - 1817) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + '\x32' + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11 + 0o57) + chr(55), 47083 - 47075), ehT0Px3KOsy9('\060' + chr(723 - 612) + '\x33' + '\x32' + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(1671 - 1620) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110101), 41035 - 41027), ehT0Px3KOsy9(chr(802 - 754) + chr(0b1101111) + chr(49) + chr(0b11000 + 0o36) + '\062', 30667 - 30659), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\065' + chr(236 - 186), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b111110 + 0o61) + '\x32' + chr(1214 - 1166) + '\x33', 13477 - 13469), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(666 - 617) + chr(0b110001) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + '\x37' + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + chr(0b1010011 + 0o34) + chr(50) + chr(0b1000 + 0o51) + chr(786 - 735), 0o10), ehT0Px3KOsy9('\x30' + chr(12305 - 12194) + chr(0b110100) + chr(0b1000 + 0o53), 29549 - 29541), ehT0Px3KOsy9(chr(48) + chr(0b1101110 + 0o1) + chr(0b110001) + chr(49) + chr(1919 - 1871), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000110 + 0o51) + chr(50) + chr(0b110010) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(2212 - 2164) + chr(111) + chr(0b10001 + 0o43) + '\x35', 33187 - 33179)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(1280 - 1169) + '\x35' + chr(1212 - 1164), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a'), chr(0b1111 + 0o125) + chr(8593 - 8492) + chr(1953 - 1854) + '\x6f' + chr(835 - 735) + chr(0b111111 + 0o46))(chr(2754 - 2637) + chr(0b1110100) + chr(0b1000111 + 0o37) + chr(0b101101) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def wisjLmzBvbFb(DvZ9Fd2JTlN3): if zGatWNvpSxwT: zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1\x85\xc8\xebN\xec\\\xc6\x1bS<j\xea\xe0\xbaIx\x9f\x95}{'), chr(100) + '\145' + chr(99) + '\157' + chr(0b1100100 + 0o0) + chr(101))(chr(0b1110101) + '\164' + '\x66' + chr(0b100 + 0o51) + chr(0b101100 + 0o14)) % DvZ9Fd2JTlN3) b3K7dbpII422 = NBzIH1FKot5b.pack(xafqLlk3kkUe(SXOLrMavuUCe(b'\x98\xb5\xe0'), chr(0b1100100) + chr(1566 - 1465) + '\x63' + chr(111) + '\x64' + chr(101))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b101101) + chr(56)), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + '\060' + chr(49), 0o10), DvZ9Fd2JTlN3) xafqLlk3kkUe(Mm2kAncdxr3D, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc7\x83\xdb\xf4x\xf6I\x87\x05A=j\xa2'), '\144' + '\145' + chr(334 - 235) + chr(0b1101111) + chr(7891 - 7791) + chr(101))(chr(0b1110101) + chr(116) + chr(5859 - 5757) + chr(0b101101) + chr(1847 - 1791)))(ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110100) + chr(1289 - 1240), ord("\x08")), LiFqvA_AP6__, ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110000), 0o10), akohJYGoF6UA, b3K7dbpII422, MePIpVy5GbgO) if GtKMCQOcANNz() != cZ0qxSV5Nf1y: raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0\xb1\xfc\xa2\x07\xe7I\x87\x18W{i\xb1\xa9\xe6T9'), chr(100) + '\145' + chr(5215 - 5116) + chr(9812 - 9701) + '\144' + '\x65')(chr(0b1110101) + chr(116) + chr(102) + '\x2d' + chr(0b111000))) if GtKMCQOcANNz() != VEz3t37IgxlQ: raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0\xb1\xfc\xa2\x07\xe7I\x87\x18W{i\xb1\xa9\xe6T9'), chr(0b1100100) + '\x65' + chr(99) + chr(0b1011000 + 0o27) + chr(3049 - 2949) + chr(0b1100101))(chr(0b1110101) + chr(0b1010110 + 0o36) + '\146' + chr(0b101101) + chr(0b111000)))
micropython/micropython
tools/pydfu.py
set_address
def set_address(addr): """Sets the address for the next operation.""" # Send DNLOAD with first byte=0x21 and page address buf = struct.pack("<BI", 0x21, addr) __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 0, __DFU_INTERFACE, buf, __TIMEOUT) # Execute last command if get_status() != __DFU_STATE_DFU_DOWNLOAD_BUSY: raise Exception("DFU: set address failed") # Check command state if get_status() != __DFU_STATE_DFU_DOWNLOAD_IDLE: raise Exception("DFU: set address failed")
python
def set_address(addr): """Sets the address for the next operation.""" # Send DNLOAD with first byte=0x21 and page address buf = struct.pack("<BI", 0x21, addr) __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 0, __DFU_INTERFACE, buf, __TIMEOUT) # Execute last command if get_status() != __DFU_STATE_DFU_DOWNLOAD_BUSY: raise Exception("DFU: set address failed") # Check command state if get_status() != __DFU_STATE_DFU_DOWNLOAD_IDLE: raise Exception("DFU: set address failed")
[ "def", "set_address", "(", "addr", ")", ":", "# Send DNLOAD with first byte=0x21 and page address", "buf", "=", "struct", ".", "pack", "(", "\"<BI\"", ",", "0x21", ",", "addr", ")", "__dev", ".", "ctrl_transfer", "(", "0x21", ",", "__DFU_DNLOAD", ",", "0", ",", "__DFU_INTERFACE", ",", "buf", ",", "__TIMEOUT", ")", "# Execute last command", "if", "get_status", "(", ")", "!=", "__DFU_STATE_DFU_DOWNLOAD_BUSY", ":", "raise", "Exception", "(", "\"DFU: set address failed\"", ")", "# Check command state", "if", "get_status", "(", ")", "!=", "__DFU_STATE_DFU_DOWNLOAD_IDLE", ":", "raise", "Exception", "(", "\"DFU: set address failed\"", ")" ]
Sets the address for the next operation.
[ "Sets", "the", "address", "for", "the", "next", "operation", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L182-L194
train
Sets the address for the next operation.
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,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yeWBmUpv,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 + 0o0) + chr(111) + chr(0b110011) + chr(0b110100) + chr(51), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1326 - 1276) + chr(0b110111) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10010 + 0o37) + '\060' + '\x32', 17567 - 17559), ehT0Px3KOsy9(chr(337 - 289) + '\157' + chr(0b10110 + 0o33) + chr(0b110100) + chr(0b111 + 0o52), 2812 - 2804), ehT0Px3KOsy9('\060' + chr(5675 - 5564) + chr(54) + chr(0b10110 + 0o40), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x36' + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(1016 - 968) + chr(0b10011 + 0o134) + chr(51) + chr(0b1 + 0o62) + chr(0b1001 + 0o51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(715 - 660), 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(111) + chr(948 - 899) + chr(0b11100 + 0o24) + '\063', 0b1000), ehT0Px3KOsy9(chr(2286 - 2238) + chr(0b100001 + 0o116) + chr(50) + '\x32' + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + chr(11047 - 10936) + '\x33' + chr(55) + chr(50), 24032 - 24024), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1507 - 1456) + chr(0b10111 + 0o34) + chr(0b110010), 8), ehT0Px3KOsy9(chr(1398 - 1350) + '\157' + '\062' + chr(53) + '\x36', 48782 - 48774), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2188 - 2138), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100111 + 0o13) + '\x34' + '\067', 0o10), ehT0Px3KOsy9(chr(453 - 405) + chr(0b1101101 + 0o2) + chr(50) + '\x37' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + chr(50) + chr(0b11001 + 0o32) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(53) + chr(583 - 530), 0o10), ehT0Px3KOsy9('\x30' + chr(9597 - 9486) + chr(2133 - 2083) + chr(52) + chr(0b110110), 49085 - 49077), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(0b110011) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110111) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(111) + chr(0b110001) + chr(0b110110) + '\x33', 6120 - 6112), ehT0Px3KOsy9(chr(48) + chr(4824 - 4713) + chr(0b10010 + 0o41) + chr(0b10110 + 0o36) + chr(1472 - 1418), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(876 - 824) + chr(2099 - 2046), ord("\x08")), ehT0Px3KOsy9(chr(1035 - 987) + chr(0b1000101 + 0o52) + '\x31' + chr(52) + chr(0b1000 + 0o53), 0o10), ehT0Px3KOsy9('\x30' + chr(3037 - 2926) + '\061' + chr(48) + chr(48), 1309 - 1301), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + '\067' + '\067', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10110 + 0o131) + chr(50) + chr(0b11001 + 0o36) + chr(0b101110 + 0o4), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b110001) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(5289 - 5178) + chr(0b11 + 0o60) + '\066' + '\x35', 0o10), ehT0Px3KOsy9(chr(1781 - 1733) + chr(0b1101111) + chr(50) + chr(0b101010 + 0o11) + '\x34', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(2667 - 2613) + '\x34', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10100 + 0o35) + chr(0b110000) + chr(51), 8), ehT0Px3KOsy9(chr(48) + chr(11454 - 11343) + chr(1612 - 1562) + chr(0b110111) + chr(0b110100), 17545 - 17537), ehT0Px3KOsy9('\060' + chr(111) + chr(1339 - 1290) + '\x34' + '\061', 8), ehT0Px3KOsy9(chr(1151 - 1103) + chr(111) + chr(0b110010) + chr(0b110111), 8), ehT0Px3KOsy9('\060' + chr(6836 - 6725) + chr(0b101110 + 0o5) + '\x30' + '\065', 0o10), ehT0Px3KOsy9(chr(605 - 557) + chr(0b1101111) + chr(51) + chr(2788 - 2733) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(1591 - 1538) + '\066', 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b111000 + 0o67) + chr(0b110101) + '\063', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + chr(53) + chr(0b110000), 61303 - 61295)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd'), chr(4339 - 4239) + chr(101) + '\x63' + chr(6414 - 6303) + '\x64' + '\145')(chr(1151 - 1034) + '\164' + chr(102) + chr(240 - 195) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def x4TwuqEUS9bM(DvZ9Fd2JTlN3): b3K7dbpII422 = NBzIH1FKot5b.pack(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf\xf9\x0b'), chr(0b1100 + 0o130) + chr(4673 - 4572) + chr(0b1011010 + 0o11) + chr(111) + chr(100) + '\x65')(chr(11949 - 11832) + chr(0b111110 + 0o66) + chr(0b110011 + 0o63) + chr(0b0 + 0o55) + '\x38'), ehT0Px3KOsy9(chr(0b110000) + chr(10783 - 10672) + '\x34' + chr(0b110001), 0o10), DvZ9Fd2JTlN3) xafqLlk3kkUe(Mm2kAncdxr3D, xafqLlk3kkUe(SXOLrMavuUCe(b'\x80\xcf0\riG\xa8v-\xe4\x9c\xbf\xdc'), '\x64' + chr(101) + chr(0b1100011) + chr(111) + chr(100) + '\x65')(chr(117) + chr(116) + '\x66' + '\x2d' + '\x38'))(ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x34' + '\061', 8), LiFqvA_AP6__, ehT0Px3KOsy9('\x30' + '\157' + chr(1279 - 1231), 13924 - 13916), akohJYGoF6UA, b3K7dbpII422, MePIpVy5GbgO) if GtKMCQOcANNz() != cZ0qxSV5Nf1y: raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7\xfd\x17[\x16@\xbfcc\xf6\x9e\xbe\xdcg\xd4\xc9\xbbK\xc7\xb6P\x16\x82'), '\x64' + chr(2000 - 1899) + chr(99) + chr(1059 - 948) + '\144' + chr(877 - 776))(chr(0b11000 + 0o135) + chr(0b1110100) + '\146' + chr(45) + chr(1133 - 1077))) if GtKMCQOcANNz() != VEz3t37IgxlQ: raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7\xfd\x17[\x16@\xbfcc\xf6\x9e\xbe\xdcg\xd4\xc9\xbbK\xc7\xb6P\x16\x82'), chr(6366 - 6266) + chr(1755 - 1654) + chr(0b110010 + 0o61) + chr(8218 - 8107) + chr(8422 - 8322) + '\145')(chr(0b1110101) + chr(116) + chr(102) + chr(1915 - 1870) + '\x38'))
micropython/micropython
tools/pydfu.py
write_memory
def write_memory(addr, buf, progress=None, progress_addr=0, progress_size=0): """Writes a buffer into memory. This routine assumes that memory has already been erased. """ xfer_count = 0 xfer_bytes = 0 xfer_total = len(buf) xfer_base = addr while xfer_bytes < xfer_total: if __verbose and xfer_count % 512 == 0: print ("Addr 0x%x %dKBs/%dKBs..." % (xfer_base + xfer_bytes, xfer_bytes // 1024, xfer_total // 1024)) if progress and xfer_count % 2 == 0: progress(progress_addr, xfer_base + xfer_bytes - progress_addr, progress_size) # Set mem write address set_address(xfer_base+xfer_bytes) # Send DNLOAD with fw data chunk = min(__cfg_descr.wTransferSize, xfer_total-xfer_bytes) __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 2, __DFU_INTERFACE, buf[xfer_bytes:xfer_bytes + chunk], __TIMEOUT) # Execute last command if get_status() != __DFU_STATE_DFU_DOWNLOAD_BUSY: raise Exception("DFU: write memory failed") # Check command state if get_status() != __DFU_STATE_DFU_DOWNLOAD_IDLE: raise Exception("DFU: write memory failed") xfer_count += 1 xfer_bytes += chunk
python
def write_memory(addr, buf, progress=None, progress_addr=0, progress_size=0): """Writes a buffer into memory. This routine assumes that memory has already been erased. """ xfer_count = 0 xfer_bytes = 0 xfer_total = len(buf) xfer_base = addr while xfer_bytes < xfer_total: if __verbose and xfer_count % 512 == 0: print ("Addr 0x%x %dKBs/%dKBs..." % (xfer_base + xfer_bytes, xfer_bytes // 1024, xfer_total // 1024)) if progress and xfer_count % 2 == 0: progress(progress_addr, xfer_base + xfer_bytes - progress_addr, progress_size) # Set mem write address set_address(xfer_base+xfer_bytes) # Send DNLOAD with fw data chunk = min(__cfg_descr.wTransferSize, xfer_total-xfer_bytes) __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 2, __DFU_INTERFACE, buf[xfer_bytes:xfer_bytes + chunk], __TIMEOUT) # Execute last command if get_status() != __DFU_STATE_DFU_DOWNLOAD_BUSY: raise Exception("DFU: write memory failed") # Check command state if get_status() != __DFU_STATE_DFU_DOWNLOAD_IDLE: raise Exception("DFU: write memory failed") xfer_count += 1 xfer_bytes += chunk
[ "def", "write_memory", "(", "addr", ",", "buf", ",", "progress", "=", "None", ",", "progress_addr", "=", "0", ",", "progress_size", "=", "0", ")", ":", "xfer_count", "=", "0", "xfer_bytes", "=", "0", "xfer_total", "=", "len", "(", "buf", ")", "xfer_base", "=", "addr", "while", "xfer_bytes", "<", "xfer_total", ":", "if", "__verbose", "and", "xfer_count", "%", "512", "==", "0", ":", "print", "(", "\"Addr 0x%x %dKBs/%dKBs...\"", "%", "(", "xfer_base", "+", "xfer_bytes", ",", "xfer_bytes", "//", "1024", ",", "xfer_total", "//", "1024", ")", ")", "if", "progress", "and", "xfer_count", "%", "2", "==", "0", ":", "progress", "(", "progress_addr", ",", "xfer_base", "+", "xfer_bytes", "-", "progress_addr", ",", "progress_size", ")", "# Set mem write address", "set_address", "(", "xfer_base", "+", "xfer_bytes", ")", "# Send DNLOAD with fw data", "chunk", "=", "min", "(", "__cfg_descr", ".", "wTransferSize", ",", "xfer_total", "-", "xfer_bytes", ")", "__dev", ".", "ctrl_transfer", "(", "0x21", ",", "__DFU_DNLOAD", ",", "2", ",", "__DFU_INTERFACE", ",", "buf", "[", "xfer_bytes", ":", "xfer_bytes", "+", "chunk", "]", ",", "__TIMEOUT", ")", "# Execute last command", "if", "get_status", "(", ")", "!=", "__DFU_STATE_DFU_DOWNLOAD_BUSY", ":", "raise", "Exception", "(", "\"DFU: write memory failed\"", ")", "# Check command state", "if", "get_status", "(", ")", "!=", "__DFU_STATE_DFU_DOWNLOAD_IDLE", ":", "raise", "Exception", "(", "\"DFU: write memory failed\"", ")", "xfer_count", "+=", "1", "xfer_bytes", "+=", "chunk" ]
Writes a buffer into memory. This routine assumes that memory has already been erased.
[ "Writes", "a", "buffer", "into", "memory", ".", "This", "routine", "assumes", "that", "memory", "has", "already", "been", "erased", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L197-L233
train
Writes a buffer into memory.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadl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_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(0b1011000 + 0o27) + chr(1965 - 1914) + chr(0b100000 + 0o27) + chr(0b10111 + 0o34), 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + chr(0b1001 + 0o56) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + chr(0b101000 + 0o15) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + '\x32' + chr(1154 - 1102) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000101 + 0o52) + '\062' + chr(0b110111) + chr(0b101000 + 0o15), 0b1000), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + '\063' + chr(0b1001 + 0o55) + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x34' + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(0b100001 + 0o25), 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1101111) + chr(0b101101 + 0o6) + '\065' + chr(0b110100), 46823 - 46815), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + '\x32' + '\060', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2141 - 2087) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(1064 - 1016) + chr(111) + '\062' + chr(0b110000) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x35' + '\060', 44750 - 44742), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110110) + chr(0b110000 + 0o6), 8), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\157' + chr(49) + chr(2348 - 2297) + chr(1114 - 1065), 42153 - 42145), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(0b1001 + 0o55) + chr(0b100011 + 0o20), 0b1000), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(9869 - 9758) + '\065' + '\x30', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\067' + '\065', 45971 - 45963), ehT0Px3KOsy9(chr(1933 - 1885) + chr(1315 - 1204) + chr(0b110001) + chr(50), 31245 - 31237), ehT0Px3KOsy9(chr(350 - 302) + '\157' + chr(1828 - 1779) + '\063' + '\062', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(0b101100 + 0o5) + chr(1844 - 1796), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + '\064' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + '\x32' + '\061' + chr(714 - 660), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(48), 58461 - 58453), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + '\063' + '\x30', 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(111) + chr(0b110001) + chr(868 - 815) + '\067', 62087 - 62079), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(196 - 147) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(48) + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b111110 + 0o61) + chr(254 - 204) + chr(0b110001 + 0o2) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(9379 - 9268) + chr(0b110010) + '\067' + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(52) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(8795 - 8684) + chr(51) + '\067' + chr(0b110111), 64602 - 64594), ehT0Px3KOsy9('\060' + chr(0b110111 + 0o70) + chr(1309 - 1259) + '\063' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1101111) + '\062' + chr(0b100011 + 0o15) + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110111) + '\060', 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101111) + chr(50) + '\062' + chr(54), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b101111 + 0o7), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + '\065' + chr(0b110100), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2407 - 2357) + chr(1998 - 1943) + chr(0b110110), 25273 - 25265), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + '\x30' + '\064', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1011 - 963) + '\x6f' + '\065' + '\060', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5'), '\144' + '\145' + chr(0b100011 + 0o100) + chr(5055 - 4944) + chr(0b0 + 0o144) + '\145')(chr(3633 - 3516) + chr(0b1110100) + chr(0b10110 + 0o120) + chr(45) + chr(937 - 881)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def MaVbBeV6ZLa8(DvZ9Fd2JTlN3, b3K7dbpII422, Vvaid42SSlzd=None, wYiOQrf95yYW=ehT0Px3KOsy9('\x30' + '\157' + '\060', ord("\x08")), tCIWb8MVXV00=ehT0Px3KOsy9(chr(0b110000) + chr(8557 - 8446) + chr(1618 - 1570), 8)): LapAtr5gu1ss = ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b111111 + 0o60) + chr(0b110000), 8) ohi5Zo9i5hul = ehT0Px3KOsy9('\060' + chr(5689 - 5578) + '\060', 8) l7RMS5M8Ana2 = c2A0yzQpDQB3(b3K7dbpII422) xw_qICnPzU7h = DvZ9Fd2JTlN3 while ohi5Zo9i5hul < l7RMS5M8Ana2: if zGatWNvpSxwT and LapAtr5gu1ss % ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + chr(2025 - 1976) + '\060' + '\x30' + '\x30', 40769 - 40761) == ehT0Px3KOsy9(chr(851 - 803) + '\x6f' + chr(48), 8): zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\xba_I\xd1\x9d\xc4\\3\x94\xb0\x13\xe0ct*\\\r\x99A\x18\xbbL\xa0&'), chr(0b1100100) + '\x65' + '\143' + chr(111) + chr(100) + chr(0b111 + 0o136))(chr(0b1110101) + chr(11833 - 11717) + chr(0b1100110) + chr(1925 - 1880) + chr(0b111000)) % (xw_qICnPzU7h + ohi5Zo9i5hul, ohi5Zo9i5hul // ehT0Px3KOsy9('\x30' + chr(111) + '\062' + '\x30' + '\060' + chr(1483 - 1435), 0o10), l7RMS5M8Ana2 // ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + '\x30' + chr(48) + chr(48), 8))) if Vvaid42SSlzd and LapAtr5gu1ss % ehT0Px3KOsy9(chr(0b110000) + chr(10592 - 10481) + '\x32', 23810 - 23802) == ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101101 + 0o3), 8): Vvaid42SSlzd(wYiOQrf95yYW, xw_qICnPzU7h + ohi5Zo9i5hul - wYiOQrf95yYW, tCIWb8MVXV00) x4TwuqEUS9bM(xw_qICnPzU7h + ohi5Zo9i5hul) qrKMvKviNzHg = Dx22bkKPdt5d(ls8wT40cYddD.wTransferSize, l7RMS5M8Ana2 - ohi5Zo9i5hul) xafqLlk3kkUe(Mm2kAncdxr3D, xafqLlk3kkUe(SXOLrMavuUCe(b'\x98O_\xcf\xe2\x80Vw\x82\xe3P\xe1Z'), '\144' + chr(0b1000100 + 0o41) + chr(1109 - 1010) + '\x6f' + chr(8119 - 8019) + chr(0b1000111 + 0o36))('\x75' + '\164' + chr(102) + chr(0b101101) + chr(2026 - 1970)))(ehT0Px3KOsy9('\060' + chr(111) + chr(52) + '\061', ord("\x08")), LiFqvA_AP6__, ehT0Px3KOsy9(chr(48) + chr(0b1101110 + 0o1) + chr(0b110010), 8), akohJYGoF6UA, b3K7dbpII422[ohi5Zo9i5hul:ohi5Zo9i5hul + qrKMvKviNzHg], MePIpVy5GbgO) if GtKMCQOcANNz() != cZ0qxSV5Nf1y: raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbf}x\x99\x9d\x83V\x7f\x98\xf5\x16\xe9M[6\x01Q\xddl;\xa1\x0e\xebl'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(9710 - 9599) + chr(100) + chr(0b1100101))(chr(13132 - 13015) + chr(6366 - 6250) + chr(102) + chr(0b101101) + chr(56))) if GtKMCQOcANNz() != VEz3t37IgxlQ: raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbf}x\x99\x9d\x83V\x7f\x98\xf5\x16\xe9M[6\x01Q\xddl;\xa1\x0e\xebl'), chr(3112 - 3012) + chr(101) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(2449 - 2348))(chr(3163 - 3046) + chr(0b1000000 + 0o64) + chr(0b1101 + 0o131) + '\055' + chr(2262 - 2206))) LapAtr5gu1ss += ehT0Px3KOsy9(chr(134 - 86) + chr(0b1101111) + chr(1474 - 1425), 0o10) ohi5Zo9i5hul += qrKMvKviNzHg
micropython/micropython
tools/pydfu.py
write_page
def write_page(buf, xfer_offset): """Writes a single page. This routine assumes that memory has already been erased. """ xfer_base = 0x08000000 # Set mem write address set_address(xfer_base+xfer_offset) # Send DNLOAD with fw data __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 2, __DFU_INTERFACE, buf, __TIMEOUT) # Execute last command if get_status() != __DFU_STATE_DFU_DOWNLOAD_BUSY: raise Exception("DFU: write memory failed") # Check command state if get_status() != __DFU_STATE_DFU_DOWNLOAD_IDLE: raise Exception("DFU: write memory failed") if __verbose: print ("Write: 0x%x " % (xfer_base + xfer_offset))
python
def write_page(buf, xfer_offset): """Writes a single page. This routine assumes that memory has already been erased. """ xfer_base = 0x08000000 # Set mem write address set_address(xfer_base+xfer_offset) # Send DNLOAD with fw data __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 2, __DFU_INTERFACE, buf, __TIMEOUT) # Execute last command if get_status() != __DFU_STATE_DFU_DOWNLOAD_BUSY: raise Exception("DFU: write memory failed") # Check command state if get_status() != __DFU_STATE_DFU_DOWNLOAD_IDLE: raise Exception("DFU: write memory failed") if __verbose: print ("Write: 0x%x " % (xfer_base + xfer_offset))
[ "def", "write_page", "(", "buf", ",", "xfer_offset", ")", ":", "xfer_base", "=", "0x08000000", "# Set mem write address", "set_address", "(", "xfer_base", "+", "xfer_offset", ")", "# Send DNLOAD with fw data", "__dev", ".", "ctrl_transfer", "(", "0x21", ",", "__DFU_DNLOAD", ",", "2", ",", "__DFU_INTERFACE", ",", "buf", ",", "__TIMEOUT", ")", "# Execute last command", "if", "get_status", "(", ")", "!=", "__DFU_STATE_DFU_DOWNLOAD_BUSY", ":", "raise", "Exception", "(", "\"DFU: write memory failed\"", ")", "# Check command state", "if", "get_status", "(", ")", "!=", "__DFU_STATE_DFU_DOWNLOAD_IDLE", ":", "raise", "Exception", "(", "\"DFU: write memory failed\"", ")", "if", "__verbose", ":", "print", "(", "\"Write: 0x%x \"", "%", "(", "xfer_base", "+", "xfer_offset", ")", ")" ]
Writes a single page. This routine assumes that memory has already been erased.
[ "Writes", "a", "single", "page", ".", "This", "routine", "assumes", "that", "memory", "has", "already", "been", "erased", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L236-L258
train
Writes a single page from the memory.
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,QWgp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lSM16l2KDPD,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) + '\062' + '\x33' + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + '\x32' + chr(1692 - 1638), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(0b10 + 0o63), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(111) + chr(808 - 759) + chr(0b0 + 0o66) + chr(2183 - 2135), 21106 - 21098), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\157' + chr(509 - 460) + '\x37' + chr(0b110000 + 0o4), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(2276 - 2226) + chr(211 - 159), 29661 - 29653), ehT0Px3KOsy9(chr(0b110000) + chr(0b101000 + 0o107) + '\061' + chr(0b110000) + chr(0b100110 + 0o15), 0b1000), ehT0Px3KOsy9('\060' + chr(8507 - 8396) + chr(51) + chr(52) + chr(0b100000 + 0o24), 46602 - 46594), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110110) + chr(82 - 29), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + '\x31' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + '\x32' + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(1852 - 1803) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\157' + chr(616 - 566) + chr(2043 - 1988) + chr(750 - 702), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(6169 - 6058) + chr(256 - 206) + chr(361 - 306) + chr(51), 2255 - 2247), ehT0Px3KOsy9('\x30' + chr(7548 - 7437) + chr(0b110010) + chr(1262 - 1212) + chr(0b110011), 60451 - 60443), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1100000 + 0o17) + chr(2230 - 2180) + '\065' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(261 - 213) + chr(0b1101111) + chr(51) + '\x30' + chr(0b110 + 0o61), 0b1000), ehT0Px3KOsy9('\060' + chr(7799 - 7688) + chr(51) + chr(0b110100 + 0o1) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b111010 + 0o65) + chr(0b1111 + 0o43) + chr(0b100 + 0o60) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + '\063' + chr(0b110101) + chr(56 - 4), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(0b110100) + chr(0b110001), 8), ehT0Px3KOsy9('\060' + '\157' + chr(517 - 463) + chr(49), 11357 - 11349), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(0b11111 + 0o24) + chr(0b101 + 0o55), 29534 - 29526), ehT0Px3KOsy9(chr(1953 - 1905) + chr(0b1101111) + chr(0b110011) + '\062' + '\x35', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\066' + chr(53), 8), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(10750 - 10639) + '\066' + '\x34', 0o10), ehT0Px3KOsy9(chr(511 - 463) + chr(111) + '\062' + chr(52) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101011 + 0o14) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(1947 - 1899) + chr(111) + chr(1167 - 1117) + chr(49) + chr(0b0 + 0o63), 46895 - 46887), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + chr(1101 - 1051) + '\060', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b110010) + chr(0b110100 + 0o3), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4836 - 4725) + '\x31' + chr(0b110000) + chr(55), 17430 - 17422), ehT0Px3KOsy9(chr(1522 - 1474) + chr(0b10110 + 0o131) + chr(954 - 903) + '\061', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(0b10101 + 0o40) + chr(0b110110), 7959 - 7951), ehT0Px3KOsy9(chr(0b110000) + chr(7082 - 6971) + chr(1923 - 1873) + chr(0b110101) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\067' + chr(0b110111), 4832 - 4824), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001101 + 0o42) + chr(1255 - 1206) + '\x31' + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1100011 + 0o14) + chr(2154 - 2101) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7'), chr(6258 - 6158) + chr(0b10001 + 0o124) + '\x63' + '\x6f' + chr(0b1100100) + chr(7233 - 7132))('\x75' + chr(116) + '\x66' + chr(0b101101) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def M7s0hKEHdzcf(b3K7dbpII422, rOysn8BTGQDw): xw_qICnPzU7h = ehT0Px3KOsy9('\x30' + chr(8469 - 8358) + chr(0b110001) + chr(48) + '\x30' + chr(0b110000) + chr(48) + chr(397 - 349) + chr(48) + chr(48) + chr(1318 - 1270) + chr(48), 10327 - 10319) x4TwuqEUS9bM(xw_qICnPzU7h + rOysn8BTGQDw) xafqLlk3kkUe(Mm2kAncdxr3D, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfawr\xfaJ\x04\x0e5-\x97S\xaa"'), chr(7977 - 7877) + chr(101) + chr(99) + chr(111) + '\144' + chr(0b100010 + 0o103))(chr(0b10100 + 0o141) + '\x74' + '\146' + '\x2d' + chr(56)))(ehT0Px3KOsy9('\x30' + '\x6f' + '\064' + chr(0b11110 + 0o23), ord("\x08")), LiFqvA_AP6__, ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50), 0o10), akohJYGoF6UA, b3K7dbpII422, MePIpVy5GbgO) if GtKMCQOcANNz() != cZ0qxSV5Nf1y: raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xddEU\xac5\x07\x0e=7\x81\x15\xa25c\xd7\xc9\xea\x89\xa1\x8c\xc8\x80\xc4U'), '\x64' + '\145' + chr(0b100101 + 0o76) + '\x6f' + chr(3763 - 3663) + '\145')('\x75' + '\164' + '\x66' + chr(311 - 266) + '\070')) if GtKMCQOcANNz() != VEz3t37IgxlQ: raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xddEU\xac5\x07\x0e=7\x81\x15\xa25c\xd7\xc9\xea\x89\xa1\x8c\xc8\x80\xc4U'), '\x64' + '\145' + chr(99) + chr(0b1101111) + chr(0b101110 + 0o66) + '\145')('\x75' + chr(10788 - 10672) + '\x66' + chr(1633 - 1588) + '\x38')) if zGatWNvpSxwT: zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\xceqi\xe2pJ\\d;\xc1M\xef'), chr(0b1100100) + chr(5008 - 4907) + '\x63' + chr(8519 - 8408) + chr(4326 - 4226) + '\x65')('\165' + '\164' + '\146' + '\x2d' + chr(56)) % (xw_qICnPzU7h + rOysn8BTGQDw))
micropython/micropython
tools/pydfu.py
exit_dfu
def exit_dfu(): """Exit DFU mode, and start running the program.""" # set jump address set_address(0x08000000) # Send DNLOAD with 0 length to exit DFU __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 0, __DFU_INTERFACE, None, __TIMEOUT) try: # Execute last command if get_status() != __DFU_STATE_DFU_MANIFEST: print("Failed to reset device") # Release device usb.util.dispose_resources(__dev) except: pass
python
def exit_dfu(): """Exit DFU mode, and start running the program.""" # set jump address set_address(0x08000000) # Send DNLOAD with 0 length to exit DFU __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 0, __DFU_INTERFACE, None, __TIMEOUT) try: # Execute last command if get_status() != __DFU_STATE_DFU_MANIFEST: print("Failed to reset device") # Release device usb.util.dispose_resources(__dev) except: pass
[ "def", "exit_dfu", "(", ")", ":", "# set jump address", "set_address", "(", "0x08000000", ")", "# Send DNLOAD with 0 length to exit DFU", "__dev", ".", "ctrl_transfer", "(", "0x21", ",", "__DFU_DNLOAD", ",", "0", ",", "__DFU_INTERFACE", ",", "None", ",", "__TIMEOUT", ")", "try", ":", "# Execute last command", "if", "get_status", "(", ")", "!=", "__DFU_STATE_DFU_MANIFEST", ":", "print", "(", "\"Failed to reset device\"", ")", "# Release device", "usb", ".", "util", ".", "dispose_resources", "(", "__dev", ")", "except", ":", "pass" ]
Exit DFU mode, and start running the program.
[ "Exit", "DFU", "mode", "and", "start", "running", "the", "program", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L261-L279
train
Exit DFU mode and start running the program.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3VWp,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(0b10010 + 0o36) + chr(0b10101 + 0o132) + chr(0b110010) + chr(866 - 811) + chr(52 - 4), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(8610 - 8499) + '\x33' + chr(55) + chr(0b100 + 0o55), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\060' + chr(0b100110 + 0o20), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1335 - 1284) + chr(0b101110 + 0o4) + chr(2231 - 2183), 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + chr(55) + chr(0b110101), 61314 - 61306), ehT0Px3KOsy9('\060' + '\157' + chr(0b1010 + 0o50) + '\x37' + '\x35', 62683 - 62675), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2426 - 2374), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(1257 - 1207) + '\x32', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b10100 + 0o41) + chr(54 - 6), 0b1000), ehT0Px3KOsy9('\x30' + chr(9406 - 9295) + '\x31' + chr(1991 - 1942) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100011 + 0o16) + '\x31' + chr(0b110111), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1110 + 0o45) + chr(0b11101 + 0o26) + chr(2581 - 2530), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100 + 0o153) + chr(0b110011) + '\x30' + chr(0b101011 + 0o14), ord("\x08")), ehT0Px3KOsy9(chr(2264 - 2216) + chr(0b1101111) + '\x34' + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b11100 + 0o123) + chr(50) + chr(0b111 + 0o51) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + '\061', 46856 - 46848), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(0b110100) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + '\064' + '\066', 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + chr(1265 - 1216) + chr(0b11111 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2062 - 2011) + chr(0b110001) + '\063', 56417 - 56409), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(588 - 540) + chr(1302 - 1191) + chr(1825 - 1775) + chr(1037 - 988) + chr(2057 - 2006), ord("\x08")), ehT0Px3KOsy9(chr(1225 - 1177) + chr(4040 - 3929) + '\x31' + chr(2360 - 2308), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\064', 8), ehT0Px3KOsy9(chr(781 - 733) + '\x6f' + chr(0b110001) + chr(0b1110 + 0o47) + '\x37', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(49) + '\x34' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100110 + 0o14) + chr(1764 - 1712) + chr(2247 - 2199), 1363 - 1355), ehT0Px3KOsy9('\x30' + chr(0b11110 + 0o121) + '\061' + '\061' + chr(0b101111 + 0o2), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\065' + chr(0b100111 + 0o11), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(1338 - 1290) + chr(111) + '\x33' + '\066' + chr(0b1010 + 0o50), 8505 - 8497), ehT0Px3KOsy9('\060' + chr(5153 - 5042) + chr(0b11011 + 0o26) + '\065' + chr(55), 8), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1001 + 0o146) + chr(0b110111) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(1253 - 1205) + '\157' + chr(0b1010 + 0o52) + chr(55), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001100 + 0o43) + '\063' + chr(0b110001) + chr(2261 - 2213), 10785 - 10777), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(0b110011) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(0b100001 + 0o21) + '\063', 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1000011 + 0o54) + chr(1735 - 1685) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(2047 - 1999) + chr(0b1101111) + chr(0b101001 + 0o12) + chr(0b110010) + chr(50), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1409 - 1359) + '\060' + '\x30', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\157' + chr(0b110 + 0o57) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x96'), chr(0b1100100) + '\145' + '\143' + chr(0b1101111) + chr(0b11010 + 0o112) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(0b100110 + 0o7) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def KW1_Bh0y4Prn(): x4TwuqEUS9bM(ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + '\060' + chr(48) + '\060' + chr(48) + chr(529 - 481) + chr(0b0 + 0o60) + chr(0b100111 + 0o11) + chr(48) + '\060', 13016 - 13008)) xafqLlk3kkUe(Mm2kAncdxr3D, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\x8d4\xbcb\xc9v\xb3\xc6<)\xbe\xb5'), chr(5907 - 5807) + chr(101) + chr(99) + '\x6f' + chr(0b10100 + 0o120) + '\145')(chr(117) + '\164' + chr(0b1100110) + chr(45) + chr(313 - 257)))(ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\064' + chr(0b110000 + 0o1), ord("\x08")), LiFqvA_AP6__, ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + chr(0b111 + 0o51), 53458 - 53450), akohJYGoF6UA, None, MePIpVy5GbgO) try: if GtKMCQOcANNz() != xXg70nmgiW_T: zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfe\x98/\xbcX\xd9$\xa6\xc7o=\xbe\xb4B\xf71\x06\x03~\xa2e\xee'), chr(100) + chr(0b11 + 0o142) + chr(99) + '\x6f' + '\144' + chr(0b1001100 + 0o31))(chr(0b1110101) + chr(0b1110100) + '\x66' + '\055' + chr(56))) xafqLlk3kkUe(A4AviITEgQQ3.util, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc\x905\xa0R\xcea\x8d\xda*<\xb4\xb2U\xe0t\x11'), '\x64' + chr(0b100 + 0o141) + chr(3370 - 3271) + chr(111) + '\144' + chr(101))('\x75' + chr(116) + chr(8838 - 8736) + chr(0b101101) + '\x38'))(Mm2kAncdxr3D) except ZVWAAMjVVHHl: pass
micropython/micropython
tools/pydfu.py
consume
def consume(fmt, data, names): """Parses the struct defined by `fmt` from `data`, stores the parsed fields into a named tuple using `names`. Returns the named tuple, and the data with the struct stripped off.""" size = struct.calcsize(fmt) return named(struct.unpack(fmt, data[:size]), names), data[size:]
python
def consume(fmt, data, names): """Parses the struct defined by `fmt` from `data`, stores the parsed fields into a named tuple using `names`. Returns the named tuple, and the data with the struct stripped off.""" size = struct.calcsize(fmt) return named(struct.unpack(fmt, data[:size]), names), data[size:]
[ "def", "consume", "(", "fmt", ",", "data", ",", "names", ")", ":", "size", "=", "struct", ".", "calcsize", "(", "fmt", ")", "return", "named", "(", "struct", ".", "unpack", "(", "fmt", ",", "data", "[", ":", "size", "]", ")", ",", "names", ")", ",", "data", "[", "size", ":", "]" ]
Parses the struct defined by `fmt` from `data`, stores the parsed fields into a named tuple using `names`. Returns the named tuple, and the data with the struct stripped off.
[ "Parses", "the", "struct", "defined", "by", "fmt", "from", "data", "stores", "the", "parsed", "fields", "into", "a", "named", "tuple", "using", "names", ".", "Returns", "the", "named", "tuple", "and", "the", "data", "with", "the", "struct", "stripped", "off", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L287-L292
train
Parses the struct defined by fmt from data stores the parsed fields into a named tuple using names. Returns the named tuple and the data with the struct stripped off.
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,ygAzbDzr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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) + '\x32' + '\x32', 36307 - 36299), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1501 - 1452) + chr(48) + chr(50), 59345 - 59337), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(8285 - 8174) + chr(0b110010) + chr(49) + '\x35', 31945 - 31937), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(0b110101) + '\063', 14337 - 14329), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(4877 - 4766) + '\x32' + chr(0b110 + 0o53) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(865 - 814) + '\062' + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(578 - 528) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b100011 + 0o15) + '\061', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2002 - 1950) + chr(0b10110 + 0o37), 18100 - 18092), ehT0Px3KOsy9('\060' + chr(0b1010110 + 0o31) + chr(965 - 916) + chr(2171 - 2118) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b110110) + chr(51), 49936 - 49928), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1111 + 0o43) + chr(0b100 + 0o56) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(803 - 755) + chr(111) + '\061' + chr(54) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b110 + 0o151) + chr(2003 - 1954) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(1970 - 1922) + chr(0b111010 + 0o65) + '\061' + chr(276 - 223) + chr(430 - 381), 0o10), ehT0Px3KOsy9(chr(702 - 654) + chr(111) + chr(0b110011) + chr(0b110010) + '\x37', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010111 + 0o30) + chr(0b10111 + 0o32), 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\x6f' + '\x31' + chr(0b110010) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101101 + 0o2) + chr(0b110001) + '\062' + chr(0b110001), 55282 - 55274), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101111 + 0o2) + '\066' + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(10874 - 10763) + chr(53) + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b11110 + 0o30) + chr(647 - 599), 0b1000), ehT0Px3KOsy9('\x30' + chr(4372 - 4261) + chr(0b100010 + 0o21) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + '\x31' + chr(345 - 293), 5742 - 5734), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + '\x37' + chr(0b110100), 52522 - 52514), ehT0Px3KOsy9(chr(717 - 669) + chr(10807 - 10696) + '\x31' + chr(819 - 769) + chr(0b110000), 16529 - 16521), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1100000 + 0o17) + '\063' + '\063' + '\x35', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\062' + '\x36' + chr(0b11000 + 0o37), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(8198 - 8087) + chr(2669 - 2614) + '\x34', 0o10), ehT0Px3KOsy9(chr(1719 - 1671) + chr(0b1101111) + '\062' + chr(49) + '\065', 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100110 + 0o13) + '\x31' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + '\064' + chr(929 - 880), 0b1000), ehT0Px3KOsy9(chr(48) + chr(5056 - 4945) + chr(51) + chr(336 - 288) + chr(49), 48686 - 48678), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(0b110010) + chr(2556 - 2502), 7437 - 7429), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(0b11010 + 0o35) + chr(1275 - 1221), 2293 - 2285), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + '\x30' + chr(1624 - 1569), 0o10), ehT0Px3KOsy9(chr(1097 - 1049) + chr(0b10110 + 0o131) + chr(0b10110 + 0o33) + chr(371 - 322) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(0b11111 + 0o120) + chr(0b1011 + 0o46) + chr(54) + chr(0b101000 + 0o14), 0o10), ehT0Px3KOsy9(chr(183 - 135) + chr(111) + '\x32' + chr(0b100000 + 0o21) + chr(51), 29096 - 29088)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + '\x35' + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'<'), '\x64' + '\145' + chr(6932 - 6833) + chr(0b10111 + 0o130) + chr(0b10000 + 0o124) + chr(101))('\165' + chr(0b101001 + 0o113) + chr(0b11010 + 0o114) + chr(0b101101) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def PsNT5py9IN4N(EwDuvMM18jq4, ULnjp6D6efFH, OcnR1hZ7pGdr): NLcc3BCJnQka = NBzIH1FKot5b.calcsize(EwDuvMM18jq4) return (TZU92PRfn91_(xafqLlk3kkUe(NBzIH1FKot5b, xafqLlk3kkUe(SXOLrMavuUCe(b'g,\xfd\n\xea\xb9'), chr(9052 - 8952) + chr(2677 - 2576) + chr(2627 - 2528) + '\x6f' + chr(1837 - 1737) + chr(7132 - 7031))(chr(3517 - 3400) + chr(0b1110100) + '\x66' + chr(0b1001 + 0o44) + chr(0b1111 + 0o51)))(EwDuvMM18jq4, ULnjp6D6efFH[:NLcc3BCJnQka]), OcnR1hZ7pGdr), ULnjp6D6efFH[NLcc3BCJnQka:])
micropython/micropython
tools/pydfu.py
read_dfu_file
def read_dfu_file(filename): """Reads a DFU file, and parses the individual elements from the file. Returns an array of elements. Each element is a dictionary with the following keys: num - The element index address - The address that the element data should be written to. size - The size of the element ddata. data - The element data. If an error occurs while parsing the file, then None is returned. """ print("File: {}".format(filename)) with open(filename, 'rb') as fin: data = fin.read() crc = compute_crc(data[:-4]) elements = [] # Decode the DFU Prefix # # <5sBIB # < little endian # 5s char[5] signature "DfuSe" # B uint8_t version 1 # I uint32_t size Size of the DFU file (not including suffix) # B uint8_t targets Number of targets dfu_prefix, data = consume('<5sBIB', data, 'signature version size targets') print (" %(signature)s v%(version)d, image size: %(size)d, " "targets: %(targets)d" % dfu_prefix) for target_idx in range(dfu_prefix['targets']): # Decode the Image Prefix # # <6sBI255s2I # < little endian # 6s char[6] signature "Target" # B uint8_t altsetting # I uint32_t named bool indicating if a name was used # 255s char[255] name name of the target # I uint32_t size size of image (not incl prefix) # I uint32_t elements Number of elements in the image img_prefix, data = consume('<6sBI255s2I', data, 'signature altsetting named name ' 'size elements') img_prefix['num'] = target_idx if img_prefix['named']: img_prefix['name'] = cstring(img_prefix['name']) else: img_prefix['name'] = '' print(' %(signature)s %(num)d, alt setting: %(altsetting)s, ' 'name: "%(name)s", size: %(size)d, elements: %(elements)d' % img_prefix) target_size = img_prefix['size'] target_data, data = data[:target_size], data[target_size:] for elem_idx in range(img_prefix['elements']): # Decode target prefix # < little endian # I uint32_t element address # I uint32_t element size elem_prefix, target_data = consume('<2I', target_data, 'addr size') elem_prefix['num'] = elem_idx print(' %(num)d, address: 0x%(addr)08x, size: %(size)d' % elem_prefix) elem_size = elem_prefix['size'] elem_data = target_data[:elem_size] target_data = target_data[elem_size:] elem_prefix['data'] = elem_data elements.append(elem_prefix) if len(target_data): print("target %d PARSE ERROR" % target_idx) # Decode DFU Suffix # < little endian # H uint16_t device Firmware version # H uint16_t product # H uint16_t vendor # H uint16_t dfu 0x11a (DFU file format version) # 3s char[3] ufd 'UFD' # B uint8_t len 16 # I uint32_t crc32 dfu_suffix = named(struct.unpack('<4H3sBI', data[:16]), 'device product vendor dfu ufd len crc') print (' usb: %(vendor)04x:%(product)04x, device: 0x%(device)04x, ' 'dfu: 0x%(dfu)04x, %(ufd)s, %(len)d, 0x%(crc)08x' % dfu_suffix) if crc != dfu_suffix['crc']: print("CRC ERROR: computed crc32 is 0x%08x" % crc) return data = data[16:] if data: print("PARSE ERROR") return return elements
python
def read_dfu_file(filename): """Reads a DFU file, and parses the individual elements from the file. Returns an array of elements. Each element is a dictionary with the following keys: num - The element index address - The address that the element data should be written to. size - The size of the element ddata. data - The element data. If an error occurs while parsing the file, then None is returned. """ print("File: {}".format(filename)) with open(filename, 'rb') as fin: data = fin.read() crc = compute_crc(data[:-4]) elements = [] # Decode the DFU Prefix # # <5sBIB # < little endian # 5s char[5] signature "DfuSe" # B uint8_t version 1 # I uint32_t size Size of the DFU file (not including suffix) # B uint8_t targets Number of targets dfu_prefix, data = consume('<5sBIB', data, 'signature version size targets') print (" %(signature)s v%(version)d, image size: %(size)d, " "targets: %(targets)d" % dfu_prefix) for target_idx in range(dfu_prefix['targets']): # Decode the Image Prefix # # <6sBI255s2I # < little endian # 6s char[6] signature "Target" # B uint8_t altsetting # I uint32_t named bool indicating if a name was used # 255s char[255] name name of the target # I uint32_t size size of image (not incl prefix) # I uint32_t elements Number of elements in the image img_prefix, data = consume('<6sBI255s2I', data, 'signature altsetting named name ' 'size elements') img_prefix['num'] = target_idx if img_prefix['named']: img_prefix['name'] = cstring(img_prefix['name']) else: img_prefix['name'] = '' print(' %(signature)s %(num)d, alt setting: %(altsetting)s, ' 'name: "%(name)s", size: %(size)d, elements: %(elements)d' % img_prefix) target_size = img_prefix['size'] target_data, data = data[:target_size], data[target_size:] for elem_idx in range(img_prefix['elements']): # Decode target prefix # < little endian # I uint32_t element address # I uint32_t element size elem_prefix, target_data = consume('<2I', target_data, 'addr size') elem_prefix['num'] = elem_idx print(' %(num)d, address: 0x%(addr)08x, size: %(size)d' % elem_prefix) elem_size = elem_prefix['size'] elem_data = target_data[:elem_size] target_data = target_data[elem_size:] elem_prefix['data'] = elem_data elements.append(elem_prefix) if len(target_data): print("target %d PARSE ERROR" % target_idx) # Decode DFU Suffix # < little endian # H uint16_t device Firmware version # H uint16_t product # H uint16_t vendor # H uint16_t dfu 0x11a (DFU file format version) # 3s char[3] ufd 'UFD' # B uint8_t len 16 # I uint32_t crc32 dfu_suffix = named(struct.unpack('<4H3sBI', data[:16]), 'device product vendor dfu ufd len crc') print (' usb: %(vendor)04x:%(product)04x, device: 0x%(device)04x, ' 'dfu: 0x%(dfu)04x, %(ufd)s, %(len)d, 0x%(crc)08x' % dfu_suffix) if crc != dfu_suffix['crc']: print("CRC ERROR: computed crc32 is 0x%08x" % crc) return data = data[16:] if data: print("PARSE ERROR") return return elements
[ "def", "read_dfu_file", "(", "filename", ")", ":", "print", "(", "\"File: {}\"", ".", "format", "(", "filename", ")", ")", "with", "open", "(", "filename", ",", "'rb'", ")", "as", "fin", ":", "data", "=", "fin", ".", "read", "(", ")", "crc", "=", "compute_crc", "(", "data", "[", ":", "-", "4", "]", ")", "elements", "=", "[", "]", "# Decode the DFU Prefix", "#", "# <5sBIB", "# < little endian", "# 5s char[5] signature \"DfuSe\"", "# B uint8_t version 1", "# I uint32_t size Size of the DFU file (not including suffix)", "# B uint8_t targets Number of targets", "dfu_prefix", ",", "data", "=", "consume", "(", "'<5sBIB'", ",", "data", ",", "'signature version size targets'", ")", "print", "(", "\" %(signature)s v%(version)d, image size: %(size)d, \"", "\"targets: %(targets)d\"", "%", "dfu_prefix", ")", "for", "target_idx", "in", "range", "(", "dfu_prefix", "[", "'targets'", "]", ")", ":", "# Decode the Image Prefix", "#", "# <6sBI255s2I", "# < little endian", "# 6s char[6] signature \"Target\"", "# B uint8_t altsetting", "# I uint32_t named bool indicating if a name was used", "# 255s char[255] name name of the target", "# I uint32_t size size of image (not incl prefix)", "# I uint32_t elements Number of elements in the image", "img_prefix", ",", "data", "=", "consume", "(", "'<6sBI255s2I'", ",", "data", ",", "'signature altsetting named name '", "'size elements'", ")", "img_prefix", "[", "'num'", "]", "=", "target_idx", "if", "img_prefix", "[", "'named'", "]", ":", "img_prefix", "[", "'name'", "]", "=", "cstring", "(", "img_prefix", "[", "'name'", "]", ")", "else", ":", "img_prefix", "[", "'name'", "]", "=", "''", "print", "(", "' %(signature)s %(num)d, alt setting: %(altsetting)s, '", "'name: \"%(name)s\", size: %(size)d, elements: %(elements)d'", "%", "img_prefix", ")", "target_size", "=", "img_prefix", "[", "'size'", "]", "target_data", ",", "data", "=", "data", "[", ":", "target_size", "]", ",", "data", "[", "target_size", ":", "]", "for", "elem_idx", "in", "range", "(", "img_prefix", "[", "'elements'", "]", ")", ":", "# Decode target prefix", "# < little endian", "# I uint32_t element address", "# I uint32_t element size", "elem_prefix", ",", "target_data", "=", "consume", "(", "'<2I'", ",", "target_data", ",", "'addr size'", ")", "elem_prefix", "[", "'num'", "]", "=", "elem_idx", "print", "(", "' %(num)d, address: 0x%(addr)08x, size: %(size)d'", "%", "elem_prefix", ")", "elem_size", "=", "elem_prefix", "[", "'size'", "]", "elem_data", "=", "target_data", "[", ":", "elem_size", "]", "target_data", "=", "target_data", "[", "elem_size", ":", "]", "elem_prefix", "[", "'data'", "]", "=", "elem_data", "elements", ".", "append", "(", "elem_prefix", ")", "if", "len", "(", "target_data", ")", ":", "print", "(", "\"target %d PARSE ERROR\"", "%", "target_idx", ")", "# Decode DFU Suffix", "# < little endian", "# H uint16_t device Firmware version", "# H uint16_t product", "# H uint16_t vendor", "# H uint16_t dfu 0x11a (DFU file format version)", "# 3s char[3] ufd 'UFD'", "# B uint8_t len 16", "# I uint32_t crc32", "dfu_suffix", "=", "named", "(", "struct", ".", "unpack", "(", "'<4H3sBI'", ",", "data", "[", ":", "16", "]", ")", ",", "'device product vendor dfu ufd len crc'", ")", "print", "(", "' usb: %(vendor)04x:%(product)04x, device: 0x%(device)04x, '", "'dfu: 0x%(dfu)04x, %(ufd)s, %(len)d, 0x%(crc)08x'", "%", "dfu_suffix", ")", "if", "crc", "!=", "dfu_suffix", "[", "'crc'", "]", ":", "print", "(", "\"CRC ERROR: computed crc32 is 0x%08x\"", "%", "crc", ")", "return", "data", "=", "data", "[", "16", ":", "]", "if", "data", ":", "print", "(", "\"PARSE ERROR\"", ")", "return", "return", "elements" ]
Reads a DFU file, and parses the individual elements from the file. Returns an array of elements. Each element is a dictionary with the following keys: num - The element index address - The address that the element data should be written to. size - The size of the element ddata. data - The element data. If an error occurs while parsing the file, then None is returned.
[ "Reads", "a", "DFU", "file", "and", "parses", "the", "individual", "elements", "from", "the", "file", ".", "Returns", "an", "array", "of", "elements", ".", "Each", "element", "is", "a", "dictionary", "with", "the", "following", "keys", ":", "num", "-", "The", "element", "index", "address", "-", "The", "address", "that", "the", "element", "data", "should", "be", "written", "to", ".", "size", "-", "The", "size", "of", "the", "element", "ddata", ".", "data", "-", "The", "element", "data", ".", "If", "an", "error", "occurs", "while", "parsing", "the", "file", "then", "None", "is", "returned", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L305-L398
train
Reads a DFU file and parses the individual elements into a list of dictionaries.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9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P6_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('\060' + chr(111) + chr(49) + chr(49) + chr(54), 47393 - 47385), ehT0Px3KOsy9(chr(48) + chr(0b101 + 0o152) + chr(2234 - 2183) + '\061' + chr(55), 5298 - 5290), ehT0Px3KOsy9(chr(178 - 130) + chr(2479 - 2368) + chr(0b110001 + 0o0) + chr(49) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(11807 - 11696) + chr(49) + '\x35' + chr(0b110000), 0o10), ehT0Px3KOsy9('\x30' + chr(0b101010 + 0o105) + chr(2015 - 1964) + chr(475 - 425) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(6611 - 6500) + chr(49) + '\064' + '\x34', 17786 - 17778), ehT0Px3KOsy9(chr(2105 - 2057) + '\157' + '\062' + chr(0b110 + 0o56), ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\157' + chr(49) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b11100 + 0o123) + chr(0b100010 + 0o25) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(0b110100) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(53) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000010 + 0o55) + '\x33' + '\x32' + chr(0b10 + 0o57), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1001 + 0o52) + chr(0b110000) + '\x34', 0b1000), ehT0Px3KOsy9(chr(2011 - 1963) + chr(5828 - 5717) + '\063' + chr(0b111 + 0o52), 0o10), ehT0Px3KOsy9(chr(456 - 408) + chr(0b1101111) + chr(50) + chr(0b11001 + 0o32) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(55) + chr(0b1010 + 0o46), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b111111 + 0o60) + chr(1820 - 1769) + chr(54) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + '\062' + '\x33' + '\065', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(1435 - 1386) + chr(0b110100) + chr(0b110000 + 0o3), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010 + 0o0) + chr(0b11 + 0o61) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + chr(49) + chr(0b110110), 61193 - 61185), ehT0Px3KOsy9(chr(2006 - 1958) + chr(111) + chr(0b0 + 0o61) + chr(0b100 + 0o63) + chr(54), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1881 - 1832) + chr(0b110000) + chr(0b1110 + 0o46), 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + '\x33' + '\x37' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(52) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b110110) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(1695 - 1647) + chr(7852 - 7741) + '\062' + '\x32' + chr(0b1000 + 0o55), 18794 - 18786), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(5668 - 5557) + chr(853 - 804) + chr(0b10 + 0o65) + chr(321 - 268), 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b0 + 0o157) + chr(0b110001) + chr(54 - 6) + chr(0b110000), 10406 - 10398), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11001 + 0o32) + chr(0b110010) + '\x37', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\066' + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(80 - 29) + chr(0b110010), 3544 - 3536), ehT0Px3KOsy9(chr(0b110000) + chr(1123 - 1012) + '\062' + '\064' + chr(0b110010), 36213 - 36205), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b110001) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + '\x30' + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + chr(2880 - 2769) + '\x31' + '\x31' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1101111) + chr(0b10010 + 0o41) + chr(0b11011 + 0o27) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + chr(6713 - 6602) + chr(0b100010 + 0o21) + chr(51) + chr(691 - 639), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100100 + 0o13) + chr(50) + chr(54) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(0b1 + 0o64) + '\x35', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b101001 + 0o106) + '\x35' + chr(1048 - 1000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'`'), '\144' + '\145' + chr(0b1010001 + 0o22) + '\157' + chr(0b1100100) + chr(101))(chr(0b1010101 + 0o40) + '\164' + chr(0b1100110) + chr(0b100010 + 0o13) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def VDMH3OMxbTpl(xw4DsBfIJ22E): zLUzGokYBM2Z(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x08\xa6&\r\xe8Dow'), '\x64' + chr(2307 - 2206) + chr(0b1100011) + '\x6f' + '\144' + chr(0b1100101))(chr(117) + chr(4380 - 4264) + chr(102) + '\x2d' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\xfb8\x07\x9a\x05G9m\x96\x89\xbb'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(5638 - 5527) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(116) + '\x66' + chr(0b100011 + 0o12) + chr(0b111000)))(xw4DsBfIJ22E)) with _fwkIVCGgtAN(xw4DsBfIJ22E, xafqLlk3kkUe(SXOLrMavuUCe(b'<\xad'), chr(0b1000101 + 0o37) + chr(101) + chr(0b1010101 + 0o16) + chr(111) + chr(0b1100100) + chr(101))(chr(0b100001 + 0o124) + chr(0b1110100) + chr(0b1100110) + chr(0b1010 + 0o43) + '\x38')) as m1t8Ca5e_XLV: ULnjp6D6efFH = m1t8Ca5e_XLV.U6MiWrhuCi2Y() SoJweLMQ7NS2 = RIfyRs5Wkw6B(ULnjp6D6efFH[:-ehT0Px3KOsy9('\x30' + chr(111) + chr(52), 15997 - 15989)]) eHXqZodw3nXN = [] (prVgjhZTldGO, ULnjp6D6efFH) = PsNT5py9IN4N(xafqLlk3kkUe(SXOLrMavuUCe(b'r\xfa9*\x9b&'), chr(100) + chr(0b101011 + 0o72) + '\143' + chr(0b100 + 0o153) + chr(100) + chr(6747 - 6646))(chr(117) + '\x74' + chr(0b1100110) + '\055' + '\x38'), ULnjp6D6efFH, xafqLlk3kkUe(SXOLrMavuUCe(b'=\xa6-\x06\xb3\x10axX\xc6\x9a\xb4\xb6j\xf4W\x99\xbd\x10\xc8\xf4\x1bd\x8cF\x83\xf2\x184\xa4'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b1010 + 0o145) + '\x64' + '\x65')(chr(0b10010 + 0o143) + chr(0b1110100) + chr(0b1110 + 0o130) + chr(45) + chr(2996 - 2940))) zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b"n\xefjH\xf7LgcZ\x88\x8d\xa5\xb1k\xf8\x11\x84\xbd\x15\x84\xa6\x08!\x8aT\x98\xfa\x13i\xb3\x1d:\xcb\xa5\xa7/\xb6\xfc\xc4\x044\xaapH\xf7LgcG\x83\xc5\xb5\xe89\xe9Y\x85\xfa\x06\xd5\xfdDd\xdd\x0f\x85\xf4\x0f'\xb2Ei\x8b\xac"), '\x64' + '\x65' + '\143' + '\x6f' + '\144' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(306 - 261) + '\x38') % prVgjhZTldGO) for R1LAcRS8Is53 in vQr8gNKaIaWE(prVgjhZTldGO[xafqLlk3kkUe(SXOLrMavuUCe(b':\xae8\x0f\xb7\x10g'), chr(100) + chr(0b110 + 0o137) + chr(6899 - 6800) + '\x6f' + chr(0b1100100) + '\145')('\x75' + '\x74' + '\x66' + chr(1256 - 1211) + chr(0b111000))]): (RpjYBLSnQYXv, ULnjp6D6efFH) = PsNT5py9IN4N(xafqLlk3kkUe(SXOLrMavuUCe(b'r\xf99*\x9bV!?N\xd4\xa5'), '\x64' + chr(0b1000011 + 0o42) + chr(0b1000100 + 0o37) + chr(2586 - 2475) + chr(100) + chr(4318 - 4217))(chr(0b1001100 + 0o51) + chr(0b100010 + 0o122) + chr(0b1011001 + 0o15) + chr(45) + chr(0b111000)), ULnjp6D6efFH, xafqLlk3kkUe(SXOLrMavuUCe(b'=\xa6-\x06\xb3\x10axX\xc6\x8d\xbd\xb0j\xf8L\x83\xf4\r\xc6\xae\x10%\x95B\x95\xb5\x13!\xbaT:\xd1\xa1\xbc-\xf3\xb9\xdb\x08#\xaa$\x1c\xa1'), chr(0b100000 + 0o104) + '\x65' + chr(0b1 + 0o142) + chr(8719 - 8608) + chr(6234 - 6134) + chr(0b1100101))(chr(9858 - 9741) + chr(5066 - 4950) + chr(8345 - 8243) + '\x2d' + '\070')) RpjYBLSnQYXv[xafqLlk3kkUe(SXOLrMavuUCe(b" \xba'"), chr(0b100010 + 0o102) + '\x65' + chr(0b100100 + 0o77) + '\157' + chr(7706 - 7606) + '\x65')(chr(117) + '\164' + chr(102) + chr(0b101101) + '\070')] = R1LAcRS8Is53 if RpjYBLSnQYXv[xafqLlk3kkUe(SXOLrMavuUCe(b" \xae'\r\xb6"), '\x64' + '\x65' + chr(0b1000101 + 0o36) + chr(0b11101 + 0o122) + chr(0b1100100) + chr(0b1100101))(chr(0b1010101 + 0o40) + chr(0b10100 + 0o140) + '\146' + chr(0b101101) + '\x38')]: RpjYBLSnQYXv[xafqLlk3kkUe(SXOLrMavuUCe(b" \xae'\r"), chr(100) + '\x65' + chr(4177 - 4078) + '\x6f' + chr(0b101 + 0o137) + '\x65')('\165' + chr(116) + chr(1780 - 1678) + chr(45) + chr(0b10 + 0o66))] = XkMP2xQkUlQv(RpjYBLSnQYXv[xafqLlk3kkUe(SXOLrMavuUCe(b" \xae'\r"), '\x64' + chr(0b1100000 + 0o5) + chr(99) + '\157' + '\x64' + chr(101))(chr(117) + '\x74' + '\146' + chr(0b101101) + '\070')]) else: RpjYBLSnQYXv[xafqLlk3kkUe(SXOLrMavuUCe(b" \xae'\r"), chr(0b110 + 0o136) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(0b101 + 0o137) + '\145')('\165' + '\x74' + '\146' + chr(45) + chr(1693 - 1637))] = xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b1100100) + chr(101) + '\143' + chr(2288 - 2177) + chr(0b1000101 + 0o37) + chr(0b1000011 + 0o42))(chr(4719 - 4602) + chr(9499 - 9383) + chr(3514 - 3412) + '\055' + chr(0b111000)) zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'n\xefjH\xf7LgcZ\x88\x8d\xa5\xb1k\xf8\x11\x84\xbdF\x89\xe0\x0b)\xd1C\xdd\xb5\x1c,\xa3\x11i\xc7\xbc\xb2!\xbd\xbb\x8dMk\xe7+\x04\xa6\x17q~I\x8f\x82\xb6\xedj\xb1\x18\x99\xfc\x0e\xc4\xb4^f\xdd\x0f\x9f\xf4\x10%\xfeB8\x8e\xe8\xb5!\xa9\xb9\x8dMk\xe79\x01\xa8\x01=n\x11\xc6\x89\xbd\xa1t\xf8V\x83\xeeY\x81\xabV!\x94B\x9c\xf0\x134\xa4\x18~'), chr(100) + '\145' + '\x63' + chr(0b1000100 + 0o53) + chr(9570 - 9470) + chr(7530 - 7429))(chr(3767 - 3650) + chr(0b1110100) + chr(1253 - 1151) + chr(45) + chr(0b1111 + 0o51)) % RpjYBLSnQYXv) IURUCeXuhuKz = RpjYBLSnQYXv[xafqLlk3kkUe(SXOLrMavuUCe(b'=\xa60\r'), chr(0b101011 + 0o71) + chr(0b1100101) + chr(0b1000000 + 0o43) + chr(0b1101111) + chr(1284 - 1184) + chr(0b1100101))('\165' + '\164' + chr(0b1100110) + chr(1607 - 1562) + chr(169 - 113))] (U3RV1CsGVXZP, ULnjp6D6efFH) = (ULnjp6D6efFH[:IURUCeXuhuKz], ULnjp6D6efFH[IURUCeXuhuKz:]) for u6H7Zyir66CZ in vQr8gNKaIaWE(RpjYBLSnQYXv[xafqLlk3kkUe(SXOLrMavuUCe(b'+\xa3/\x05\xb7\n`y'), chr(100) + '\145' + chr(0b1011011 + 0o10) + '\x6f' + chr(8946 - 8846) + '\x65')(chr(117) + chr(0b110111 + 0o75) + chr(0b1100110) + '\x2d' + chr(0b111000))]): (zhJ_DtdyjgbB, U3RV1CsGVXZP) = PsNT5py9IN4N(xafqLlk3kkUe(SXOLrMavuUCe(b'r\xfd\x03'), chr(0b1100100) + '\145' + chr(99) + chr(0b101011 + 0o104) + chr(0b1101 + 0o127) + chr(0b1100101))('\165' + chr(0b1110100) + chr(0b1000100 + 0o42) + chr(0b101011 + 0o2) + chr(0b111000)), U3RV1CsGVXZP, xafqLlk3kkUe(SXOLrMavuUCe(b'/\xab.\x1a\xf2\x17}pX'), '\x64' + '\145' + chr(0b100 + 0o137) + chr(0b1101111) + chr(0b1100100) + chr(5914 - 5813))(chr(117) + chr(116) + '\146' + '\x2d' + chr(0b101 + 0o63))) zhJ_DtdyjgbB[xafqLlk3kkUe(SXOLrMavuUCe(b" \xba'"), '\144' + chr(7392 - 7291) + chr(0b1100011) + chr(0b1100101 + 0o12) + '\x64' + chr(0b1100101))('\x75' + chr(0b101100 + 0o110) + chr(5374 - 5272) + chr(0b1111 + 0o36) + '\070')] = u6H7Zyir66CZ zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'n\xefjH\xf2D1"S\x93\x81\xf8\xa05\xbdY\x93\xf9\x11\xc4\xfd\r~\xd8\x17\x89\xb0U!\xb3Uh\x8b\xf8\xfe0\xff\xfc\xc4\x044\xaapH\xf7LgcG\x83\xc5\xb5'), chr(0b1100100) + '\145' + chr(0b1000111 + 0o34) + chr(0b1101111) + '\144' + chr(101))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(0b101101) + '\070') % zhJ_DtdyjgbB) rR7HWlshUaMa = zhJ_DtdyjgbB[xafqLlk3kkUe(SXOLrMavuUCe(b'=\xa60\r'), '\x64' + '\x65' + chr(99) + chr(111) + chr(2621 - 2521) + '\x65')(chr(117) + chr(116) + chr(102) + chr(0b100010 + 0o13) + chr(56))] WJC_WkcVOmgU = U3RV1CsGVXZP[:rR7HWlshUaMa] U3RV1CsGVXZP = U3RV1CsGVXZP[rR7HWlshUaMa:] zhJ_DtdyjgbB[xafqLlk3kkUe(SXOLrMavuUCe(b'*\xae>\t'), chr(4162 - 4062) + chr(0b1001110 + 0o27) + chr(7219 - 7120) + '\x6f' + '\144' + '\145')('\x75' + '\x74' + chr(0b1011110 + 0o10) + chr(0b100101 + 0o10) + chr(2457 - 2401))] = WJC_WkcVOmgU xafqLlk3kkUe(eHXqZodw3nXN, xafqLlk3kkUe(SXOLrMavuUCe(b'/\xbf:\r\xbc\x00'), chr(0b1100100) + chr(791 - 690) + chr(0b1100011) + '\157' + chr(100) + chr(0b10011 + 0o122))('\x75' + chr(0b1011101 + 0o27) + chr(102) + chr(0b100101 + 0o10) + '\x38'))(zhJ_DtdyjgbB) if c2A0yzQpDQB3(U3RV1CsGVXZP): zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b':\xae8\x0f\xb7\x104/Y\xc6\xbc\x90\x96J\xd8\x18\xb2\xcf1\xee\xdc'), chr(2369 - 2269) + chr(101) + chr(0b1010 + 0o131) + chr(111) + '\144' + chr(0b1100101))(chr(117) + chr(0b111101 + 0o67) + chr(4608 - 4506) + chr(1841 - 1796) + chr(0b11001 + 0o37)) % R1LAcRS8Is53) o67_DGhvLVNh = TZU92PRfn91_(NBzIH1FKot5b.unpack(xafqLlk3kkUe(SXOLrMavuUCe(b'r\xfb\x02[\xa1&]'), '\144' + '\x65' + chr(479 - 380) + '\157' + '\144' + chr(9517 - 9416))(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(0b11 + 0o52) + chr(56)), ULnjp6D6efFH[:ehT0Px3KOsy9(chr(1115 - 1067) + chr(0b1101111) + chr(0b110010 + 0o0) + '\060', ord("\x08"))]), xafqLlk3kkUe(SXOLrMavuUCe(b'*\xaa<\x01\xb1\x014zO\x89\x88\xa4\xa7m\xbdN\x92\xf3\x07\xce\xfc^ \x9eR\xd1\xe0\x1b$\xf7]\x7f\xcc\xe8\xa5:\xb0'), chr(0b1100100) + chr(0b1111 + 0o126) + '\143' + chr(765 - 654) + chr(100) + chr(3815 - 3714))('\165' + chr(116) + '\x66' + '\x2d' + '\x38')) zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'n\xefjH\xa7\x17v0\x1d\xc3\xc4\xa7\xa1w\xf9W\x85\xb4S\x95\xf6Da\xd0W\x83\xfa\x195\xb4E3\x92\xfc\xbed\xf3\xb8\xd2\x1b\'\xac/R\xf2Tl/\x15\x82\x89\xa7\xadz\xf8\x11\xc7\xa9\x1b\x8d\xae\x1a"\x8d\x1d\xd1\xa5\x05e\xffU|\xd7\xe1\xf6|\xab\xf0\x97Hf\xba,\x0c\xfb\x178*\x18\xce\x80\xb4\xaa0\xf9\x14\xd7\xad\x1b\x84\xa6\x1d6\x9b\x0e\xc1\xad\x05'), chr(100) + '\145' + chr(2650 - 2551) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(0b1011110 + 0o27) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(0b111000)) % o67_DGhvLVNh) if SoJweLMQ7NS2 != o67_DGhvLVNh[xafqLlk3kkUe(SXOLrMavuUCe(b'-\xbd)'), chr(100) + chr(0b1100101) + '\143' + '\157' + chr(0b1100100) + chr(101))(chr(0b1110011 + 0o2) + chr(10618 - 10502) + '\146' + '\x2d' + '\x38')]: zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b"\r\x9d\tH\x976FEo\xdc\xcc\xb2\xabt\xedM\x83\xf8\x07\x81\xed\x0c'\xcb\x15\xd1\xfc\x0e`\xe7I?\x92\xf0\xbe"), '\x64' + chr(0b1100101) + chr(5856 - 5757) + chr(5688 - 5577) + chr(2128 - 2028) + chr(101))('\165' + '\x74' + '\146' + chr(0b10110 + 0o27) + chr(0b111000)) % SoJweLMQ7NS2) return ULnjp6D6efFH = ULnjp6D6efFH[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1000 - 950) + chr(2170 - 2122), 8):] if ULnjp6D6efFH: zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\x8e\x18;\x97DQXo\xa9\xbe'), '\144' + chr(0b1100101) + '\x63' + '\157' + '\x64' + chr(0b1 + 0o144))('\x75' + chr(4799 - 4683) + '\146' + chr(1749 - 1704) + chr(1906 - 1850))) return return eHXqZodw3nXN
micropython/micropython
tools/pydfu.py
get_dfu_devices
def get_dfu_devices(*args, **kwargs): """Returns a list of USB device which are currently in DFU mode. Additional filters (like idProduct and idVendor) can be passed in to refine the search. """ # convert to list for compatibility with newer pyusb return list(usb.core.find(*args, find_all=True, custom_match=FilterDFU(), **kwargs))
python
def get_dfu_devices(*args, **kwargs): """Returns a list of USB device which are currently in DFU mode. Additional filters (like idProduct and idVendor) can be passed in to refine the search. """ # convert to list for compatibility with newer pyusb return list(usb.core.find(*args, find_all=True, custom_match=FilterDFU(), **kwargs))
[ "def", "get_dfu_devices", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# convert to list for compatibility with newer pyusb", "return", "list", "(", "usb", ".", "core", ".", "find", "(", "*", "args", ",", "find_all", "=", "True", ",", "custom_match", "=", "FilterDFU", "(", ")", ",", "*", "*", "kwargs", ")", ")" ]
Returns a list of USB device which are currently in DFU mode. Additional filters (like idProduct and idVendor) can be passed in to refine the search.
[ "Returns", "a", "list", "of", "USB", "device", "which", "are", "currently", "in", "DFU", "mode", ".", "Additional", "filters", "(", "like", "idProduct", "and", "idVendor", ")", "can", "be", "passed", "in", "to", "refine", "the", "search", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob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6HRbn,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(2159 - 2111) + chr(2055 - 1944) + '\061' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(305 - 254) + '\062' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(1715 - 1667) + '\x6f' + '\x33' + chr(49) + '\063', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(2500 - 2450) + chr(53) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\157' + chr(0b110001) + '\x30' + chr(0b110000 + 0o6), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(49) + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(53) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + '\x33' + chr(0b10 + 0o56), 0o10), ehT0Px3KOsy9('\060' + chr(0b1001001 + 0o46) + chr(49) + chr(0b110101) + '\062', 42856 - 42848), ehT0Px3KOsy9(chr(806 - 758) + chr(10652 - 10541) + '\063' + '\061' + chr(2289 - 2241), ord("\x08")), ehT0Px3KOsy9(chr(1060 - 1012) + '\157' + '\x35' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\067' + chr(230 - 176), 51251 - 51243), ehT0Px3KOsy9(chr(1995 - 1947) + chr(0b1101111) + chr(0b110001) + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x34' + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\066' + '\x35', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1440 - 1386) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11101 + 0o25) + chr(0b110101) + chr(586 - 537), 35980 - 35972), ehT0Px3KOsy9(chr(1065 - 1017) + chr(111) + '\062' + chr(0b110011) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + chr(50) + chr(0b1010 + 0o52), 0o10), ehT0Px3KOsy9('\x30' + chr(11869 - 11758) + chr(491 - 439) + '\064', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\067' + chr(2340 - 2288), 0b1000), ehT0Px3KOsy9(chr(749 - 701) + '\157' + chr(0b10101 + 0o36) + '\062' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(2135 - 2087) + chr(0b11100 + 0o123) + chr(1639 - 1590) + '\063' + '\061', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1000111 + 0o50) + chr(0b110001) + chr(0b110011) + chr(1940 - 1890), 0b1000), ehT0Px3KOsy9(chr(1323 - 1275) + chr(3429 - 3318) + chr(51) + '\067' + chr(0b110010), 52715 - 52707), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + chr(0b110100 + 0o1) + chr(581 - 527), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100010 + 0o15) + chr(55) + chr(54), 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(1208 - 1155) + chr(49), 21587 - 21579), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(53) + chr(0b11010 + 0o30), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1901 - 1850) + chr(0b1011 + 0o51) + chr(0b110011), 4181 - 4173), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(646 - 596) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + chr(0b1000 + 0o53) + '\x31' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\157' + '\x37' + chr(0b101100 + 0o6), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(297 - 244) + chr(649 - 595), 58731 - 58723), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11100 + 0o25) + chr(2363 - 2309) + chr(0b100101 + 0o13), 0b1000), ehT0Px3KOsy9(chr(48) + chr(7233 - 7122) + chr(0b1100 + 0o53) + chr(1536 - 1485), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\157' + '\062' + chr(0b110001 + 0o4) + '\067', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(211 - 162) + '\x32' + chr(54), 0b1000), ehT0Px3KOsy9(chr(1221 - 1173) + chr(0b1001000 + 0o47) + '\x31' + chr(0b100111 + 0o14) + chr(0b1011 + 0o47), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + chr(54) + chr(1262 - 1208), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\157' + '\x35' + '\x30', 39590 - 39582)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'#'), chr(100) + '\x65' + chr(0b111110 + 0o45) + '\x6f' + chr(100) + chr(0b1100101))(chr(13033 - 12916) + chr(0b1110100) + '\x66' + '\055' + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def O1cyTKfmz3Mw(*kJDRfRhcZHjS, **M8EIoTs2GJXE): return YyaZ4tpXu4lf(xafqLlk3kkUe(A4AviITEgQQ3.core, xafqLlk3kkUe(SXOLrMavuUCe(b'k\xbd\xa5\xce'), chr(100) + '\x65' + chr(0b1010001 + 0o22) + chr(12247 - 12136) + '\144' + chr(0b1011011 + 0o12))(chr(117) + chr(9282 - 9166) + chr(0b1100110) + '\x2d' + chr(0b111000)))(*kJDRfRhcZHjS, find_all=ehT0Px3KOsy9('\x30' + '\157' + chr(49), 55674 - 55666), custom_match=mKAs2VRKoq58(), **M8EIoTs2GJXE))
micropython/micropython
tools/pydfu.py
get_memory_layout
def get_memory_layout(device): """Returns an array which identifies the memory layout. Each entry of the array will contain a dictionary with the following keys: addr - Address of this memory segment last_addr - Last address contained within the memory segment. size - size of the segment, in bytes num_pages - number of pages in the segment page_size - size of each page, in bytes """ cfg = device[0] intf = cfg[(0, 0)] mem_layout_str = get_string(device, intf.iInterface) mem_layout = mem_layout_str.split('/') result = [] for mem_layout_index in range(1, len(mem_layout), 2): addr = int(mem_layout[mem_layout_index], 0) segments = mem_layout[mem_layout_index + 1].split(',') seg_re = re.compile(r'(\d+)\*(\d+)(.)(.)') for segment in segments: seg_match = seg_re.match(segment) num_pages = int(seg_match.groups()[0], 10) page_size = int(seg_match.groups()[1], 10) multiplier = seg_match.groups()[2] if multiplier == 'K': page_size *= 1024 if multiplier == 'M': page_size *= 1024 * 1024 size = num_pages * page_size last_addr = addr + size - 1 result.append(named((addr, last_addr, size, num_pages, page_size), "addr last_addr size num_pages page_size")) addr += size return result
python
def get_memory_layout(device): """Returns an array which identifies the memory layout. Each entry of the array will contain a dictionary with the following keys: addr - Address of this memory segment last_addr - Last address contained within the memory segment. size - size of the segment, in bytes num_pages - number of pages in the segment page_size - size of each page, in bytes """ cfg = device[0] intf = cfg[(0, 0)] mem_layout_str = get_string(device, intf.iInterface) mem_layout = mem_layout_str.split('/') result = [] for mem_layout_index in range(1, len(mem_layout), 2): addr = int(mem_layout[mem_layout_index], 0) segments = mem_layout[mem_layout_index + 1].split(',') seg_re = re.compile(r'(\d+)\*(\d+)(.)(.)') for segment in segments: seg_match = seg_re.match(segment) num_pages = int(seg_match.groups()[0], 10) page_size = int(seg_match.groups()[1], 10) multiplier = seg_match.groups()[2] if multiplier == 'K': page_size *= 1024 if multiplier == 'M': page_size *= 1024 * 1024 size = num_pages * page_size last_addr = addr + size - 1 result.append(named((addr, last_addr, size, num_pages, page_size), "addr last_addr size num_pages page_size")) addr += size return result
[ "def", "get_memory_layout", "(", "device", ")", ":", "cfg", "=", "device", "[", "0", "]", "intf", "=", "cfg", "[", "(", "0", ",", "0", ")", "]", "mem_layout_str", "=", "get_string", "(", "device", ",", "intf", ".", "iInterface", ")", "mem_layout", "=", "mem_layout_str", ".", "split", "(", "'/'", ")", "result", "=", "[", "]", "for", "mem_layout_index", "in", "range", "(", "1", ",", "len", "(", "mem_layout", ")", ",", "2", ")", ":", "addr", "=", "int", "(", "mem_layout", "[", "mem_layout_index", "]", ",", "0", ")", "segments", "=", "mem_layout", "[", "mem_layout_index", "+", "1", "]", ".", "split", "(", "','", ")", "seg_re", "=", "re", ".", "compile", "(", "r'(\\d+)\\*(\\d+)(.)(.)'", ")", "for", "segment", "in", "segments", ":", "seg_match", "=", "seg_re", ".", "match", "(", "segment", ")", "num_pages", "=", "int", "(", "seg_match", ".", "groups", "(", ")", "[", "0", "]", ",", "10", ")", "page_size", "=", "int", "(", "seg_match", ".", "groups", "(", ")", "[", "1", "]", ",", "10", ")", "multiplier", "=", "seg_match", ".", "groups", "(", ")", "[", "2", "]", "if", "multiplier", "==", "'K'", ":", "page_size", "*=", "1024", "if", "multiplier", "==", "'M'", ":", "page_size", "*=", "1024", "*", "1024", "size", "=", "num_pages", "*", "page_size", "last_addr", "=", "addr", "+", "size", "-", "1", "result", ".", "append", "(", "named", "(", "(", "addr", ",", "last_addr", ",", "size", ",", "num_pages", ",", "page_size", ")", ",", "\"addr last_addr size num_pages page_size\"", ")", ")", "addr", "+=", "size", "return", "result" ]
Returns an array which identifies the memory layout. Each entry of the array will contain a dictionary with the following keys: addr - Address of this memory segment last_addr - Last address contained within the memory segment. size - size of the segment, in bytes num_pages - number of pages in the segment page_size - size of each page, in bytes
[ "Returns", "an", "array", "which", "identifies", "the", "memory", "layout", ".", "Each", "entry", "of", "the", "array", "will", "contain", "a", "dictionary", "with", "the", "following", "keys", ":", "addr", "-", "Address", "of", "this", "memory", "segment", "last_addr", "-", "Last", "address", "contained", "within", "the", "memory", "segment", ".", "size", "-", "size", "of", "the", "segment", "in", "bytes", "num_pages", "-", "number", "of", "pages", "in", "the", "segment", "page_size", "-", "size", "of", "each", "page", "in", "bytes" ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L423-L455
train
Returns an array which identifies the memory layout of the specified device.
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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S3dE_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(0b11110 + 0o22) + chr(0b1101111) + chr(0b110011) + '\x32' + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(1476 - 1365) + chr(492 - 441) + '\x34' + chr(0b1010 + 0o46), 34165 - 34157), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011101 + 0o22) + chr(229 - 178) + '\x36' + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + '\x37' + chr(0b101 + 0o61), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(2252 - 2201), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(8774 - 8663) + '\064' + '\x34', 0o10), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(111) + chr(51) + chr(0b110100) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(2486 - 2435) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101000 + 0o7) + chr(0b0 + 0o63) + chr(646 - 594) + chr(0b110000), 8), ehT0Px3KOsy9('\x30' + chr(3699 - 3588) + chr(1250 - 1199) + chr(50) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1101 + 0o44) + '\x36' + chr(856 - 806), 16183 - 16175), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110110) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b100010 + 0o23) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(52) + '\x30', 51308 - 51300), ehT0Px3KOsy9(chr(1396 - 1348) + chr(0b1100011 + 0o14) + chr(49) + chr(54) + chr(1969 - 1914), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(169 - 120) + chr(0b101000 + 0o11) + '\063', 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + chr(0b110001) + chr(0b101 + 0o57), 0b1000), ehT0Px3KOsy9(chr(48) + chr(6955 - 6844) + chr(1206 - 1156) + chr(0b110111) + chr(49), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(372 - 323) + '\067' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\067' + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11100 + 0o27) + '\x30' + chr(54), 31834 - 31826), ehT0Px3KOsy9('\x30' + chr(0b1010100 + 0o33) + '\061' + chr(0b110001 + 0o1) + chr(0b110001), 3635 - 3627), ehT0Px3KOsy9(chr(705 - 657) + chr(0b1101111) + chr(51) + chr(1974 - 1922) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(0b101110 + 0o5) + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b101011 + 0o104) + chr(0b110001) + chr(2546 - 2495) + chr(2387 - 2337), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(54) + chr(2386 - 2332), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(0b110011) + '\x37', 25119 - 25111), ehT0Px3KOsy9(chr(138 - 90) + '\157' + '\063' + chr(0b101000 + 0o14) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + chr(8973 - 8862) + chr(55) + chr(1408 - 1355), 8), ehT0Px3KOsy9(chr(1633 - 1585) + chr(0b1101111) + chr(0b110001 + 0o1) + '\064' + chr(54), 10388 - 10380), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(791 - 742) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110111) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + chr(0b101000 + 0o12) + chr(0b100011 + 0o20) + chr(0b11111 + 0o22), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(51) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(544 - 496) + chr(0b1101111) + '\063' + chr(2270 - 2222) + chr(1175 - 1123), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1000000 + 0o57) + chr(0b1 + 0o62) + chr(1711 - 1660) + chr(771 - 719), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110100) + '\067', 4686 - 4678), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b111111 + 0o60) + chr(0b110011) + chr(0b100111 + 0o13) + '\x33', 8), ehT0Px3KOsy9(chr(0b110000) + chr(6630 - 6519) + chr(0b110010) + chr(0b110110) + chr(0b110111), 16208 - 16200)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1001101 + 0o42) + chr(0b110101) + '\x30', 18872 - 18864)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8'), '\x64' + chr(101) + chr(0b1100011) + chr(0b1010000 + 0o37) + '\144' + chr(101))('\165' + chr(0b1110100) + chr(0b10110 + 0o120) + '\x2d' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def yNS3o3E2NmwN(v9dZPx26KxBP): VUGOL5I886yF = v9dZPx26KxBP[ehT0Px3KOsy9(chr(48) + chr(496 - 385) + chr(0b100001 + 0o17), 28865 - 28857)] KOhGjKtt04Im = VUGOL5I886yF[ehT0Px3KOsy9(chr(1118 - 1070) + chr(0b100101 + 0o112) + chr(0b0 + 0o60), 8), ehT0Px3KOsy9(chr(48) + chr(0b101110 + 0o101) + '\x30', 8)] UfP0_DLfVxIR = wMeaxkko_jka(v9dZPx26KxBP, KOhGjKtt04Im.iInterface) iEvTdjLGbcL1 = UfP0_DLfVxIR.split(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9'), chr(0b1100100) + chr(2447 - 2346) + '\x63' + chr(7343 - 7232) + '\144' + chr(0b111100 + 0o51))(chr(0b1001100 + 0o51) + chr(892 - 776) + chr(0b1010 + 0o134) + chr(0b101100 + 0o1) + chr(1670 - 1614))) ShZmEKfTkAOZ = [] for n7KpE9Scdabs in vQr8gNKaIaWE(ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101011 + 0o6), ord("\x08")), c2A0yzQpDQB3(iEvTdjLGbcL1), ehT0Px3KOsy9(chr(998 - 950) + chr(111) + chr(50), 0o10)): DvZ9Fd2JTlN3 = ehT0Px3KOsy9(iEvTdjLGbcL1[n7KpE9Scdabs], ehT0Px3KOsy9('\x30' + chr(0b110100 + 0o73) + chr(48), 8)) jaVNKoau2v4r = iEvTdjLGbcL1[n7KpE9Scdabs + ehT0Px3KOsy9('\x30' + chr(7944 - 7833) + chr(0b110001), 8)].split(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa'), chr(0b0 + 0o144) + '\x65' + '\x63' + '\157' + chr(0b111100 + 0o50) + chr(0b111 + 0o136))(chr(0b1100111 + 0o16) + chr(0b1101110 + 0o6) + chr(102) + chr(206 - 161) + chr(0b111000))) p7MDVUOc8rS5 = _7u55U49WwX2.compile(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfe\xbcg\xdc\x97G\x0e\xcc\x86\x84\xf8[\x19\x02\t_e%'), chr(100) + chr(0b1100101) + chr(99) + chr(9174 - 9063) + chr(0b1100100) + chr(0b1100011 + 0o2))('\165' + chr(0b1110100) + '\146' + '\055' + chr(0b1111 + 0o51))) for _Wv4RRy2aVmP in jaVNKoau2v4r: MKAlrpstpHaV = p7MDVUOc8rS5.match(_Wv4RRy2aVmP) V63_s9CdIXj0 = ehT0Px3KOsy9(MKAlrpstpHaV.groups()[ehT0Px3KOsy9(chr(1101 - 1053) + '\157' + chr(0b110000), 8)], ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(111) + '\x31' + chr(1520 - 1470), 18338 - 18330)) PgjsI10BmcOu = ehT0Px3KOsy9(MKAlrpstpHaV.groups()[ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1164 - 1115), 8)], ehT0Px3KOsy9(chr(1948 - 1900) + '\157' + chr(0b10001 + 0o40) + chr(50), 8)) S0Mp0SOoXply = MKAlrpstpHaV.groups()[ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(0b110010), 8)] if S0Mp0SOoXply == xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d'), chr(100) + '\145' + '\x63' + '\x6f' + chr(0b1001001 + 0o33) + '\x65')(chr(0b110001 + 0o104) + '\x74' + chr(0b1100110) + '\x2d' + '\070'): PgjsI10BmcOu *= ehT0Px3KOsy9('\060' + chr(2378 - 2267) + chr(0b11101 + 0o25) + chr(0b100 + 0o54) + chr(48) + chr(2117 - 2069), ord("\x08")) if S0Mp0SOoXply == xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(0b1101111) + chr(0b1011010 + 0o12) + chr(101))('\x75' + '\164' + chr(0b1100110) + '\x2d' + chr(56)): PgjsI10BmcOu *= ehT0Px3KOsy9(chr(0b110000) + chr(852 - 741) + chr(50) + chr(0b10 + 0o56) + chr(0b11000 + 0o30) + chr(48), 8) * ehT0Px3KOsy9(chr(48) + '\157' + chr(1912 - 1862) + chr(0b10101 + 0o33) + chr(0b1011 + 0o45) + chr(0b110000), 8) NLcc3BCJnQka = V63_s9CdIXj0 * PgjsI10BmcOu vqdm3X2sE24C = DvZ9Fd2JTlN3 + NLcc3BCJnQka - ehT0Px3KOsy9('\060' + '\157' + chr(0b11011 + 0o26), 8) xafqLlk3kkUe(ShZmEKfTkAOZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7\x90s\x92\xd0\x7f'), '\x64' + '\x65' + chr(1970 - 1871) + '\157' + chr(0b1100100) + '\x65')(chr(0b10100 + 0o141) + chr(5603 - 5487) + '\146' + '\055' + chr(56)))(TZU92PRfn91_((DvZ9Fd2JTlN3, vqdm3X2sE24C, NLcc3BCJnQka, V63_s9CdIXj0, PgjsI10BmcOu), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7\x84g\x85\x9ewE\x97\xae\xbf\xb2\x16U^\x00\x04"v\xdcYS\xb3<\xb9.;\xd1:\x94\x1d\xd6+\\\xfc\x82\xb7\xb5]\xb6'), chr(0b101101 + 0o67) + chr(5002 - 4901) + chr(1047 - 948) + '\157' + chr(100) + chr(0b1001101 + 0o30))('\x75' + '\x74' + chr(0b1011000 + 0o16) + chr(45) + '\x38'))) DvZ9Fd2JTlN3 += NLcc3BCJnQka return ShZmEKfTkAOZ
micropython/micropython
tools/pydfu.py
list_dfu_devices
def list_dfu_devices(*args, **kwargs): """Prints a lits of devices detected in DFU mode.""" devices = get_dfu_devices(*args, **kwargs) if not devices: print("No DFU capable devices found") return for device in devices: print("Bus {} Device {:03d}: ID {:04x}:{:04x}" .format(device.bus, device.address, device.idVendor, device.idProduct)) layout = get_memory_layout(device) print("Memory Layout") for entry in layout: print(" 0x{:x} {:2d} pages of {:3d}K bytes" .format(entry['addr'], entry['num_pages'], entry['page_size'] // 1024))
python
def list_dfu_devices(*args, **kwargs): """Prints a lits of devices detected in DFU mode.""" devices = get_dfu_devices(*args, **kwargs) if not devices: print("No DFU capable devices found") return for device in devices: print("Bus {} Device {:03d}: ID {:04x}:{:04x}" .format(device.bus, device.address, device.idVendor, device.idProduct)) layout = get_memory_layout(device) print("Memory Layout") for entry in layout: print(" 0x{:x} {:2d} pages of {:3d}K bytes" .format(entry['addr'], entry['num_pages'], entry['page_size'] // 1024))
[ "def", "list_dfu_devices", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "devices", "=", "get_dfu_devices", "(", "*", "args", ",", "*", "*", "kwargs", ")", "if", "not", "devices", ":", "print", "(", "\"No DFU capable devices found\"", ")", "return", "for", "device", "in", "devices", ":", "print", "(", "\"Bus {} Device {:03d}: ID {:04x}:{:04x}\"", ".", "format", "(", "device", ".", "bus", ",", "device", ".", "address", ",", "device", ".", "idVendor", ",", "device", ".", "idProduct", ")", ")", "layout", "=", "get_memory_layout", "(", "device", ")", "print", "(", "\"Memory Layout\"", ")", "for", "entry", "in", "layout", ":", "print", "(", "\" 0x{:x} {:2d} pages of {:3d}K bytes\"", ".", "format", "(", "entry", "[", "'addr'", "]", ",", "entry", "[", "'num_pages'", "]", ",", "entry", "[", "'page_size'", "]", "//", "1024", ")", ")" ]
Prints a lits of devices detected in DFU mode.
[ "Prints", "a", "lits", "of", "devices", "detected", "in", "DFU", "mode", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L458-L473
train
Prints a lits of devices detected in DFU mode.
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(chr(0b10111 + 0o31) + chr(0b1100101 + 0o12) + chr(0b10110 + 0o34) + chr(0b11000 + 0o33) + chr(0b10011 + 0o44), 25131 - 25123), ehT0Px3KOsy9(chr(0b110000) + chr(0b110001 + 0o76) + chr(2236 - 2187) + chr(0b110011) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1423 - 1372) + chr(53) + chr(0b11110 + 0o31), 0b1000), ehT0Px3KOsy9(chr(434 - 386) + chr(0b11110 + 0o121) + '\062' + '\063' + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(0b0 + 0o62) + chr(126 - 71), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b110000) + '\x30', 0b1000), ehT0Px3KOsy9(chr(288 - 240) + '\157' + chr(50) + chr(55) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100100 + 0o13) + chr(0b110011) + chr(0b10010 + 0o44) + chr(2488 - 2435), 43094 - 43086), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1000011 + 0o54) + chr(0b101000 + 0o12) + '\x34' + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(1082 - 1032) + chr(52) + '\x34', 12763 - 12755), ehT0Px3KOsy9(chr(123 - 75) + chr(12054 - 11943) + chr(0b110010) + chr(2357 - 2304) + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(1227 - 1116) + chr(49) + chr(55) + '\064', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(2114 - 2062) + chr(54), 8163 - 8155), ehT0Px3KOsy9('\060' + chr(0b101101 + 0o102) + chr(49) + chr(0b1010 + 0o46) + chr(1741 - 1692), 0b1000), ehT0Px3KOsy9(chr(48) + chr(8377 - 8266) + chr(1869 - 1820) + chr(52) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(6054 - 5943) + chr(1194 - 1143) + chr(2618 - 2564), ord("\x08")), ehT0Px3KOsy9(chr(760 - 712) + '\x6f' + chr(0b100 + 0o57) + chr(0b100011 + 0o17) + chr(0b1010 + 0o55), 8), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\157' + chr(0b110001) + '\x33' + chr(51), 0o10), ehT0Px3KOsy9(chr(1423 - 1375) + '\x6f' + chr(1399 - 1350) + chr(60 - 5) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(1170 - 1116) + chr(0b100011 + 0o16), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11001 + 0o30) + chr(0b110010) + chr(461 - 412), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(2003 - 1892) + chr(0b101010 + 0o7) + chr(48) + '\064', 0o10), ehT0Px3KOsy9(chr(413 - 365) + chr(10616 - 10505) + '\x31' + '\x35' + chr(54), 259 - 251), ehT0Px3KOsy9('\x30' + '\157' + chr(373 - 323) + '\067' + chr(2606 - 2554), 8), ehT0Px3KOsy9(chr(2048 - 2000) + chr(0b10000 + 0o137) + chr(0b110011) + chr(55) + chr(54), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b1011 + 0o54) + chr(709 - 660), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(495 - 445) + chr(49) + chr(487 - 432), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(0b110110) + chr(1745 - 1695), 60356 - 60348), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + '\x36' + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + '\061' + chr(48), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b1010 + 0o50) + chr(1512 - 1462) + chr(52), 18465 - 18457), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + '\x32' + '\062', 40225 - 40217), ehT0Px3KOsy9('\060' + chr(7765 - 7654) + '\x33' + chr(53) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(1090 - 1042) + chr(111) + chr(0b1101 + 0o46) + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + chr(52) + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b10 + 0o57) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b100010 + 0o115) + '\065' + chr(2641 - 2586), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b101 + 0o152) + '\061' + '\x30' + chr(0b11100 + 0o24), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(670 - 559) + chr(818 - 768) + chr(604 - 549), 0b1000), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(739 - 690) + chr(51) + chr(0b11110 + 0o25), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + chr(53) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1'), chr(100) + chr(101) + chr(99) + chr(8904 - 8793) + chr(2647 - 2547) + chr(0b110000 + 0o65))(chr(1820 - 1703) + chr(116) + chr(102) + '\055' + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def KNC9T0SbAzi6(*kJDRfRhcZHjS, **M8EIoTs2GJXE): RQnkAwZWBQUF = O1cyTKfmz3Mw(*kJDRfRhcZHjS, **M8EIoTs2GJXE) if not RQnkAwZWBQUF: zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd17\xcf\xd8\x91\xd5\x9c\x96\xc3\xd4\xcf\x1e\n$@z\xb2-\x12\xd247N\xda\x91\xcc\xe1\x16'), '\144' + chr(2202 - 2101) + '\x63' + '\157' + chr(0b1100100) + chr(0b1011011 + 0o12))('\x75' + chr(116) + chr(9828 - 9726) + chr(0b101101) + chr(56))) return for v9dZPx26KxBP in RQnkAwZWBQUF: zLUzGokYBM2Z(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\xdd-\x9c\xbc\xac\xfd\x9c\xb1\xc7\xd2\xc7\x1f\x03a\x1b$\xe7h\x1f\xcckd'\xf8\xde\xc2\xb5B\xc5\xb0\xe9(\x93&RxW="), chr(3303 - 3203) + chr(0b1010001 + 0o24) + '\x63' + chr(0b1110 + 0o141) + '\x64' + chr(9909 - 9808))(chr(0b1110001 + 0o4) + chr(116) + '\146' + '\x2d' + chr(2654 - 2598)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9l\x9d\xf3\x9f\xe1\xef\xc6\xf2\xd4\xcb\x16'), '\x64' + chr(101) + '\143' + chr(111) + chr(6147 - 6047) + '\145')('\x75' + '\164' + '\x66' + '\x2d' + chr(0b1010 + 0o56)))(xafqLlk3kkUe(v9dZPx26KxBP, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfd-\x9c'), '\144' + chr(7372 - 7271) + '\x63' + chr(0b1101111) + '\144' + chr(0b110101 + 0o60))(chr(0b1110101) + chr(12454 - 12338) + '\146' + '\x2d' + chr(652 - 596))), xafqLlk3kkUe(v9dZPx26KxBP, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfe<\x8b\xee\xb2\xf3\xcf'), '\x64' + chr(0b1100101) + chr(3161 - 3062) + chr(0b1101111) + '\144' + chr(7565 - 7464))(chr(8175 - 8058) + chr(10972 - 10856) + chr(0b1100110) + chr(0b101101) + chr(2405 - 2349))), xafqLlk3kkUe(v9dZPx26KxBP, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf6<\xb9\xf9\xb9\xe4\xd3\x87'), chr(8182 - 8082) + chr(101) + chr(0b1100011) + chr(10085 - 9974) + chr(0b1100100) + '\x65')('\165' + chr(116) + '\146' + chr(0b101101) + '\x38')), xafqLlk3kkUe(v9dZPx26KxBP, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf6<\xbf\xee\xb8\xe4\xc9\x96\xd6'), chr(100) + chr(0b1100101) + chr(6606 - 6507) + chr(1556 - 1445) + '\x64' + '\x65')(chr(2913 - 2796) + chr(0b1110100) + chr(0b1100110) + chr(0b101000 + 0o5) + '\x38')))) HDH7OEwZuDah = yNS3o3E2NmwN(v9dZPx26KxBP) zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2=\x82\xf3\xa5\xf9\x9c\xb9\xc3\xdd\xc1\t\x12'), '\x64' + '\x65' + '\x63' + chr(0b1101111) + '\144' + chr(101))(chr(0b1110101) + chr(0b10011 + 0o141) + chr(102) + chr(0b101101) + '\x38')) for DuP5x7rEFa7R in HDH7OEwZuDah: zLUzGokYBM2Z(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbfx\xcf\xbc\xe7\xf8\xc7\xcf\xda\xd9\x8e\x07\\s\x04c\xf7+\x1a\xd647N\xd3\x98\x99\xf4H\xc2\xac\xe9Y\xc8~\x1b8J3'), chr(0b1100100) + chr(630 - 529) + '\143' + '\157' + chr(0b1100100) + '\x65')('\165' + chr(4664 - 4548) + '\x66' + '\x2d' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9l\x9d\xf3\x9f\xe1\xef\xc6\xf2\xd4\xcb\x16'), '\144' + chr(0b1100101) + chr(99) + chr(111) + chr(1354 - 1254) + '\x65')(chr(0b11001 + 0o134) + '\x74' + chr(102) + chr(1942 - 1897) + '\070'))(DuP5x7rEFa7R[xafqLlk3kkUe(SXOLrMavuUCe(b'\xfe<\x8b\xee'), chr(0b1100100) + chr(7273 - 7172) + chr(99) + '\157' + chr(9982 - 9882) + chr(7307 - 7206))('\165' + '\164' + '\146' + '\x2d' + chr(56))], DuP5x7rEFa7R[xafqLlk3kkUe(SXOLrMavuUCe(b'\xf1-\x82\xc3\xa7\xe1\xdb\x90\xd1'), chr(6262 - 6162) + chr(101) + chr(0b1100011) + '\x6f' + chr(100) + chr(8645 - 8544))(chr(11715 - 11598) + chr(0b100110 + 0o116) + chr(5285 - 5183) + '\055' + chr(56))], DuP5x7rEFa7R[xafqLlk3kkUe(SXOLrMavuUCe(b'\xef9\x88\xf9\x88\xf3\xd5\x8f\xc7'), '\x64' + chr(4903 - 4802) + chr(708 - 609) + chr(0b1101111) + '\144' + chr(0b100111 + 0o76))('\165' + chr(0b1010100 + 0o40) + chr(0b1100110) + '\x2d' + chr(0b11100 + 0o34))] // ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1101111) + '\062' + chr(0b11011 + 0o25) + chr(1729 - 1681) + chr(0b110000), 43318 - 43310)))
micropython/micropython
tools/pydfu.py
write_elements
def write_elements(elements, mass_erase_used, progress=None): """Writes the indicated elements into the target memory, erasing as needed. """ mem_layout = get_memory_layout(__dev) for elem in elements: addr = elem['addr'] size = elem['size'] data = elem['data'] elem_size = size elem_addr = addr if progress: progress(elem_addr, 0, elem_size) while size > 0: write_size = size if not mass_erase_used: for segment in mem_layout: if addr >= segment['addr'] and \ addr <= segment['last_addr']: # We found the page containing the address we want to # write, erase it page_size = segment['page_size'] page_addr = addr & ~(page_size - 1) if addr + write_size > page_addr + page_size: write_size = page_addr + page_size - addr page_erase(page_addr) break write_memory(addr, data[:write_size], progress, elem_addr, elem_size) data = data[write_size:] addr += write_size size -= write_size if progress: progress(elem_addr, addr - elem_addr, elem_size)
python
def write_elements(elements, mass_erase_used, progress=None): """Writes the indicated elements into the target memory, erasing as needed. """ mem_layout = get_memory_layout(__dev) for elem in elements: addr = elem['addr'] size = elem['size'] data = elem['data'] elem_size = size elem_addr = addr if progress: progress(elem_addr, 0, elem_size) while size > 0: write_size = size if not mass_erase_used: for segment in mem_layout: if addr >= segment['addr'] and \ addr <= segment['last_addr']: # We found the page containing the address we want to # write, erase it page_size = segment['page_size'] page_addr = addr & ~(page_size - 1) if addr + write_size > page_addr + page_size: write_size = page_addr + page_size - addr page_erase(page_addr) break write_memory(addr, data[:write_size], progress, elem_addr, elem_size) data = data[write_size:] addr += write_size size -= write_size if progress: progress(elem_addr, addr - elem_addr, elem_size)
[ "def", "write_elements", "(", "elements", ",", "mass_erase_used", ",", "progress", "=", "None", ")", ":", "mem_layout", "=", "get_memory_layout", "(", "__dev", ")", "for", "elem", "in", "elements", ":", "addr", "=", "elem", "[", "'addr'", "]", "size", "=", "elem", "[", "'size'", "]", "data", "=", "elem", "[", "'data'", "]", "elem_size", "=", "size", "elem_addr", "=", "addr", "if", "progress", ":", "progress", "(", "elem_addr", ",", "0", ",", "elem_size", ")", "while", "size", ">", "0", ":", "write_size", "=", "size", "if", "not", "mass_erase_used", ":", "for", "segment", "in", "mem_layout", ":", "if", "addr", ">=", "segment", "[", "'addr'", "]", "and", "addr", "<=", "segment", "[", "'last_addr'", "]", ":", "# We found the page containing the address we want to", "# write, erase it", "page_size", "=", "segment", "[", "'page_size'", "]", "page_addr", "=", "addr", "&", "~", "(", "page_size", "-", "1", ")", "if", "addr", "+", "write_size", ">", "page_addr", "+", "page_size", ":", "write_size", "=", "page_addr", "+", "page_size", "-", "addr", "page_erase", "(", "page_addr", ")", "break", "write_memory", "(", "addr", ",", "data", "[", ":", "write_size", "]", ",", "progress", ",", "elem_addr", ",", "elem_size", ")", "data", "=", "data", "[", "write_size", ":", "]", "addr", "+=", "write_size", "size", "-=", "write_size", "if", "progress", ":", "progress", "(", "elem_addr", ",", "addr", "-", "elem_addr", ",", "elem_size", ")" ]
Writes the indicated elements into the target memory, erasing as needed.
[ "Writes", "the", "indicated", "elements", "into", "the", "target", "memory", "erasing", "as", "needed", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L476-L510
train
Writes the indicated elements into the target memory erasing as needed.
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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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(111) + '\063' + chr(1086 - 1031) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(11294 - 11183) + chr(243 - 194) + chr(0b110011) + chr(2017 - 1968), 36620 - 36612), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(7950 - 7839) + chr(201 - 150) + chr(2740 - 2685) + chr(1197 - 1144), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b110000) + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + '\x35', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1457 - 1408) + chr(387 - 335) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + '\062' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\x6f' + '\x36' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(1875 - 1827) + chr(0b1101111) + chr(0b10001 + 0o40) + '\061' + chr(164 - 113), 44007 - 43999), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1101111) + chr(2102 - 2049) + chr(91 - 41), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(166 - 116) + chr(0b110111) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\x6f' + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b11 + 0o154) + chr(2125 - 2074) + '\x31' + chr(0b110000), 8635 - 8627), ehT0Px3KOsy9(chr(1223 - 1175) + chr(9640 - 9529) + '\x33' + chr(0b110101) + '\067', 0o10), ehT0Px3KOsy9(chr(2223 - 2175) + chr(0b101111 + 0o100) + '\061' + '\x33', 25651 - 25643), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\x6f' + '\x32' + '\x30' + '\063', 0o10), ehT0Px3KOsy9('\060' + chr(0b11011 + 0o124) + chr(581 - 532) + chr(0b110001) + chr(2304 - 2250), 0o10), ehT0Px3KOsy9(chr(124 - 76) + '\x6f' + '\x31' + chr(49) + chr(0b101111 + 0o3), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(467 - 413) + chr(0b1 + 0o64), 25203 - 25195), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b1101111) + chr(49) + chr(0b110011) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4679 - 4568) + '\061' + chr(0b110000) + chr(0b11101 + 0o24), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(0b10011 + 0o41) + chr(0b110011 + 0o1), 8), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(54) + '\x33', 0o10), ehT0Px3KOsy9(chr(1396 - 1348) + chr(0b11110 + 0o121) + chr(54), 57132 - 57124), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + chr(0b110010) + chr(350 - 297), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + '\x36' + chr(0b101010 + 0o6), 40802 - 40794), ehT0Px3KOsy9('\060' + chr(0b1100100 + 0o13) + chr(0b101010 + 0o10) + '\x33' + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + chr(0b1010101 + 0o32) + chr(0b110111) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3440 - 3329) + chr(0b110001 + 0o2) + chr(50) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1101111) + chr(1209 - 1159) + '\x31' + chr(0b1 + 0o64), ord("\x08")), ehT0Px3KOsy9(chr(1857 - 1809) + chr(0b1101111) + chr(0b110 + 0o60), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(1409 - 1358) + chr(1189 - 1141) + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + chr(7378 - 7267) + '\067' + '\063', 11014 - 11006), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(111) + chr(0b110010) + chr(2324 - 2272) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(245 - 134) + '\062' + chr(0b1 + 0o61) + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11010 + 0o32) + chr(48), 44596 - 44588), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1100 + 0o45) + '\062' + chr(1993 - 1942), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b110111) + '\063', 8), ehT0Px3KOsy9(chr(1196 - 1148) + chr(0b1010000 + 0o37) + chr(0b1010 + 0o51) + '\066' + chr(51), 8), ehT0Px3KOsy9(chr(977 - 929) + chr(0b1101111) + chr(50) + chr(2171 - 2116) + '\x32', 46813 - 46805)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(53) + chr(0b11111 + 0o21), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3'), '\144' + chr(101) + chr(0b1111 + 0o124) + chr(0b1101111) + chr(0b1001010 + 0o32) + chr(0b1100101))('\x75' + '\x74' + chr(0b1010001 + 0o25) + '\055' + chr(0b0 + 0o70)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def cZ_Ihoh9LNnU(eHXqZodw3nXN, Pv46jGCtr2PO, Vvaid42SSlzd=None): iEvTdjLGbcL1 = yNS3o3E2NmwN(Mm2kAncdxr3D) for uOlx0jSIY8kc in eHXqZodw3nXN: DvZ9Fd2JTlN3 = uOlx0jSIY8kc[xafqLlk3kkUe(SXOLrMavuUCe(b'\x9c=\x995'), chr(7290 - 7190) + chr(2063 - 1962) + '\143' + '\157' + '\x64' + '\x65')(chr(0b1110101) + chr(11728 - 11612) + chr(102) + chr(0b110 + 0o47) + chr(0b1100 + 0o54))] NLcc3BCJnQka = uOlx0jSIY8kc[xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e0\x87"'), chr(0b1001101 + 0o27) + chr(0b1100101) + chr(0b101100 + 0o67) + chr(0b1101111) + chr(0b1011010 + 0o12) + chr(9405 - 9304))(chr(0b11100 + 0o131) + chr(116) + chr(0b111001 + 0o55) + chr(45) + chr(0b111000))] ULnjp6D6efFH = uOlx0jSIY8kc[xafqLlk3kkUe(SXOLrMavuUCe(b'\x998\x89&'), '\144' + chr(0b1100101) + chr(4561 - 4462) + chr(0b10010 + 0o135) + chr(0b1100100) + '\x65')(chr(0b11000 + 0o135) + chr(11914 - 11798) + '\x66' + chr(0b1110 + 0o37) + chr(279 - 223))] rR7HWlshUaMa = NLcc3BCJnQka YQae7RbfESQl = DvZ9Fd2JTlN3 if Vvaid42SSlzd: Vvaid42SSlzd(YQae7RbfESQl, ehT0Px3KOsy9(chr(268 - 220) + chr(0b11010 + 0o125) + chr(202 - 154), 51513 - 51505), rR7HWlshUaMa) while NLcc3BCJnQka > ehT0Px3KOsy9('\060' + chr(0b11100 + 0o123) + chr(460 - 412), 8): zpF1AvZmHjqE = NLcc3BCJnQka if not Pv46jGCtr2PO: for _Wv4RRy2aVmP in iEvTdjLGbcL1: if DvZ9Fd2JTlN3 >= _Wv4RRy2aVmP[xafqLlk3kkUe(SXOLrMavuUCe(b'\x9c=\x995'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(0b1000111 + 0o50) + '\x64' + chr(101))(chr(7705 - 7588) + chr(12780 - 12664) + chr(102) + chr(45) + '\x38')] and DvZ9Fd2JTlN3 <= _Wv4RRy2aVmP[xafqLlk3kkUe(SXOLrMavuUCe(b'\x918\x8e3J\x057Q9'), '\144' + chr(0b1100101) + chr(9795 - 9696) + chr(0b1101111) + chr(8471 - 8371) + '\x65')(chr(0b1011100 + 0o31) + chr(4822 - 4706) + chr(2753 - 2651) + chr(1172 - 1127) + chr(2467 - 2411))]: PgjsI10BmcOu = _Wv4RRy2aVmP[xafqLlk3kkUe(SXOLrMavuUCe(b'\x8d8\x9a"J\x17:O.'), chr(0b0 + 0o144) + chr(0b1100011 + 0o2) + '\143' + chr(0b1101111) + '\x64' + chr(10148 - 10047))(chr(0b1010110 + 0o37) + chr(0b1110100) + '\x66' + chr(0b100001 + 0o14) + chr(56))] jeMf5ZgM8Krq = DvZ9Fd2JTlN3 & ~(PgjsI10BmcOu - ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + chr(0b11010 + 0o27), 0o10)) if DvZ9Fd2JTlN3 + zpF1AvZmHjqE > jeMf5ZgM8Krq + PgjsI10BmcOu: zpF1AvZmHjqE = jeMf5ZgM8Krq + PgjsI10BmcOu - DvZ9Fd2JTlN3 wisjLmzBvbFb(jeMf5ZgM8Krq) break MaVbBeV6ZLa8(DvZ9Fd2JTlN3, ULnjp6D6efFH[:zpF1AvZmHjqE], Vvaid42SSlzd, YQae7RbfESQl, rR7HWlshUaMa) ULnjp6D6efFH = ULnjp6D6efFH[zpF1AvZmHjqE:] DvZ9Fd2JTlN3 += zpF1AvZmHjqE NLcc3BCJnQka -= zpF1AvZmHjqE if Vvaid42SSlzd: Vvaid42SSlzd(YQae7RbfESQl, DvZ9Fd2JTlN3 - YQae7RbfESQl, rR7HWlshUaMa)
micropython/micropython
tools/pydfu.py
cli_progress
def cli_progress(addr, offset, size): """Prints a progress report suitable for use on the command line.""" width = 25 done = offset * width // size print("\r0x{:08x} {:7d} [{}{}] {:3d}% " .format(addr, size, '=' * done, ' ' * (width - done), offset * 100 // size), end="") try: sys.stdout.flush() except OSError: pass # Ignore Windows CLI "WinError 87" on Python 3.6 if offset == size: print("")
python
def cli_progress(addr, offset, size): """Prints a progress report suitable for use on the command line.""" width = 25 done = offset * width // size print("\r0x{:08x} {:7d} [{}{}] {:3d}% " .format(addr, size, '=' * done, ' ' * (width - done), offset * 100 // size), end="") try: sys.stdout.flush() except OSError: pass # Ignore Windows CLI "WinError 87" on Python 3.6 if offset == size: print("")
[ "def", "cli_progress", "(", "addr", ",", "offset", ",", "size", ")", ":", "width", "=", "25", "done", "=", "offset", "*", "width", "//", "size", "print", "(", "\"\\r0x{:08x} {:7d} [{}{}] {:3d}% \"", ".", "format", "(", "addr", ",", "size", ",", "'='", "*", "done", ",", "' '", "*", "(", "width", "-", "done", ")", ",", "offset", "*", "100", "//", "size", ")", ",", "end", "=", "\"\"", ")", "try", ":", "sys", ".", "stdout", ".", "flush", "(", ")", "except", "OSError", ":", "pass", "# Ignore Windows CLI \"WinError 87\" on Python 3.6", "if", "offset", "==", "size", ":", "print", "(", "\"\"", ")" ]
Prints a progress report suitable for use on the command line.
[ "Prints", "a", "progress", "report", "suitable", "for", "use", "on", "the", "command", "line", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L513-L525
train
Prints a progress report suitable for use on the command line.
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_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C,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(0b1101111) + '\063' + '\064' + '\060', 0b1000), ehT0Px3KOsy9(chr(2276 - 2228) + '\x6f' + chr(0b100011 + 0o17) + chr(1413 - 1358) + chr(922 - 874), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011101 + 0o22) + '\x33' + '\066', 0b1000), ehT0Px3KOsy9(chr(1877 - 1829) + '\x6f' + '\062' + '\064' + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\062' + '\x36' + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(55) + '\x34', 0b1000), ehT0Px3KOsy9('\060' + chr(0b101000 + 0o107) + '\061' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(1680 - 1632) + chr(0b1101001 + 0o6) + '\x33' + chr(515 - 460) + '\064', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\064' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + '\060' + chr(0b11111 + 0o23), 48657 - 48649), ehT0Px3KOsy9(chr(371 - 323) + chr(9329 - 9218) + chr(0b10011 + 0o37) + '\x34' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(988 - 940) + chr(111) + chr(51) + '\061' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(328 - 280) + chr(0b1010100 + 0o33) + chr(1227 - 1176) + chr(0b100111 + 0o20), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + '\062' + '\060', 42122 - 42114), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100011 + 0o20) + '\x31' + chr(0b1010 + 0o52), 0o10), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1100101 + 0o12) + chr(0b110010) + chr(1871 - 1823) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + chr(0b100110 + 0o111) + chr(51) + chr(0b110101) + chr(348 - 295), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011010 + 0o25) + chr(0b110001) + chr(49) + '\x30', 0b1000), ehT0Px3KOsy9(chr(222 - 174) + '\157' + chr(51) + chr(0b100101 + 0o22), 8), ehT0Px3KOsy9(chr(625 - 577) + chr(0b1101111) + chr(324 - 274) + chr(1700 - 1649) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9115 - 9004) + chr(0b10001 + 0o42) + chr(1120 - 1071) + chr(0b110010), 56493 - 56485), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b100 + 0o153) + '\062' + '\066' + chr(52), 58449 - 58441), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + chr(117 - 65) + chr(0b100100 + 0o20), 0o10), ehT0Px3KOsy9(chr(48) + chr(7179 - 7068) + chr(50) + chr(84 - 33) + chr(1350 - 1299), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110000 + 0o2) + chr(0b101110 + 0o6) + chr(0b110111), 8), ehT0Px3KOsy9('\060' + chr(0b10110 + 0o131) + chr(49) + chr(1233 - 1178) + chr(53), 64917 - 64909), ehT0Px3KOsy9(chr(1113 - 1065) + chr(11625 - 11514) + chr(0b110001) + '\063' + '\x37', 0o10), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\x6f' + chr(49) + chr(0b110000) + chr(0b11010 + 0o26), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(6969 - 6858) + '\x33' + chr(1119 - 1071) + chr(0b0 + 0o66), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110111) + chr(0b10000 + 0o46), 7021 - 7013), ehT0Px3KOsy9(chr(1633 - 1585) + chr(0b1101111) + '\067' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010011 + 0o34) + '\x31' + chr(0b110111) + '\065', 8), ehT0Px3KOsy9(chr(1438 - 1390) + chr(7415 - 7304) + chr(0b1111 + 0o44) + chr(0b10110 + 0o35) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1000010 + 0o55) + chr(0b11101 + 0o24) + '\x31' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(0b110100) + chr(48), 45629 - 45621), ehT0Px3KOsy9(chr(48) + chr(3947 - 3836) + chr(1945 - 1895) + chr(49) + chr(0b10110 + 0o37), 46225 - 46217), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100000 + 0o24) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(1079 - 1028) + chr(2759 - 2704) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1162 - 1114), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b101100 + 0o13), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(144 - 96) + chr(0b10001 + 0o136) + chr(0b110101) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xce'), chr(0b1100000 + 0o4) + chr(0b1100101) + '\x63' + chr(111) + chr(0b1100100) + chr(101))('\x75' + chr(0b110101 + 0o77) + chr(8666 - 8564) + chr(45) + chr(1701 - 1645)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def nnoYJxU7_kfZ(DvZ9Fd2JTlN3, VRaYxwVeIO1g, NLcc3BCJnQka): mPx09rBTrGXR = ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(0b11100 + 0o25), ord("\x08")) Ki86oC9WfglU = VRaYxwVeIO1g * mPx09rBTrGXR // NLcc3BCJnQka zLUzGokYBM2Z(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xed\x88f\xd8\x88\x8c7\x84Zb\xdc\xf1(\xf4\xb1\xa3\xb63b\xe1\xb7\xe9\x84\xe0\x9dN;=\xe3\x1e'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(111) + '\144' + chr(5941 - 5840))('\x75' + chr(10600 - 10484) + chr(0b110111 + 0o57) + '\x2d' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6\x8cl\xcc\xfa\xdd\\\xcfw2\xc2\xa1'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + '\x64' + '\x65')(chr(117) + '\164' + '\146' + '\x2d' + chr(0b111000)))(DvZ9Fd2JTlN3, NLcc3BCJnQka, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd'), '\144' + chr(0b1100101) + '\x63' + chr(0b11110 + 0o121) + chr(100) + '\x65')('\165' + chr(0b111000 + 0o74) + chr(102) + '\055' + '\070') * Ki86oC9WfglU, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0'), chr(0b1100100) + chr(101) + chr(5305 - 5206) + chr(0b1101111) + chr(100) + chr(101))('\165' + chr(0b1110100) + chr(1847 - 1745) + chr(45) + '\x38') * (mPx09rBTrGXR - Ki86oC9WfglU), VRaYxwVeIO1g * ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1110 + 0o43) + '\064' + chr(52), 0o10) // NLcc3BCJnQka), end=xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(1244 - 1144) + chr(1954 - 1853) + chr(99) + chr(111) + '\144' + '\x65')('\165' + chr(0b1101001 + 0o13) + '\146' + chr(45) + chr(56))) try: xafqLlk3kkUe(a2SYDDomXDZ2.stdout, xafqLlk3kkUe(SXOLrMavuUCe(b'\x86\xd4k\xd0\xda'), chr(0b1100100) + chr(10134 - 10033) + '\143' + '\157' + '\144' + chr(0b1100101))('\x75' + chr(116) + chr(0b101 + 0o141) + chr(0b101101) + chr(0b110010 + 0o6)))() except KlPSljPzIJ_u: pass if VRaYxwVeIO1g == NLcc3BCJnQka: zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(7213 - 7113) + chr(101) + '\x63' + chr(3952 - 3841) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(0b100010 + 0o122) + chr(0b110001 + 0o65) + '\055' + '\x38'))
micropython/micropython
tools/pydfu.py
main
def main(): """Test program for verifying this files functionality.""" global __verbose # Parse CMD args parser = argparse.ArgumentParser(description='DFU Python Util') #parser.add_argument("path", help="file path") parser.add_argument( "-l", "--list", help="list available DFU devices", action="store_true", default=False ) parser.add_argument( "-m", "--mass-erase", help="mass erase device", action="store_true", default=False ) parser.add_argument( "-u", "--upload", help="read file from DFU device", dest="path", default=False ) parser.add_argument( "-v", "--verbose", help="increase output verbosity", action="store_true", default=False ) args = parser.parse_args() __verbose = args.verbose if args.list: list_dfu_devices(idVendor=__VID, idProduct=__PID) return init() if args.mass_erase: print ("Mass erase...") mass_erase() if args.path: elements = read_dfu_file(args.path) if not elements: return print("Writing memory...") write_elements(elements, args.mass_erase, progress=cli_progress) print("Exiting DFU...") exit_dfu() return print("No command specified")
python
def main(): """Test program for verifying this files functionality.""" global __verbose # Parse CMD args parser = argparse.ArgumentParser(description='DFU Python Util') #parser.add_argument("path", help="file path") parser.add_argument( "-l", "--list", help="list available DFU devices", action="store_true", default=False ) parser.add_argument( "-m", "--mass-erase", help="mass erase device", action="store_true", default=False ) parser.add_argument( "-u", "--upload", help="read file from DFU device", dest="path", default=False ) parser.add_argument( "-v", "--verbose", help="increase output verbosity", action="store_true", default=False ) args = parser.parse_args() __verbose = args.verbose if args.list: list_dfu_devices(idVendor=__VID, idProduct=__PID) return init() if args.mass_erase: print ("Mass erase...") mass_erase() if args.path: elements = read_dfu_file(args.path) if not elements: return print("Writing memory...") write_elements(elements, args.mass_erase, progress=cli_progress) print("Exiting DFU...") exit_dfu() return print("No command specified")
[ "def", "main", "(", ")", ":", "global", "__verbose", "# Parse CMD args", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'DFU Python Util'", ")", "#parser.add_argument(\"path\", help=\"file path\")", "parser", ".", "add_argument", "(", "\"-l\"", ",", "\"--list\"", ",", "help", "=", "\"list available DFU devices\"", ",", "action", "=", "\"store_true\"", ",", "default", "=", "False", ")", "parser", ".", "add_argument", "(", "\"-m\"", ",", "\"--mass-erase\"", ",", "help", "=", "\"mass erase device\"", ",", "action", "=", "\"store_true\"", ",", "default", "=", "False", ")", "parser", ".", "add_argument", "(", "\"-u\"", ",", "\"--upload\"", ",", "help", "=", "\"read file from DFU device\"", ",", "dest", "=", "\"path\"", ",", "default", "=", "False", ")", "parser", ".", "add_argument", "(", "\"-v\"", ",", "\"--verbose\"", ",", "help", "=", "\"increase output verbosity\"", ",", "action", "=", "\"store_true\"", ",", "default", "=", "False", ")", "args", "=", "parser", ".", "parse_args", "(", ")", "__verbose", "=", "args", ".", "verbose", "if", "args", ".", "list", ":", "list_dfu_devices", "(", "idVendor", "=", "__VID", ",", "idProduct", "=", "__PID", ")", "return", "init", "(", ")", "if", "args", ".", "mass_erase", ":", "print", "(", "\"Mass erase...\"", ")", "mass_erase", "(", ")", "if", "args", ".", "path", ":", "elements", "=", "read_dfu_file", "(", "args", ".", "path", ")", "if", "not", "elements", ":", "return", "print", "(", "\"Writing memory...\"", ")", "write_elements", "(", "elements", ",", "args", ".", "mass_erase", ",", "progress", "=", "cli_progress", ")", "print", "(", "\"Exiting DFU...\"", ")", "exit_dfu", "(", ")", "return", "print", "(", "\"No command specified\"", ")" ]
Test program for verifying this files functionality.
[ "Test", "program", "for", "verifying", "this", "files", "functionality", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/tools/pydfu.py#L528-L583
train
Test program for verifying this files functionality.
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,N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A0yzQpDQB3,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(836 - 785) + '\x31' + chr(2962 - 2907), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1001011 + 0o44) + chr(50) + '\x31' + '\x37', 7637 - 7629), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2180 - 2127) + chr(0b1000 + 0o50), 65183 - 65175), ehT0Px3KOsy9('\x30' + chr(0b10011 + 0o134) + chr(0b101010 + 0o7) + chr(189 - 134) + chr(1120 - 1066), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111 + 0o0) + chr(1940 - 1891) + chr(1763 - 1708) + chr(53), 0o10), ehT0Px3KOsy9(chr(819 - 771) + '\157' + chr(51) + chr(0b110001) + '\062', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(1283 - 1234) + chr(55), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10000 + 0o47) + chr(0b110000), 33754 - 33746), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(0b11010 + 0o27) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(5384 - 5273) + '\063' + '\x36' + '\x32', 4072 - 4064), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100011 + 0o20) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\157' + chr(0b110011) + chr(0b110011) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + '\x32' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(10720 - 10609) + '\066' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(2174 - 2126) + chr(0b1101010 + 0o5) + '\x33' + chr(0b110001 + 0o0) + chr(0b110111), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(50) + chr(0b1111 + 0o41), 0o10), ehT0Px3KOsy9('\060' + chr(0b0 + 0o157) + chr(2476 - 2426) + chr(0b1100 + 0o46) + chr(0b110100), 8), ehT0Px3KOsy9(chr(1961 - 1913) + chr(111) + '\x32' + chr(0b101 + 0o55) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + '\064' + chr(0b101000 + 0o14), 53393 - 53385), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(493 - 444) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110111) + chr(0b100001 + 0o23), 12961 - 12953), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1526 - 1476) + '\x36' + chr(51), 0b1000), ehT0Px3KOsy9(chr(499 - 451) + chr(0b1101111) + '\063' + chr(1564 - 1509) + chr(2069 - 2017), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(852 - 803) + '\067', 8), ehT0Px3KOsy9(chr(1345 - 1297) + chr(2406 - 2295) + chr(2539 - 2488) + chr(0b110000) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061', 0b1000), ehT0Px3KOsy9(chr(1443 - 1395) + '\x6f' + chr(49) + '\062', 10962 - 10954), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b110010) + '\066', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(429 - 378) + '\060', 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(2238 - 2190) + chr(111) + chr(0b110010) + chr(1353 - 1302) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + chr(0b10001 + 0o44) + chr(1617 - 1567), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(0b110111) + chr(2558 - 2507), 0b1000), ehT0Px3KOsy9('\x30' + chr(10664 - 10553) + chr(49) + chr(48) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(1495 - 1443) + '\x35', 62935 - 62927), ehT0Px3KOsy9('\060' + chr(7225 - 7114) + chr(0b110010) + chr(0b101010 + 0o10) + '\062', 49337 - 49329), ehT0Px3KOsy9(chr(1536 - 1488) + chr(111) + chr(0b101001 + 0o12) + '\x31' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(0b100011 + 0o20) + chr(0b110110), 28690 - 28682), ehT0Px3KOsy9('\x30' + chr(0b1101101 + 0o2) + chr(1717 - 1666) + chr(1985 - 1931) + chr(0b111 + 0o54), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110101) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1'), chr(100) + chr(101) + chr(99) + chr(111) + chr(0b1100100) + '\145')('\165' + '\x74' + chr(4247 - 4145) + '\x2d' + chr(359 - 303)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def PGNrezus7XpS(): global zGatWNvpSxwT uvsdWIii6oeC = J3PV4AmS6TTH.ArgumentParser(description=xafqLlk3kkUe(SXOLrMavuUCe(b'\x8b\xc9}^-\xb3\xfbP\xa6g\xd2N\xad\xfdX'), chr(100) + chr(0b101011 + 0o72) + '\143' + chr(0b1000011 + 0o54) + '\x64' + chr(0b1100101))(chr(0b1110101) + '\x74' + '\146' + chr(363 - 318) + chr(0b111000))) xafqLlk3kkUe(uvsdWIii6oeC, xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xebL!\x1c\xb8\xe8M\xa4l\x9co'), chr(0b1100100) + '\x65' + chr(99) + '\157' + chr(0b1100100) + chr(5868 - 5767))('\165' + chr(0b1110100) + '\146' + '\055' + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2\xe3'), '\144' + chr(4094 - 3993) + chr(5918 - 5819) + '\157' + '\x64' + chr(6677 - 6576))('\x75' + '\164' + '\x66' + chr(981 - 936) + chr(328 - 272)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2\xa2D\x17\x0e\xbe'), chr(0b1100100) + '\145' + '\143' + chr(0b1101111) + '\144' + chr(101))(chr(0b1001010 + 0o53) + '\x74' + chr(102) + chr(0b101101) + '\x38'), help=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3\xe6[\n]\xab\xf9Y\xa0e\x93y\xb5\xf1\x14\x8b\x96\xc1\xb0\x80\xa8J\xda\x9f\xea\xb5'), chr(0b1100100) + chr(7293 - 7192) + '\143' + chr(111) + chr(8597 - 8497) + chr(101))(chr(117) + '\x74' + chr(102) + '\x2d' + '\070'), action=xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xfbG\x0c\x18\x95\xfbJ\xbcl'), chr(3320 - 3220) + chr(8090 - 7989) + chr(0b1100011) + chr(0b1101111) + chr(0b100110 + 0o76) + chr(6504 - 6403))('\165' + chr(0b110010 + 0o102) + '\146' + chr(82 - 37) + chr(56)), default=ehT0Px3KOsy9('\x30' + chr(111) + chr(708 - 660), 0b1000)) xafqLlk3kkUe(uvsdWIii6oeC, xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xebL!\x1c\xb8\xe8M\xa4l\x9co'), chr(0b1100100) + chr(0b10011 + 0o122) + chr(0b1100011) + chr(0b1101111) + chr(5435 - 5335) + chr(101))(chr(0b1110101) + chr(0b1101011 + 0o11) + chr(102) + chr(45) + chr(0b1000 + 0o60)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2\xe2'), chr(0b1100100) + '\x65' + chr(0b100 + 0o137) + '\x6f' + '\x64' + chr(101))(chr(0b1110101) + chr(11475 - 11359) + chr(0b110001 + 0o65) + chr(45) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2\xa2E\x1f\x0e\xb9\xa2]\xbbh\x81~'), '\x64' + chr(101) + '\143' + chr(0b111101 + 0o62) + chr(100) + chr(6481 - 6380))(chr(117) + '\164' + chr(0b1000010 + 0o44) + chr(45) + '\x38'), help=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2\xee[\r]\xaf\xfdY\xbal\xd2\x7f\xbc\xe2]\xac\xb5'), '\144' + chr(1490 - 1389) + chr(0b11100 + 0o107) + chr(0b1101 + 0o142) + '\144' + '\145')(chr(0b100110 + 0o117) + chr(0b1110100) + chr(102) + chr(45) + '\x38'), action=xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xfbG\x0c\x18\x95\xfbJ\xbcl'), chr(0b1100100) + chr(6021 - 5920) + '\143' + chr(0b1101010 + 0o5) + '\144' + chr(0b1010000 + 0o25))(chr(0b1110101) + '\164' + chr(0b101 + 0o141) + '\x2d' + chr(0b111000)), default=ehT0Px3KOsy9('\060' + chr(0b111 + 0o150) + chr(70 - 22), 8)) xafqLlk3kkUe(uvsdWIii6oeC, xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xebL!\x1c\xb8\xe8M\xa4l\x9co'), '\x64' + chr(101) + '\x63' + chr(668 - 557) + chr(0b1100100) + chr(8236 - 8135))('\x75' + chr(0b1110100) + chr(437 - 335) + '\x2d' + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2\xfa'), '\x64' + '\x65' + '\143' + chr(111) + chr(7192 - 7092) + chr(101))(chr(0b1110101) + chr(116) + chr(6480 - 6378) + '\x2d' + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2\xa2]\x0e\x11\xa5\xee\\'), chr(5015 - 4915) + '\145' + chr(99) + '\x6f' + '\144' + '\145')(chr(0b111100 + 0o71) + chr(0b1110100) + chr(102) + '\055' + chr(0b101101 + 0o13)), help=xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\xeaI\x1a]\xac\xe6T\xac)\x94i\xb6\xf9\x14\x8b\x96\xc1\xb0\x80\xa8J\xda\x9f\xea'), chr(100) + chr(8161 - 8060) + chr(9462 - 9363) + '\157' + chr(0b1011100 + 0o10) + '\x65')(chr(3511 - 3394) + chr(116) + chr(102) + chr(45) + chr(2524 - 2468)), dest=xafqLlk3kkUe(SXOLrMavuUCe(b'\xbf\xee\\\x16'), '\144' + chr(0b1100101) + chr(0b1100011) + '\157' + '\x64' + chr(0b1100101))('\165' + chr(0b110011 + 0o101) + '\x66' + chr(1563 - 1518) + chr(0b110111 + 0o1)), default=ehT0Px3KOsy9('\x30' + '\x6f' + chr(48), 8)) xafqLlk3kkUe(uvsdWIii6oeC, xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xebL!\x1c\xb8\xe8M\xa4l\x9co'), chr(100) + chr(0b1100101) + chr(0b1000010 + 0o41) + '\157' + chr(3179 - 3079) + chr(2170 - 2069))(chr(117) + chr(116) + '\146' + chr(0b101100 + 0o1) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2\xf9'), chr(100) + '\145' + chr(2933 - 2834) + chr(12148 - 12037) + chr(100) + '\145')(chr(117) + chr(116) + chr(102) + '\x2d' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2\xa2^\x1b\x0f\xa8\xe0K\xac'), '\144' + chr(0b1001111 + 0o26) + chr(0b1100011) + '\157' + chr(0b1100100) + '\145')(chr(117) + chr(0b1110100) + '\146' + chr(0b101101) + chr(0b111000)), help=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa6\xe1K\x0c\x18\xab\xfc]\xe9f\x87o\xa9\xe1@\xef\xa6\xf1\xe2\x86\xa2O\xda\x88\xf6'), chr(0b1100100) + chr(0b1100101) + chr(5604 - 5505) + chr(0b1100 + 0o143) + '\144' + chr(101))(chr(0b1110101) + '\164' + chr(102) + '\x2d' + '\070'), action=xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xfbG\x0c\x18\x95\xfbJ\xbcl'), chr(0b100000 + 0o104) + chr(3706 - 3605) + chr(99) + chr(111) + chr(3486 - 3386) + '\x65')('\x75' + chr(0b1001000 + 0o54) + chr(0b100100 + 0o102) + '\055' + chr(0b111000)), default=ehT0Px3KOsy9('\x30' + '\157' + chr(0b11111 + 0o21), 8)) kJDRfRhcZHjS = uvsdWIii6oeC.parse_args() zGatWNvpSxwT = kJDRfRhcZHjS.j5jgrsOGZdZ4 if xafqLlk3kkUe(kJDRfRhcZHjS, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3\xe6[\n'), chr(0b1100100) + '\145' + '\143' + chr(111) + chr(350 - 250) + '\x65')(chr(117) + chr(0b1100011 + 0o21) + chr(0b11100 + 0o112) + '\055' + chr(0b10010 + 0o46))): KNC9T0SbAzi6(idVendor=Xzvl11ouE36T, idProduct=nCPF_NoiqhIh) return A5GIpkDsgP4U() if xafqLlk3kkUe(kJDRfRhcZHjS, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2\xee[\r"\xaf\xfdY\xbal'), chr(0b1010110 + 0o16) + chr(0b1100101) + chr(0b101101 + 0o66) + chr(0b1000001 + 0o56) + chr(0b111 + 0o135) + chr(5071 - 4970))(chr(4724 - 4607) + '\164' + '\x66' + chr(0b1001 + 0o44) + chr(56))): zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xee[\r]\xaf\xfdY\xbal\xdc5\xf7'), chr(0b101010 + 0o72) + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(100) + chr(4227 - 4126))('\x75' + chr(116) + chr(0b1100110) + chr(409 - 364) + chr(0b100 + 0o64))) tQJAbeeUOUwH() if xafqLlk3kkUe(kJDRfRhcZHjS, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbf\xee\\\x16'), chr(2225 - 2125) + chr(0b100001 + 0o104) + '\143' + chr(0b1101111) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b101111 + 0o11))): eHXqZodw3nXN = VDMH3OMxbTpl(kJDRfRhcZHjS.path) if not eHXqZodw3nXN: return zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\x98\xfdA\n\x14\xa4\xe8\x18\xa4l\x9ft\xab\xed\x1a\xe1\xfe'), '\x64' + '\145' + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(7988 - 7871) + chr(116) + '\x66' + chr(185 - 140) + '\x38')) cZ_Ihoh9LNnU(eHXqZodw3nXN, xafqLlk3kkUe(kJDRfRhcZHjS, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2\xee[\r"\xaf\xfdY\xbal'), chr(0b1100100) + chr(2605 - 2504) + chr(0b1100011) + chr(5058 - 4947) + chr(0b1001010 + 0o32) + chr(0b1011110 + 0o7))('\x75' + '\164' + chr(102) + chr(0b100010 + 0o13) + '\x38')), progress=nnoYJxU7_kfZ) zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a\xf7A\n\x14\xa4\xe8\x18\x8dO\xa75\xf7\xba'), chr(0b1100100) + chr(101) + chr(99) + '\x6f' + chr(0b101110 + 0o66) + chr(101))('\165' + chr(0b1110100) + chr(10195 - 10093) + '\x2d' + chr(0b100110 + 0o22))) KW1_Bh0y4Prn() return zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\x81\xe0\x08\x1d\x12\xa7\xe2Y\xa7m\xd2h\xa9\xf1W\xa6\xb6\xfd\xf5\x80'), chr(0b111011 + 0o51) + chr(0b100001 + 0o104) + '\x63' + chr(0b1101111) + chr(0b101001 + 0o73) + chr(1897 - 1796))('\x75' + chr(0b1110011 + 0o1) + '\146' + chr(1843 - 1798) + chr(1725 - 1669)))
micropython/micropython
ports/stm32/boards/make-pins.py
parse_port_pin
def parse_port_pin(name_str): """Parses a string and returns a (port-num, pin-num) tuple.""" if len(name_str) < 3: raise ValueError("Expecting pin name to be at least 3 charcters.") if name_str[0] != 'P': raise ValueError("Expecting pin name to start with P") if name_str[1] < 'A' or name_str[1] > 'K': raise ValueError("Expecting pin port to be between A and K") port = ord(name_str[1]) - ord('A') pin_str = name_str[2:] if not pin_str.isdigit(): raise ValueError("Expecting numeric pin number.") return (port, int(pin_str))
python
def parse_port_pin(name_str): """Parses a string and returns a (port-num, pin-num) tuple.""" if len(name_str) < 3: raise ValueError("Expecting pin name to be at least 3 charcters.") if name_str[0] != 'P': raise ValueError("Expecting pin name to start with P") if name_str[1] < 'A' or name_str[1] > 'K': raise ValueError("Expecting pin port to be between A and K") port = ord(name_str[1]) - ord('A') pin_str = name_str[2:] if not pin_str.isdigit(): raise ValueError("Expecting numeric pin number.") return (port, int(pin_str))
[ "def", "parse_port_pin", "(", "name_str", ")", ":", "if", "len", "(", "name_str", ")", "<", "3", ":", "raise", "ValueError", "(", "\"Expecting pin name to be at least 3 charcters.\"", ")", "if", "name_str", "[", "0", "]", "!=", "'P'", ":", "raise", "ValueError", "(", "\"Expecting pin name to start with P\"", ")", "if", "name_str", "[", "1", "]", "<", "'A'", "or", "name_str", "[", "1", "]", ">", "'K'", ":", "raise", "ValueError", "(", "\"Expecting pin port to be between A and K\"", ")", "port", "=", "ord", "(", "name_str", "[", "1", "]", ")", "-", "ord", "(", "'A'", ")", "pin_str", "=", "name_str", "[", "2", ":", "]", "if", "not", "pin_str", ".", "isdigit", "(", ")", ":", "raise", "ValueError", "(", "\"Expecting numeric pin number.\"", ")", "return", "(", "port", ",", "int", "(", "pin_str", ")", ")" ]
Parses a string and returns a (port-num, pin-num) tuple.
[ "Parses", "a", "string", "and", "returns", "a", "(", "port", "-", "num", "pin", "-", "num", ")", "tuple", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/ports/stm32/boards/make-pins.py#L33-L45
train
Parses a string and returns a tuple of port and pin.
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,koC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6mjyZZT,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) + chr(0b1101111) + chr(103 - 54) + '\064' + '\064', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2649 - 2597) + chr(545 - 494), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(2594 - 2483) + '\066' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\x6f' + '\061' + chr(0b110000) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(686 - 638) + '\x6f' + '\063' + chr(0b110101) + chr(0b110100), 34500 - 34492), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(0b110011) + chr(0b1101 + 0o43), 22408 - 22400), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1113 - 1060) + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1010010 + 0o35) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1100011 + 0o14) + chr(0b100011 + 0o20) + chr(53) + chr(1175 - 1120), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b11001 + 0o30) + chr(0b100111 + 0o12) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110110) + chr(0b110111), 65208 - 65200), ehT0Px3KOsy9(chr(626 - 578) + chr(8834 - 8723) + '\061' + chr(48) + chr(224 - 175), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(0b110111) + chr(0b10101 + 0o36), ord("\x08")), ehT0Px3KOsy9('\060' + chr(5105 - 4994) + '\x37' + chr(0b110000 + 0o2), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001110 + 0o41) + chr(0b11010 + 0o30) + '\065' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x34' + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + chr(0b100101 + 0o112) + chr(0b10010 + 0o41) + chr(2049 - 1998) + chr(1195 - 1140), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + '\065' + chr(0b110000), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(54) + chr(0b1000 + 0o55), 15346 - 15338), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10111 + 0o32) + chr(0b110001) + chr(652 - 597), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + '\064' + chr(55), 0o10), ehT0Px3KOsy9(chr(2046 - 1998) + chr(111) + '\x32' + chr(0b100011 + 0o21) + chr(0b1101 + 0o47), 37208 - 37200), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(265 - 216), ord("\x08")), ehT0Px3KOsy9(chr(481 - 433) + chr(0b1101111) + chr(0b110011) + '\066', 58373 - 58365), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1011010 + 0o25) + chr(50) + chr(0b100101 + 0o13) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(0b100111 + 0o15) + chr(114 - 60), 0o10), ehT0Px3KOsy9(chr(1137 - 1089) + chr(0b110100 + 0o73) + chr(0b110011) + chr(0b110101) + '\065', 0o10), ehT0Px3KOsy9(chr(298 - 250) + chr(111) + chr(0b110001) + chr(1130 - 1082) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100011 + 0o24) + '\060', 19271 - 19263), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11111 + 0o23) + chr(0b101111 + 0o3) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(1687 - 1639) + chr(3878 - 3767) + chr(0b110010) + chr(49), 8), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + chr(603 - 552) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1100011 + 0o14) + chr(0b11010 + 0o27) + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(1753 - 1705) + chr(2351 - 2302), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\067' + chr(0b110010), 8), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\x6f' + chr(54) + '\x32', 0o10), ehT0Px3KOsy9(chr(688 - 640) + chr(111) + '\061' + chr(1777 - 1722) + '\x37', 57786 - 57778), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + '\x31' + chr(51) + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1010010 + 0o35) + '\x31' + '\066' + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(0b111000 + 0o67) + chr(49) + '\066' + '\x36', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + '\x35' + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'J'), '\144' + chr(1381 - 1280) + chr(99) + '\x6f' + chr(0b100101 + 0o77) + chr(4969 - 4868))(chr(0b1001100 + 0o51) + chr(6038 - 5922) + '\146' + '\055' + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def IYDPqhuXwlf3(lOIp6cZfqen3): if c2A0yzQpDQB3(lOIp6cZfqen3) < ehT0Px3KOsy9(chr(0b110000) + chr(10254 - 10143) + chr(0b1101 + 0o46), 0b1000): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'![C#\x8f\xecDi\x88jG(\x95\x1a\xc6@\xb2\xcd\xd5;\x08\x84s{\xa4\xc7\x99bT\xf6piy\xe1\t\x12\x1c0\x16\x04\x07WV4\x9f\xb6'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(8121 - 8010) + chr(9237 - 9137) + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(0b1100001 + 0o5) + chr(0b1010 + 0o43) + chr(56))) if lOIp6cZfqen3[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(48), 0o10)] != xafqLlk3kkUe(SXOLrMavuUCe(b'4'), chr(0b1000101 + 0o37) + chr(6150 - 6049) + '\x63' + '\x6f' + chr(100) + chr(1018 - 917))(chr(7215 - 7098) + chr(0b1110100) + '\x66' + chr(0b101101) + '\070'): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'![C#\x8f\xecDi\x88jG(\x95\x1a\xc6@\xb2\xcd\xd5;\x08\x84bj\xe5\xd4\x99bO\xfaer-\x91'), chr(0b1100100) + chr(9723 - 9622) + '\x63' + chr(6948 - 6837) + chr(2081 - 1981) + '\x65')('\165' + '\x74' + '\146' + '\055' + chr(56))) if lOIp6cZfqen3[ehT0Px3KOsy9(chr(718 - 670) + chr(0b1101111) + chr(0b110001), 62041 - 62033)] < xafqLlk3kkUe(SXOLrMavuUCe(b'%'), '\144' + chr(101) + '\x63' + chr(111) + '\x64' + chr(101))('\x75' + '\x74' + chr(2349 - 2247) + chr(848 - 803) + '\070') or lOIp6cZfqen3[ehT0Px3KOsy9('\060' + '\157' + chr(49), 8)] > xafqLlk3kkUe(SXOLrMavuUCe(b'/'), '\x64' + chr(0b110010 + 0o63) + '\143' + '\x6f' + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(0b110000 + 0o66) + '\x2d' + chr(0b10110 + 0o42)): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'![C#\x8f\xecDi\x88jG(\x95\x1a\xd8N\xad\xdc\xd5;\x08\x84s{\xa4\xc4\x886O\xf6tt-\x80\x1aS\x11<W='), chr(100) + chr(101) + chr(7618 - 7519) + chr(0b1101111) + '\x64' + chr(101))(chr(0b1010001 + 0o44) + chr(0b1110100) + chr(0b1011010 + 0o14) + chr(1475 - 1430) + chr(2311 - 2255))) TQTTatUIBQ8y = Jp8aZ6mjyZZT(lOIp6cZfqen3[ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(4212 - 4101) + chr(0b10101 + 0o34), 8)]) - Jp8aZ6mjyZZT(xafqLlk3kkUe(SXOLrMavuUCe(b'%'), chr(3105 - 3005) + chr(101) + '\x63' + '\x6f' + chr(100) + chr(0b1100101))('\x75' + chr(1158 - 1042) + chr(0b10010 + 0o124) + chr(0b1000 + 0o45) + '\x38')) GpkZxDMMzeOO = lOIp6cZfqen3[ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(0b110010), 0o10):] if not xafqLlk3kkUe(GpkZxDMMzeOO, xafqLlk3kkUe(SXOLrMavuUCe(b'\rPW/\x8b\xf1Y'), chr(0b101 + 0o137) + chr(101) + '\x63' + chr(0b1101111) + chr(100) + '\x65')(chr(117) + chr(9719 - 9603) + chr(0b1100110) + chr(45) + chr(0b111000)))(): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'![C#\x8f\xecDi\x88jY4\x96_\xdaH\xbc\x88\x85&\t\x84\x7fk\xe9\xc4\x880\x16'), chr(0b1001011 + 0o31) + '\145' + '\x63' + chr(111) + chr(2894 - 2794) + '\145')(chr(8954 - 8837) + '\x74' + '\146' + '\x2d' + '\x38')) return (TQTTatUIBQ8y, ehT0Px3KOsy9(GpkZxDMMzeOO))
micropython/micropython
ports/stm32/boards/make-pins.py
AlternateFunction.print
def print(self): """Prints the C representation of this AF.""" cond_var = None if self.supported: cond_var = conditional_var('{}{}'.format(self.func, self.fn_num)) print_conditional_if(cond_var) print(' AF', end='') else: print(' //', end='') fn_num = self.fn_num if fn_num is None: fn_num = 0 print('({:2d}, {:8s}, {:2d}, {:10s}, {:8s}), // {:s}'.format(self.idx, self.func, fn_num, self.pin_type, self.ptr(), self.af_str)) print_conditional_endif(cond_var)
python
def print(self): """Prints the C representation of this AF.""" cond_var = None if self.supported: cond_var = conditional_var('{}{}'.format(self.func, self.fn_num)) print_conditional_if(cond_var) print(' AF', end='') else: print(' //', end='') fn_num = self.fn_num if fn_num is None: fn_num = 0 print('({:2d}, {:8s}, {:2d}, {:10s}, {:8s}), // {:s}'.format(self.idx, self.func, fn_num, self.pin_type, self.ptr(), self.af_str)) print_conditional_endif(cond_var)
[ "def", "print", "(", "self", ")", ":", "cond_var", "=", "None", "if", "self", ".", "supported", ":", "cond_var", "=", "conditional_var", "(", "'{}{}'", ".", "format", "(", "self", ".", "func", ",", "self", ".", "fn_num", ")", ")", "print_conditional_if", "(", "cond_var", ")", "print", "(", "' AF'", ",", "end", "=", "''", ")", "else", ":", "print", "(", "' //'", ",", "end", "=", "''", ")", "fn_num", "=", "self", ".", "fn_num", "if", "fn_num", "is", "None", ":", "fn_num", "=", "0", "print", "(", "'({:2d}, {:8s}, {:2d}, {:10s}, {:8s}), // {:s}'", ".", "format", "(", "self", ".", "idx", ",", "self", ".", "func", ",", "fn_num", ",", "self", ".", "pin_type", ",", "self", ".", "ptr", "(", ")", ",", "self", ".", "af_str", ")", ")", "print_conditional_endif", "(", "cond_var", ")" ]
Prints the C representation of this AF.
[ "Prints", "the", "C", "representation", "of", "this", "AF", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/ports/stm32/boards/make-pins.py#L121-L135
train
Prints the C representation of this AF.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o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edError,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(2614 - 2559), 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + chr(50) + chr(1707 - 1652) + chr(0b10101 + 0o42), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100011 + 0o16) + chr(0b110111) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(1503 - 1455) + '\x6f' + '\062' + '\067' + chr(0b11100 + 0o30), ord("\x08")), ehT0Px3KOsy9(chr(1729 - 1681) + '\157' + chr(52) + chr(0b10010 + 0o45), 8077 - 8069), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(111) + chr(49) + '\060' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(2173 - 2125) + '\x6f' + chr(0b110010) + chr(0b111 + 0o52) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\x6f' + chr(0b110010) + chr(0b110111) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11 + 0o60) + chr(1979 - 1929) + chr(550 - 501), 62262 - 62254), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + chr(50) + chr(0b110001) + chr(52), 14420 - 14412), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1010 + 0o145) + chr(0b110001) + chr(55) + chr(1481 - 1428), 15524 - 15516), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(0b110011) + chr(54), 4409 - 4401), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + '\064' + chr(1297 - 1248), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1001111 + 0o40) + chr(0b10011 + 0o44) + chr(0b1100 + 0o51), 10237 - 10229), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + chr(1238 - 1189) + '\061' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9668 - 9557) + chr(0b110100) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(796 - 748) + '\x6f' + chr(0b110001) + chr(0b11 + 0o62) + chr(0b1011 + 0o46), 0o10), ehT0Px3KOsy9(chr(2086 - 2038) + chr(0b101110 + 0o101) + '\x37' + '\x31', 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + '\061' + '\x30' + '\062', 14715 - 14707), ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(0b1 + 0o60) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b100110 + 0o111) + chr(0b110010) + chr(2367 - 2318) + chr(1274 - 1223), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(11609 - 11498) + '\061' + chr(52) + chr(2217 - 2163), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + chr(0b110011) + chr(0b101101 + 0o10) + chr(55), 42334 - 42326), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(0b110111) + chr(0b100100 + 0o14), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b11110 + 0o121) + chr(0b110001) + '\060' + chr(859 - 811), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + '\067' + chr(0b1 + 0o65), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(0b110111) + chr(0b100000 + 0o20), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + '\065' + chr(1455 - 1405), 0b1000), ehT0Px3KOsy9(chr(373 - 325) + chr(0b10 + 0o155) + chr(0b110110) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5160 - 5049) + '\x33' + chr(0b101001 + 0o14), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b11100 + 0o26) + '\x30' + '\064', 50881 - 50873), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(0b110101) + chr(0b100011 + 0o21), 27766 - 27758), ehT0Px3KOsy9(chr(48) + chr(0b1011001 + 0o26) + '\x32', 0o10), ehT0Px3KOsy9(chr(1156 - 1108) + chr(0b1101111) + '\x36' + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(0b1111 + 0o46) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b11101 + 0o24) + '\x36' + chr(2457 - 2405), 34611 - 34603), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(9003 - 8892) + chr(0b110011 + 0o2) + chr(0b100010 + 0o17), 780 - 772), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + chr(51) + chr(0b110101) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(954 - 906) + '\157' + chr(0b110011) + chr(509 - 458) + chr(0b110000), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1101111) + chr(2126 - 2073) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b')'), '\144' + chr(101) + chr(0b1001110 + 0o25) + chr(0b1010011 + 0o34) + chr(832 - 732) + chr(0b110101 + 0o60))(chr(13245 - 13128) + '\164' + chr(0b1001100 + 0o32) + chr(0b101101) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def zLUzGokYBM2Z(oVre8I6UXc3b): mfdn43IECSG3 = None if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b't\xca\x08\xccH2\xfa\xdd\xb5'), chr(0b1100100) + chr(0b1100101) + chr(99) + '\x6f' + chr(0b1100100) + chr(1736 - 1635))(chr(2214 - 2097) + chr(116) + chr(102) + chr(0b101101) + chr(56))): mfdn43IECSG3 = xyanpcS6Tx7B(xafqLlk3kkUe(SXOLrMavuUCe(b'|\xc2\x03\xc1'), '\144' + chr(101) + '\143' + '\x6f' + '\x64' + chr(2626 - 2525))(chr(12397 - 12280) + '\164' + '\x66' + chr(0b1001 + 0o44) + chr(2793 - 2737)).V4roHaS3Ppej(oVre8I6UXc3b.EzOtJ3kbK5x4, oVre8I6UXc3b.fn_num)) JAPkT9PLMexp(mfdn43IECSG3) zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b"'\x9f9\xfa"), chr(0b1011 + 0o131) + chr(101) + chr(0b100010 + 0o101) + chr(0b1101111) + '\144' + '\x65')(chr(117) + chr(0b1101100 + 0o10) + chr(4947 - 4845) + '\055' + chr(0b10001 + 0o47)), end=xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b11111 + 0o105) + chr(0b110100 + 0o61) + chr(0b100010 + 0o101) + chr(111) + '\x64' + chr(0b1100101))('\165' + '\164' + chr(0b1001010 + 0o34) + chr(45) + chr(1321 - 1265))) else: zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b"'\x9fW\x93"), '\144' + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(100) + '\145')(chr(0b11101 + 0o130) + '\164' + '\146' + chr(0b100 + 0o51) + chr(0b10000 + 0o50)), end=xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b100000 + 0o104) + '\145' + '\143' + chr(0b1101111) + chr(0b1100100) + '\145')(chr(117) + '\164' + chr(102) + chr(45) + chr(0b111000))) hy7cXWa6yez2 = oVre8I6UXc3b.fn_num if hy7cXWa6yez2 is None: hy7cXWa6yez2 = ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110000), 985 - 977) zLUzGokYBM2Z(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"/\xc4B\x8eC=\xa2\x98\xaa)\xb4\x0e\xe3M\x1d1\x1e[]?g\xab\x1d\xd5\x89p\r\xc5\xc6\x12f\xbe\x94qI\xc2X\t\xc6\xf7'\xc4B\xcfZ"), chr(0b1100100) + chr(6118 - 6017) + chr(0b100100 + 0o77) + chr(0b101001 + 0o106) + chr(0b1100100) + chr(0b110010 + 0o63))(chr(117) + chr(9657 - 9541) + '\x66' + '\x2d' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'Q\x8b\n\xd3o!\xdd\x8b\x81c\xe9\x17'), '\144' + '\x65' + chr(99) + chr(4415 - 4304) + '\x64' + chr(101))(chr(3626 - 3509) + chr(0b11000 + 0o134) + '\x66' + chr(0b11010 + 0o23) + chr(0b1100 + 0o54)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'^\xd3\t\xc9T\x19\xcc\x8e\x98}\xe70'), '\144' + chr(101) + chr(0b1100011) + '\157' + chr(3037 - 2937) + chr(6226 - 6125))(chr(0b1110 + 0o147) + chr(0b1110100) + '\146' + chr(0b101101) + '\070')), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'B\xc57\xc8ms\xe5\xda\x9a&\xf4I'), chr(284 - 184) + '\x65' + chr(0b1010101 + 0o16) + chr(0b1101111) + chr(100) + '\x65')('\x75' + '\x74' + chr(0b1100110) + chr(0b101101) + chr(0b101010 + 0o16))), hy7cXWa6yez2, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'w\xd6\x16\xe3S9\xfe\xdd'), chr(0b110111 + 0o55) + chr(0b1100101) + chr(1324 - 1225) + '\157' + chr(7195 - 7095) + chr(0b100100 + 0o101))(chr(0b1110101) + chr(0b1100101 + 0o17) + chr(0b1100110) + chr(0b10000 + 0o35) + '\x38')), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'w\xcb\n'), chr(100) + chr(0b1010000 + 0o25) + chr(99) + '\157' + chr(8830 - 8730) + chr(8866 - 8765))(chr(0b1010000 + 0o45) + '\164' + '\146' + chr(45) + chr(0b111000)))(), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b"f\xd9'\xcfS2"), chr(100) + chr(0b1100101) + chr(4910 - 4811) + '\157' + chr(0b1111 + 0o125) + chr(0b1100010 + 0o3))(chr(0b101011 + 0o112) + chr(0b1011010 + 0o32) + '\146' + chr(0b11111 + 0o16) + '\x38')))) z0RjkEkA4Idi(mfdn43IECSG3)
micropython/micropython
ports/cc3200/boards/make-pins.py
parse_port_pin
def parse_port_pin(name_str): """Parses a string and returns a (port, gpio_bit) tuple.""" if len(name_str) < 3: raise ValueError("Expecting pin name to be at least 3 characters") if name_str[:2] != 'GP': raise ValueError("Expecting pin name to start with GP") if not name_str[2:].isdigit(): raise ValueError("Expecting numeric GPIO number") port = int(int(name_str[2:]) / 8) gpio_bit = 1 << int(int(name_str[2:]) % 8) return (port, gpio_bit)
python
def parse_port_pin(name_str): """Parses a string and returns a (port, gpio_bit) tuple.""" if len(name_str) < 3: raise ValueError("Expecting pin name to be at least 3 characters") if name_str[:2] != 'GP': raise ValueError("Expecting pin name to start with GP") if not name_str[2:].isdigit(): raise ValueError("Expecting numeric GPIO number") port = int(int(name_str[2:]) / 8) gpio_bit = 1 << int(int(name_str[2:]) % 8) return (port, gpio_bit)
[ "def", "parse_port_pin", "(", "name_str", ")", ":", "if", "len", "(", "name_str", ")", "<", "3", ":", "raise", "ValueError", "(", "\"Expecting pin name to be at least 3 characters\"", ")", "if", "name_str", "[", ":", "2", "]", "!=", "'GP'", ":", "raise", "ValueError", "(", "\"Expecting pin name to start with GP\"", ")", "if", "not", "name_str", "[", "2", ":", "]", ".", "isdigit", "(", ")", ":", "raise", "ValueError", "(", "\"Expecting numeric GPIO number\"", ")", "port", "=", "int", "(", "int", "(", "name_str", "[", "2", ":", "]", ")", "/", "8", ")", "gpio_bit", "=", "1", "<<", "int", "(", "int", "(", "name_str", "[", "2", ":", "]", ")", "%", "8", ")", "return", "(", "port", ",", "gpio_bit", ")" ]
Parses a string and returns a (port, gpio_bit) tuple.
[ "Parses", "a", "string", "and", "returns", "a", "(", "port", "gpio_bit", ")", "tuple", "." ]
8031b7a25c21fb864fe9dd1fa40740030be66c11
https://github.com/micropython/micropython/blob/8031b7a25c21fb864fe9dd1fa40740030be66c11/ports/cc3200/boards/make-pins.py#L20-L30
train
Parses a string and returns a tuple containing the port and gpio bit.
Pu7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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) + '\x6f' + chr(0b110011) + chr(55) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(2740 - 2685) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1001110 + 0o41) + chr(79 - 29) + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2376 - 2327) + '\063' + chr(334 - 283), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(0b10100 + 0o35) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b10011 + 0o134) + '\x31' + chr(49) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(1033 - 985) + chr(0b1101101 + 0o2) + chr(51) + '\x34' + chr(0b11110 + 0o25), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(0b110000) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + chr(1663 - 1552) + chr(0b110011) + chr(0b11111 + 0o25) + chr(0b110001), 63677 - 63669), ehT0Px3KOsy9(chr(703 - 655) + chr(0b1101111) + chr(0b110010) + chr(0b110001) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b100001 + 0o116) + chr(0b110001) + chr(0b110001 + 0o0) + chr(51), 8), ehT0Px3KOsy9(chr(1871 - 1823) + chr(111) + '\062' + chr(0b110011) + '\x34', 11670 - 11662), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1971 - 1918), 0o10), ehT0Px3KOsy9(chr(544 - 496) + chr(0b1101111) + '\062' + chr(2863 - 2809) + chr(2137 - 2083), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100111 + 0o10) + chr(1097 - 1048) + chr(0b1011 + 0o50) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(7586 - 7475) + chr(49) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(3778 - 3667) + chr(0b110110) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(395 - 347) + chr(111) + chr(49) + chr(54) + chr(1586 - 1534), 25485 - 25477), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(52) + chr(0b1101 + 0o51), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b1 + 0o63), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(11897 - 11786) + chr(1842 - 1792) + '\x37' + chr(1045 - 993), 13316 - 13308), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + '\x34' + chr(0b101101 + 0o5), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101010 + 0o11) + chr(0b101010 + 0o14) + '\x33', 1174 - 1166), ehT0Px3KOsy9('\x30' + '\157' + '\066' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110 + 0o54) + chr(54) + chr(52), 28486 - 28478), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(9757 - 9646) + '\x34' + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + chr(0b10011 + 0o134) + '\063' + chr(0b110000) + chr(0b100100 + 0o21), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(50) + chr(53), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(0b110100) + chr(0b11 + 0o60), 3651 - 3643), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(0b110011) + '\061', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + '\x34' + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1153 - 1103) + '\x33' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b111110 + 0o61) + chr(0b110011) + chr(772 - 718) + chr(1934 - 1885), 39321 - 39313), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + '\065' + '\063', 0o10), ehT0Px3KOsy9('\x30' + chr(0b100000 + 0o117) + '\063' + chr(0b110000) + chr(0b110100), 35434 - 35426), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(3819 - 3708) + chr(0b11100 + 0o30) + chr(1972 - 1923), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x33', 16874 - 16866), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(0b110011) + chr(0b110001 + 0o0) + chr(0b100110 + 0o20), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + '\x31' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\157' + chr(0b11110 + 0o24) + chr(48) + chr(0b110111), 30634 - 30626)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(514 - 466) + chr(9739 - 9628) + chr(688 - 635) + chr(0b11110 + 0o22), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5'), chr(0b1100100) + chr(101) + chr(99) + '\157' + chr(0b1100100) + chr(101))(chr(117) + chr(116) + chr(0b1100110) + chr(45) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def IYDPqhuXwlf3(lOIp6cZfqen3): if c2A0yzQpDQB3(lOIp6cZfqen3) < ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + chr(2348 - 2297), 8): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe\x05g>(:\x8a,\x86\xac;\xf5k\x964kX\x11\x86p\xd3\xc2\x91Q\x94C\xb1u\xcf\xfc\xc6\xed\x85\x8b\xf7\x01`\xa6\xae\xf5\x9a\x1ec>9='), chr(1334 - 1234) + '\145' + chr(0b1010110 + 0o15) + chr(111) + '\x64' + '\145')(chr(117) + chr(0b11011 + 0o131) + chr(0b1100110) + chr(45) + '\x38')) if lOIp6cZfqen3[:ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010), 0o10)] != xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc-'), chr(222 - 122) + chr(0b1100101) + chr(0b111100 + 0o47) + chr(8555 - 8444) + chr(0b1100100) + '\x65')('\x75' + chr(0b110100 + 0o100) + '\x66' + '\x2d' + chr(56)): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe\x05g>(:\x8a,\x86\xac;\xf5k\x964kX\x11\x86p\xd3\xc2\x80@\xd5P\xb1u\xd4\xf0\xd3\xf6\xd1\xec\x94'), chr(0b1100100) + chr(0b100100 + 0o101) + chr(0b110101 + 0o56) + chr(0b1010000 + 0o37) + chr(0b110000 + 0o64) + chr(7458 - 7357))('\165' + chr(0b1110100) + '\146' + chr(956 - 911) + '\x38')) if not xafqLlk3kkUe(lOIp6cZfqen3[ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10 + 0o60), 8):], xafqLlk3kkUe(SXOLrMavuUCe(b"\x92\x0es2,'\x97"), chr(0b1100100) + chr(101) + chr(1955 - 1856) + chr(111) + chr(0b11010 + 0o112) + '\x65')('\165' + '\164' + chr(0b10010 + 0o124) + '\x2d' + '\x38'))(): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe\x05g>(:\x8a,\x86\xac%\xe9h\xd3(cVT\xe1T\xf5\xad\xd3Z\xc1O\xa70\xd1'), '\x64' + chr(101) + chr(3847 - 3748) + '\x6f' + chr(2163 - 2063) + chr(0b1011100 + 0o11))('\165' + chr(0b100011 + 0o121) + chr(0b1010000 + 0o26) + '\x2d' + '\x38')) TQTTatUIBQ8y = ehT0Px3KOsy9(ehT0Px3KOsy9(lOIp6cZfqen3[ehT0Px3KOsy9(chr(1561 - 1513) + '\157' + '\062', 8):]) / ehT0Px3KOsy9(chr(0b110000) + chr(10521 - 10410) + '\x31' + chr(0b100101 + 0o13), 32420 - 32412)) NzDZBwrcxogd = ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49), 21357 - 21349) << ehT0Px3KOsy9(ehT0Px3KOsy9(lOIp6cZfqen3[ehT0Px3KOsy9('\x30' + chr(4811 - 4700) + chr(219 - 169), 8):]) % ehT0Px3KOsy9('\060' + chr(111) + chr(0b11011 + 0o26) + chr(328 - 280), 8)) return (TQTTatUIBQ8y, NzDZBwrcxogd)
onnx/onnx
onnx/backend/base.py
Backend.run_node
def run_node(cls, node, # type: NodeProto inputs, # type: Any device='CPU', # type: Text outputs_info=None, # type: Optional[Sequence[Tuple[numpy.dtype, Tuple[int, ...]]]] **kwargs # type: Dict[Text, Any] ): # type: (...) -> Optional[Tuple[Any, ...]] '''Simple run one operator and return the results. Args: outputs_info: a list of tuples, which contains the element type and shape of each output. First element of the tuple is the dtype, and the second element is the shape. More use case can be found in https://github.com/onnx/onnx/blob/master/onnx/backend/test/runner/__init__.py ''' # TODO Remove Optional from return type if 'opset_version' in kwargs: special_context = c_checker.CheckerContext() special_context.ir_version = IR_VERSION special_context.opset_imports = {'': kwargs['opset_version']} # type: ignore onnx.checker.check_node(node, special_context) else: onnx.checker.check_node(node) return None
python
def run_node(cls, node, # type: NodeProto inputs, # type: Any device='CPU', # type: Text outputs_info=None, # type: Optional[Sequence[Tuple[numpy.dtype, Tuple[int, ...]]]] **kwargs # type: Dict[Text, Any] ): # type: (...) -> Optional[Tuple[Any, ...]] '''Simple run one operator and return the results. Args: outputs_info: a list of tuples, which contains the element type and shape of each output. First element of the tuple is the dtype, and the second element is the shape. More use case can be found in https://github.com/onnx/onnx/blob/master/onnx/backend/test/runner/__init__.py ''' # TODO Remove Optional from return type if 'opset_version' in kwargs: special_context = c_checker.CheckerContext() special_context.ir_version = IR_VERSION special_context.opset_imports = {'': kwargs['opset_version']} # type: ignore onnx.checker.check_node(node, special_context) else: onnx.checker.check_node(node) return None
[ "def", "run_node", "(", "cls", ",", "node", ",", "# type: NodeProto", "inputs", ",", "# type: Any", "device", "=", "'CPU'", ",", "# type: Text", "outputs_info", "=", "None", ",", "# type: Optional[Sequence[Tuple[numpy.dtype, Tuple[int, ...]]]]", "*", "*", "kwargs", "# type: Dict[Text, Any]", ")", ":", "# type: (...) -> Optional[Tuple[Any, ...]]", "# TODO Remove Optional from return type", "if", "'opset_version'", "in", "kwargs", ":", "special_context", "=", "c_checker", ".", "CheckerContext", "(", ")", "special_context", ".", "ir_version", "=", "IR_VERSION", "special_context", ".", "opset_imports", "=", "{", "''", ":", "kwargs", "[", "'opset_version'", "]", "}", "# type: ignore", "onnx", ".", "checker", ".", "check_node", "(", "node", ",", "special_context", ")", "else", ":", "onnx", ".", "checker", ".", "check_node", "(", "node", ")", "return", "None" ]
Simple run one operator and return the results. Args: outputs_info: a list of tuples, which contains the element type and shape of each output. First element of the tuple is the dtype, and the second element is the shape. More use case can be found in https://github.com/onnx/onnx/blob/master/onnx/backend/test/runner/__init__.py
[ "Simple", "run", "one", "operator", "and", "return", "the", "results", ".", "Args", ":", "outputs_info", ":", "a", "list", "of", "tuples", "which", "contains", "the", "element", "type", "and", "shape", "of", "each", "output", ".", "First", "element", "of", "the", "tuple", "is", "the", "dtype", "and", "the", "second", "element", "is", "the", "shape", ".", "More", "use", "case", "can", "be", "found", "in", "https", ":", "//", "github", ".", "com", "/", "onnx", "/", "onnx", "/", "blob", "/", "master", "/", "onnx", "/", "backend", "/", "test", "/", "runner", "/", "__init__", ".", "py" ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/backend/base.py#L89-L111
train
Simple run one operator and return the results.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE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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(0b100 + 0o54) + chr(6450 - 6339) + chr(2083 - 2032) + '\x36' + chr(1210 - 1160), 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + chr(2338 - 2289) + chr(0b1000 + 0o57) + chr(0b101000 + 0o16), ord("\x08")), ehT0Px3KOsy9(chr(1150 - 1102) + chr(0b1101111) + '\x34' + chr(53), 38298 - 38290), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(1534 - 1485) + chr(0b111 + 0o55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + '\066' + chr(0b110 + 0o55), 0o10), ehT0Px3KOsy9(chr(543 - 495) + '\157' + '\x32' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9763 - 9652) + chr(55) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + '\x34' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101111 + 0o4) + chr(2825 - 2771) + chr(0b11100 + 0o27), 0o10), ehT0Px3KOsy9(chr(48) + chr(9005 - 8894) + '\062' + chr(1975 - 1923) + '\060', 40550 - 40542), ehT0Px3KOsy9('\x30' + chr(0b1011100 + 0o23) + '\x32' + '\060' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(111) + chr(1725 - 1671) + '\x34', 0b1000), ehT0Px3KOsy9(chr(1863 - 1815) + '\157' + chr(0b110011) + chr(50) + '\066', 0b1000), ehT0Px3KOsy9(chr(2030 - 1982) + chr(111) + chr(49) + chr(0b110111) + chr(0b11000 + 0o31), 62997 - 62989), ehT0Px3KOsy9('\060' + '\157' + chr(2324 - 2275) + chr(309 - 255), 0o10), ehT0Px3KOsy9('\x30' + chr(2895 - 2784) + chr(1778 - 1728) + chr(668 - 620) + chr(53), 18977 - 18969), ehT0Px3KOsy9('\060' + chr(0b1101001 + 0o6) + '\x32' + '\064' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(0b110000) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(180 - 132) + chr(111) + chr(55) + '\x33', 23937 - 23929), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + '\064' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101001 + 0o6) + chr(0b110001) + chr(1618 - 1567) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7183 - 7072) + chr(0b110010) + chr(0b1000 + 0o57) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(49) + '\063', 50251 - 50243), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(50) + chr(1845 - 1797), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101111 + 0o4) + '\x33' + chr(0b100111 + 0o15), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + '\x32' + chr(51), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1362 - 1312) + chr(50) + '\x37', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11011 + 0o30) + chr(0b110010) + chr(1629 - 1581), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(0b110101) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(129 - 78) + '\062' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(0b110101) + chr(1289 - 1241), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(2880 - 2825) + '\x35', 56036 - 56028), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(111) + chr(0b110100) + chr(0b10000 + 0o40), 0b1000), ehT0Px3KOsy9(chr(48) + chr(8665 - 8554) + '\062' + '\064' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(4253 - 4142) + '\061' + '\x34' + chr(0b101101 + 0o4), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(3785 - 3674) + chr(0b110001 + 0o1) + '\x35' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(100 - 52) + chr(3784 - 3673) + chr(0b110001) + chr(126 - 72) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(915 - 867) + '\157' + '\x32' + chr(0b101100 + 0o12) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + chr(0b1100 + 0o47) + chr(2209 - 2161) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(52) + '\064', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110101) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc'), '\144' + chr(3818 - 3717) + chr(0b1001000 + 0o33) + chr(9348 - 9237) + '\x64' + '\145')(chr(4288 - 4171) + chr(0b0 + 0o164) + chr(0b1100110) + chr(45) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def w4be5ZvHVUQU(NSstowUUZlxS, FDgyextYBrUF, vXoupepMtCXU, v9dZPx26KxBP=xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1.p'), chr(0b1100100) + '\x65' + '\x63' + '\x6f' + '\x64' + '\145')(chr(117) + '\x74' + chr(0b1100110) + '\x2d' + '\070'), hYPvg5ukNKVW=None, **M8EIoTs2GJXE): if xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d\x0eV)\xc7MI\x87\x81\xd3\xea[\xb8'), '\x64' + chr(9220 - 9119) + chr(0b1100011) + chr(10495 - 10384) + chr(2888 - 2788) + chr(0b111011 + 0o52))('\165' + '\164' + chr(8252 - 8150) + chr(504 - 459) + '\x38') in M8EIoTs2GJXE: bq2ZIS40P_WF = Y4tEF0RAoRht.CheckerContext() bq2ZIS40P_WF._R7_43_v3u5f = JVYyBhMuN161 bq2ZIS40P_WF.dw6C6h4YP0QQ = {xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b101001 + 0o73) + '\145' + '\x63' + chr(0b1100010 + 0o15) + chr(0b1010100 + 0o20) + chr(0b1100101))('\165' + '\x74' + chr(8409 - 8307) + chr(0b101101) + chr(0b111000)): M8EIoTs2GJXE[xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d\x0eV)\xc7MI\x87\x81\xd3\xea[\xb8'), chr(100) + '\145' + chr(99) + chr(10314 - 10203) + chr(0b1100100) + '\x65')('\x75' + chr(0b1110100) + '\x66' + chr(0b101100 + 0o1) + '\070')]} xafqLlk3kkUe(xUo9n6RYoMyH.checker, xafqLlk3kkUe(SXOLrMavuUCe(b'\x91\x16@/\xd8MQ\x8d\x97\xc5'), chr(100) + '\145' + '\143' + '\157' + chr(100) + '\145')(chr(117) + '\164' + chr(791 - 689) + '\055' + chr(0b110101 + 0o3)))(FDgyextYBrUF, bq2ZIS40P_WF) else: xafqLlk3kkUe(xUo9n6RYoMyH.checker, xafqLlk3kkUe(SXOLrMavuUCe(b'\x91\x16@/\xd8MQ\x8d\x97\xc5'), chr(9277 - 9177) + '\x65' + '\143' + '\x6f' + '\x64' + '\x65')(chr(0b1110101) + chr(7593 - 7477) + chr(0b1100110) + chr(45) + chr(56)))(FDgyextYBrUF) return None
onnx/onnx
onnx/external_data_helper.py
load_external_data_for_tensor
def load_external_data_for_tensor(tensor, base_dir): # type: (TensorProto, Text) -> None """ Load data from an external file for tensor. @params tensor: a TensorProto object. base_dir: directory that contains the external data. """ if tensor.HasField("raw_data"): # already loaded return info = ExternalDataInfo(tensor) file_location = _sanitize_path(info.location) external_data_file_path = os.path.join(base_dir, file_location) with open(external_data_file_path, 'rb') as data_file: if info.offset: data_file.seek(info.offset) if info.length: tensor.raw_data = data_file.read(info.length) else: tensor.raw_data = data_file.read()
python
def load_external_data_for_tensor(tensor, base_dir): # type: (TensorProto, Text) -> None """ Load data from an external file for tensor. @params tensor: a TensorProto object. base_dir: directory that contains the external data. """ if tensor.HasField("raw_data"): # already loaded return info = ExternalDataInfo(tensor) file_location = _sanitize_path(info.location) external_data_file_path = os.path.join(base_dir, file_location) with open(external_data_file_path, 'rb') as data_file: if info.offset: data_file.seek(info.offset) if info.length: tensor.raw_data = data_file.read(info.length) else: tensor.raw_data = data_file.read()
[ "def", "load_external_data_for_tensor", "(", "tensor", ",", "base_dir", ")", ":", "# type: (TensorProto, Text) -> None", "if", "tensor", ".", "HasField", "(", "\"raw_data\"", ")", ":", "# already loaded", "return", "info", "=", "ExternalDataInfo", "(", "tensor", ")", "file_location", "=", "_sanitize_path", "(", "info", ".", "location", ")", "external_data_file_path", "=", "os", ".", "path", ".", "join", "(", "base_dir", ",", "file_location", ")", "with", "open", "(", "external_data_file_path", ",", "'rb'", ")", "as", "data_file", ":", "if", "info", ".", "offset", ":", "data_file", ".", "seek", "(", "info", ".", "offset", ")", "if", "info", ".", "length", ":", "tensor", ".", "raw_data", "=", "data_file", ".", "read", "(", "info", ".", "length", ")", "else", ":", "tensor", ".", "raw_data", "=", "data_file", ".", "read", "(", ")" ]
Load data from an external file for tensor. @params tensor: a TensorProto object. base_dir: directory that contains the external data.
[ "Load", "data", "from", "an", "external", "file", "for", "tensor", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/external_data_helper.py#L32-L54
train
Loads the raw_data field of the given tensor into the 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,DXjfarvgFn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e,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(0b110001) + '\062' + '\065', 4381 - 4373), ehT0Px3KOsy9('\060' + chr(111) + '\065' + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(1020 - 972) + chr(0b100111 + 0o12), 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\157' + chr(0b110010) + chr(1608 - 1558), 0o10), ehT0Px3KOsy9(chr(1268 - 1220) + chr(0b11111 + 0o120) + chr(50) + '\066', 39988 - 39980), ehT0Px3KOsy9('\x30' + chr(4285 - 4174) + '\065' + '\061', 8), ehT0Px3KOsy9(chr(0b110000) + chr(2983 - 2872) + '\061' + chr(0b11 + 0o61) + chr(51), 65002 - 64994), ehT0Px3KOsy9(chr(0b110000) + chr(7723 - 7612) + chr(1898 - 1847) + chr(0b11110 + 0o31) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(0b110000) + chr(0b101101 + 0o4), 11610 - 11602), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\066' + chr(0b100100 + 0o16), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(896 - 848), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\062' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + chr(2323 - 2274) + chr(1583 - 1531) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(1478 - 1429) + chr(52), 0b1000), ehT0Px3KOsy9(chr(1338 - 1290) + chr(111) + chr(0b11110 + 0o24) + '\061' + '\x34', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(0b11110 + 0o22) + chr(0b0 + 0o61), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x36' + '\065', 22016 - 22008), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\x6f' + chr(0b110011) + chr(0b110111) + '\066', 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\157' + '\x31' + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10000 + 0o42) + '\x31' + chr(0b11110 + 0o24), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(55) + chr(0b1101 + 0o43), 0b1000), ehT0Px3KOsy9('\x30' + chr(125 - 14) + chr(0b10 + 0o57) + chr(54) + '\x30', 41650 - 41642), ehT0Px3KOsy9(chr(48) + chr(3330 - 3219) + '\065' + chr(0b110110), 13724 - 13716), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\067' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(6916 - 6805) + chr(1935 - 1884) + chr(0b110000) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(744 - 696) + chr(705 - 594) + chr(0b110001) + chr(49) + chr(0b100 + 0o63), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + '\x33' + '\061', 1781 - 1773), ehT0Px3KOsy9(chr(377 - 329) + '\157' + chr(1773 - 1722) + '\x37' + '\x34', 8), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(0b11011 + 0o31), 0b1000), ehT0Px3KOsy9(chr(1931 - 1883) + '\x6f' + '\061' + '\064' + chr(0b101111 + 0o3), 0o10), ehT0Px3KOsy9(chr(2001 - 1953) + '\x6f' + chr(49) + chr(0b110000) + chr(59 - 5), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + '\063' + chr(2024 - 1974), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(50) + chr(51), 20536 - 20528), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(846 - 798) + chr(1083 - 1033), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b110111) + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + '\x31' + chr(0b101 + 0o62) + chr(53), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\066' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(395 - 347) + chr(0b11110 + 0o121) + chr(0b110010) + chr(53) + chr(1297 - 1244), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(1280 - 1169) + chr(0b10010 + 0o37) + chr(0b100000 + 0o22), 49223 - 49215)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(9703 - 9592) + chr(2340 - 2287) + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'{'), chr(0b1001 + 0o133) + chr(0b100 + 0o141) + '\x63' + '\x6f' + chr(100) + '\x65')(chr(0b1110101) + chr(0b11011 + 0o131) + '\x66' + '\x2d' + chr(2165 - 2109)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def iGn2iXQJ5H_Q(LK3cpXJU3UM0, tEZltfn1uUbu): if xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1dH\xb2T\x7fL\x0f\x9c'), chr(0b11111 + 0o105) + chr(101) + '\x63' + chr(0b1011110 + 0o21) + chr(0b1010011 + 0o21) + '\145')(chr(0b1000110 + 0o57) + chr(0b111000 + 0o74) + '\146' + chr(475 - 430) + chr(2846 - 2790)))(xafqLlk3kkUe(SXOLrMavuUCe(b"'H\xb6MrH\x17\x99"), chr(0b110100 + 0o60) + chr(562 - 461) + '\x63' + chr(0b101110 + 0o101) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(116) + '\146' + chr(930 - 885) + '\070')): return S7Hxucg7jlZk = wVDXoZurSMM_(LK3cpXJU3UM0) UzmRAaLunPCp = t0bv3EDiyS76(S7Hxucg7jlZk.location) Bw1eCBBu3T8a = oqhJDdMJfuwx.path._oWXztVNnqHF(tEZltfn1uUbu, UzmRAaLunPCp) with _fwkIVCGgtAN(Bw1eCBBu3T8a, xafqLlk3kkUe(SXOLrMavuUCe(b"'K"), '\x64' + chr(101) + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(0b1000011 + 0o42))(chr(0b1110 + 0o147) + '\164' + '\146' + '\055' + chr(0b101000 + 0o20))) as CRm8xD274Xgy: if xafqLlk3kkUe(S7Hxucg7jlZk, xafqLlk3kkUe(SXOLrMavuUCe(b':O\xa7as]'), '\x64' + '\145' + chr(6986 - 6887) + '\157' + chr(100) + '\145')('\x75' + chr(3598 - 3482) + chr(0b1100010 + 0o4) + '\x2d' + '\070')): xafqLlk3kkUe(CRm8xD274Xgy, xafqLlk3kkUe(SXOLrMavuUCe(b'&L\xa4y'), chr(6830 - 6730) + '\x65' + chr(5965 - 5866) + chr(111) + chr(4823 - 4723) + chr(101))(chr(117) + '\164' + chr(0b1100110) + chr(0b1001 + 0o44) + '\x38'))(xafqLlk3kkUe(S7Hxucg7jlZk, xafqLlk3kkUe(SXOLrMavuUCe(b':O\xa7as]'), '\x64' + chr(3301 - 3200) + '\x63' + chr(0b1101111) + chr(0b101001 + 0o73) + chr(7985 - 7884))(chr(117) + chr(0b1110100) + chr(5448 - 5346) + '\055' + '\070'))) if xafqLlk3kkUe(S7Hxucg7jlZk, xafqLlk3kkUe(SXOLrMavuUCe(b'9L\xafubA'), chr(6566 - 6466) + chr(0b1100101) + '\x63' + '\x6f' + '\x64' + '\145')(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b101001 + 0o4) + chr(56))): LK3cpXJU3UM0.LjisoG1znXxU = CRm8xD274Xgy.U6MiWrhuCi2Y(S7Hxucg7jlZk.length) else: LK3cpXJU3UM0.LjisoG1znXxU = CRm8xD274Xgy.U6MiWrhuCi2Y()
onnx/onnx
onnx/external_data_helper.py
load_external_data_for_model
def load_external_data_for_model(model, base_dir): # type: (ModelProto, Text) -> None """ Loads external tensors into model @params model: ModelProto to load external data to base_dir: directory that contains external data """ for tensor in _get_all_tensors(model): if uses_external_data(tensor): load_external_data_for_tensor(tensor, base_dir)
python
def load_external_data_for_model(model, base_dir): # type: (ModelProto, Text) -> None """ Loads external tensors into model @params model: ModelProto to load external data to base_dir: directory that contains external data """ for tensor in _get_all_tensors(model): if uses_external_data(tensor): load_external_data_for_tensor(tensor, base_dir)
[ "def", "load_external_data_for_model", "(", "model", ",", "base_dir", ")", ":", "# type: (ModelProto, Text) -> None", "for", "tensor", "in", "_get_all_tensors", "(", "model", ")", ":", "if", "uses_external_data", "(", "tensor", ")", ":", "load_external_data_for_tensor", "(", "tensor", ",", "base_dir", ")" ]
Loads external tensors into model @params model: ModelProto to load external data to base_dir: directory that contains external data
[ "Loads", "external", "tensors", "into", "model" ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/external_data_helper.py#L57-L67
train
Loads external data for all tensors in the given model into the specified base_dir.
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,TLbJ60djyws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x0Ujaz9UM0,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(0b111 + 0o150) + '\x33' + '\060' + '\x33', 11917 - 11909), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b110010) + chr(0b1000 + 0o52), 25123 - 25115), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b110111) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(93 - 42) + chr(0b1010 + 0o50) + chr(1204 - 1155), ord("\x08")), ehT0Px3KOsy9(chr(409 - 361) + chr(6272 - 6161) + chr(49) + chr(0b100 + 0o57) + chr(0b11101 + 0o32), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(53) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(2298 - 2244) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(589 - 538) + chr(0b110010) + chr(0b110110), 50444 - 50436), ehT0Px3KOsy9('\060' + chr(0b1001110 + 0o41) + '\x33' + '\061' + chr(2395 - 2343), ord("\x08")), ehT0Px3KOsy9(chr(688 - 640) + '\157' + '\064' + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2328 - 2273) + '\x37', 27258 - 27250), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + '\x36' + chr(0b11101 + 0o32), 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b101000 + 0o107) + '\x33' + chr(253 - 204) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(199 - 88) + chr(50) + chr(0b110101 + 0o1) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b110011) + '\060', 55159 - 55151), ehT0Px3KOsy9(chr(0b110000) + chr(1721 - 1610) + chr(0b11111 + 0o22) + chr(343 - 289) + chr(0b10 + 0o64), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(149 - 95) + chr(50), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(855 - 804) + chr(48) + chr(96 - 48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010101 + 0o32) + '\062' + chr(271 - 216) + chr(1961 - 1909), 0b1000), ehT0Px3KOsy9(chr(981 - 933) + '\x6f' + chr(1378 - 1329) + chr(51) + '\064', 58098 - 58090), ehT0Px3KOsy9(chr(48) + chr(11922 - 11811) + chr(51) + '\066' + chr(304 - 256), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1001111 + 0o40) + chr(0b110011) + chr(0b110011) + chr(0b1011 + 0o50), 48497 - 48489), ehT0Px3KOsy9('\060' + chr(111) + '\063' + '\065' + chr(457 - 407), ord("\x08")), ehT0Px3KOsy9('\060' + chr(6788 - 6677) + chr(52) + '\060', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\066' + '\x32', 8), ehT0Px3KOsy9('\060' + chr(0b1011110 + 0o21) + chr(0b110100) + chr(0b110111), 17816 - 17808), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(0b11010 + 0o32) + chr(2175 - 2122), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + '\x32' + chr(1656 - 1605), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(0b110111) + chr(0b110000), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + '\x32' + chr(55), 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1011 + 0o144) + chr(0b101111 + 0o2) + chr(1575 - 1520) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1000101 + 0o52) + chr(0b110101) + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(0b101000 + 0o107) + '\062' + chr(48) + chr(856 - 805), 41883 - 41875), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + '\061' + chr(51) + chr(52), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(0b101101 + 0o4) + '\064', 60792 - 60784), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(53) + chr(0b110100 + 0o1), 0o10), ehT0Px3KOsy9(chr(1994 - 1946) + chr(0b1101111) + chr(1905 - 1854) + chr(50) + '\x37', 8), ehT0Px3KOsy9(chr(48) + chr(0b10011 + 0o134) + chr(0b110011) + chr(0b110001) + '\062', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101110 + 0o1) + chr(49) + chr(0b110001) + '\067', 39555 - 39547)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101111) + chr(0b100110 + 0o17) + chr(0b11001 + 0o27), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xed'), '\x64' + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(8745 - 8645) + '\x65')(chr(117) + chr(0b111000 + 0o74) + chr(0b1100110) + chr(1311 - 1266) + chr(0b110010 + 0o6)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def LiFRxdp7TH5Y(FK0vqzZ5gPN6, tEZltfn1uUbu): for LK3cpXJU3UM0 in ilCwbky0yTag(FK0vqzZ5gPN6): if meZW2DEcyNIE(LK3cpXJU3UM0): iGn2iXQJ5H_Q(LK3cpXJU3UM0, tEZltfn1uUbu)
onnx/onnx
onnx/external_data_helper.py
convert_model_to_external_data
def convert_model_to_external_data(model, all_tensors_to_one_file=True, location=None): # type: (ModelProto, bool, Optional[Text]) -> None """ call to set all tensors as external data. save_model saves all the tensors data as external data after calling this function. @params model: ModelProto to be converted. all_tensors_to_one_file: If true, save all tensors to one external file specified by location. If false, save each tensor to a file named with the tensor name. location: specify the external file that all tensors to save to. If not specified, will use the model name. """ if all_tensors_to_one_file: file_name = Text(uuid.uuid1()) if location: file_name = location for tensor in _get_all_tensors(model): set_external_data(tensor, file_name) else: for tensor in _get_all_tensors(model): set_external_data(tensor, tensor.name)
python
def convert_model_to_external_data(model, all_tensors_to_one_file=True, location=None): # type: (ModelProto, bool, Optional[Text]) -> None """ call to set all tensors as external data. save_model saves all the tensors data as external data after calling this function. @params model: ModelProto to be converted. all_tensors_to_one_file: If true, save all tensors to one external file specified by location. If false, save each tensor to a file named with the tensor name. location: specify the external file that all tensors to save to. If not specified, will use the model name. """ if all_tensors_to_one_file: file_name = Text(uuid.uuid1()) if location: file_name = location for tensor in _get_all_tensors(model): set_external_data(tensor, file_name) else: for tensor in _get_all_tensors(model): set_external_data(tensor, tensor.name)
[ "def", "convert_model_to_external_data", "(", "model", ",", "all_tensors_to_one_file", "=", "True", ",", "location", "=", "None", ")", ":", "# type: (ModelProto, bool, Optional[Text]) -> None", "if", "all_tensors_to_one_file", ":", "file_name", "=", "Text", "(", "uuid", ".", "uuid1", "(", ")", ")", "if", "location", ":", "file_name", "=", "location", "for", "tensor", "in", "_get_all_tensors", "(", "model", ")", ":", "set_external_data", "(", "tensor", ",", "file_name", ")", "else", ":", "for", "tensor", "in", "_get_all_tensors", "(", "model", ")", ":", "set_external_data", "(", "tensor", ",", "tensor", ".", "name", ")" ]
call to set all tensors as external data. save_model saves all the tensors data as external data after calling this function. @params model: ModelProto to be converted. all_tensors_to_one_file: If true, save all tensors to one external file specified by location. If false, save each tensor to a file named with the tensor name. location: specify the external file that all tensors to save to. If not specified, will use the model name.
[ "call", "to", "set", "all", "tensors", "as", "external", "data", ".", "save_model", "saves", "all", "the", "tensors", "data", "as", "external", "data", "after", "calling", "this", "function", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4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E_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(7598 - 7487) + chr(0b110011) + chr(0b110000) + chr(0b10000 + 0o44), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11000 + 0o127) + chr(51) + chr(50) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101100 + 0o103) + '\x33' + chr(0b1 + 0o64) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(111) + chr(49) + chr(2019 - 1968) + '\065', 0b1000), ehT0Px3KOsy9('\x30' + chr(4308 - 4197) + chr(210 - 159) + chr(0b110000) + chr(55), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(0b101011 + 0o14), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(5730 - 5619) + chr(0b110000 + 0o3) + chr(0b110 + 0o60) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10011 + 0o134) + '\x33' + chr(993 - 939) + chr(0b100001 + 0o23), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b0 + 0o63) + '\x37' + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + chr(10942 - 10831) + chr(0b10100 + 0o36) + chr(1257 - 1208) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(1989 - 1941) + '\157' + chr(0b101 + 0o56) + chr(48) + '\x32', 0b1000), ehT0Px3KOsy9(chr(777 - 729) + chr(2684 - 2573) + chr(0b110010) + '\x33' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\157' + chr(0b110010), 25819 - 25811), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(0b110101) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(10282 - 10171) + chr(1486 - 1437) + '\064' + chr(224 - 170), ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + '\062' + chr(0b1 + 0o57) + chr(0b10111 + 0o36), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(7512 - 7401) + chr(0b110110) + chr(0b100010 + 0o21), 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(7047 - 6936) + chr(0b110111) + chr(51), 0b1000), ehT0Px3KOsy9(chr(177 - 129) + chr(111) + '\061' + chr(51) + '\x32', 57205 - 57197), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + '\x30' + chr(2100 - 2049), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101 + 0o62) + '\x32', 0b1000), ehT0Px3KOsy9('\060' + chr(3299 - 3188) + chr(871 - 821) + '\063' + chr(55), 63152 - 63144), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101001 + 0o11) + '\x32' + chr(0b101111 + 0o2), 7044 - 7036), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(0b101101 + 0o5) + chr(54), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(1885 - 1833) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + chr(51) + '\x31' + chr(48), 35398 - 35390), ehT0Px3KOsy9(chr(264 - 216) + chr(0b11010 + 0o125) + chr(0b110010) + '\x31' + chr(53), 43858 - 43850), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + chr(0b110001) + chr(0b100100 + 0o22) + '\061', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(1616 - 1567) + chr(48) + '\066', 0o10), ehT0Px3KOsy9(chr(48) + chr(10140 - 10029) + '\062' + chr(0b100011 + 0o20) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110100) + chr(1031 - 983), 0o10), ehT0Px3KOsy9(chr(722 - 674) + chr(5694 - 5583) + '\061' + chr(50) + chr(1101 - 1051), 37534 - 37526), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1101111) + '\062' + chr(0b110101) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\157' + chr(49) + '\x31' + chr(1965 - 1910), ord("\x08")), ehT0Px3KOsy9('\060' + chr(4327 - 4216) + chr(0b110011) + chr(0b110001) + chr(2110 - 2059), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001 + 0o146) + '\063' + chr(1764 - 1716) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + chr(8596 - 8485) + chr(0b110001) + '\062' + chr(705 - 656), 48479 - 48471), ehT0Px3KOsy9(chr(2098 - 2050) + '\x6f' + chr(203 - 152) + chr(52) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(896 - 843) + chr(2594 - 2541), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1 + 0o61) + '\x35' + '\x37', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x35' + '\060', 5074 - 5066)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xea'), chr(100) + chr(0b1100101) + '\143' + chr(111) + chr(100) + chr(0b1011110 + 0o7))('\165' + '\x74' + chr(102) + chr(0b1111 + 0o36) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def P54d4crsLAsT(FK0vqzZ5gPN6, Jv5tjeqRIKEV=ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + '\x31', 0o10), PmHHUsyAGu0d=None): if Jv5tjeqRIKEV: OK327sCYstzB = q8dtU4b0Qq1O(b1Z61h2jGYCm.uuid1()) if PmHHUsyAGu0d: OK327sCYstzB = PmHHUsyAGu0d for LK3cpXJU3UM0 in ilCwbky0yTag(FK0vqzZ5gPN6): R7v5KKIhHzy1(LK3cpXJU3UM0, OK327sCYstzB) else: for LK3cpXJU3UM0 in ilCwbky0yTag(FK0vqzZ5gPN6): R7v5KKIhHzy1(LK3cpXJU3UM0, xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\x9e\x9b\x17\x95m\xbc\x90\xbf\xed\xa5\xdc'), chr(8980 - 8880) + chr(6605 - 6504) + chr(0b1100011) + chr(111) + chr(6649 - 6549) + '\145')('\165' + '\x74' + chr(102) + chr(45) + '\x38')))
onnx/onnx
onnx/external_data_helper.py
convert_model_from_external_data
def convert_model_from_external_data(model): # type: (ModelProto) -> None """ call to set all tensors data as embedded data. save_model saves all the tensors data as embedded data after calling this function. @params model: ModelProto to be converted. """ for tensor in _get_all_tensors(model): if uses_external_data(tensor): if not tensor.HasField("raw_data"): raise ValueError("raw_data field doesn't exist.") del tensor.external_data[:] tensor.data_location = TensorProto.DEFAULT
python
def convert_model_from_external_data(model): # type: (ModelProto) -> None """ call to set all tensors data as embedded data. save_model saves all the tensors data as embedded data after calling this function. @params model: ModelProto to be converted. """ for tensor in _get_all_tensors(model): if uses_external_data(tensor): if not tensor.HasField("raw_data"): raise ValueError("raw_data field doesn't exist.") del tensor.external_data[:] tensor.data_location = TensorProto.DEFAULT
[ "def", "convert_model_from_external_data", "(", "model", ")", ":", "# type: (ModelProto) -> None", "for", "tensor", "in", "_get_all_tensors", "(", "model", ")", ":", "if", "uses_external_data", "(", "tensor", ")", ":", "if", "not", "tensor", ".", "HasField", "(", "\"raw_data\"", ")", ":", "raise", "ValueError", "(", "\"raw_data field doesn't exist.\"", ")", "del", "tensor", ".", "external_data", "[", ":", "]", "tensor", ".", "data_location", "=", "TensorProto", ".", "DEFAULT" ]
call to set all tensors data as embedded data. save_model saves all the tensors data as embedded data after calling this function. @params model: ModelProto to be converted.
[ "call", "to", "set", "all", "tensors", "data", "as", "embedded", "data", ".", "save_model", "saves", "all", "the", "tensors", "data", "as", "embedded", "data", "after", "calling", "this", "function", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/external_data_helper.py#L114-L125
train
Convert model from external data to internal data.
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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S3dE_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(0b110110 + 0o71) + chr(3006 - 2951) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b1011101 + 0o22) + chr(0b10011 + 0o37) + '\x35' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(12057 - 11946) + chr(283 - 234) + chr(0b1 + 0o64) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(196 - 148) + chr(0b110111 + 0o70) + chr(763 - 714) + chr(1781 - 1728) + chr(238 - 184), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(150 - 100) + '\x34' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(2047 - 1936) + chr(50) + chr(0b0 + 0o63) + '\062', 0b1000), ehT0Px3KOsy9('\x30' + chr(9837 - 9726) + chr(0b110011) + '\x34' + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(0b110000) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(50) + chr(0b100110 + 0o16) + chr(958 - 909), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1001110 + 0o41) + chr(0b110111) + chr(0b10111 + 0o35), 16787 - 16779), ehT0Px3KOsy9(chr(48) + chr(0b1011011 + 0o24) + chr(0b110100) + chr(954 - 904), ord("\x08")), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + '\063' + chr(52) + '\x31', 1389 - 1381), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101011 + 0o7) + chr(0b110101) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10110 + 0o34) + '\063' + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9451 - 9340) + '\x33' + '\x30' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(1094 - 983) + '\063' + chr(0b110110) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1010111 + 0o30) + chr(0b101111 + 0o4) + chr(0b110110) + chr(2536 - 2481), 12271 - 12263), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063', 59130 - 59122), ehT0Px3KOsy9(chr(48) + chr(0b10111 + 0o130) + '\061' + chr(1214 - 1166), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(5038 - 4927) + '\063' + chr(0b110010) + chr(1638 - 1585), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(4019 - 3908) + '\x32' + chr(0b100111 + 0o11) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101100 + 0o6) + '\x34' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + chr(0b110001) + chr(825 - 773) + chr(627 - 579), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010110 + 0o31) + '\062' + '\067' + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(1429 - 1377) + chr(54), 8), ehT0Px3KOsy9(chr(813 - 765) + chr(111) + '\062' + '\x31' + chr(55), 0o10), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(111) + chr(0b110001) + chr(0b110101) + chr(0b1101 + 0o43), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(885 - 835) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1100010 + 0o15) + chr(50) + chr(53) + chr(0b100010 + 0o24), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(8714 - 8603) + '\x33' + chr(0b100000 + 0o20) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(550 - 439) + chr(55), 0b1000), ehT0Px3KOsy9(chr(1646 - 1598) + chr(0b1001100 + 0o43) + chr(801 - 752) + '\x30' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(495 - 444) + chr(52) + '\x31', 8), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(11268 - 11157) + chr(0b100011 + 0o24) + chr(465 - 410), 54595 - 54587), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(111) + chr(0b10101 + 0o35) + chr(54) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(1578 - 1528) + chr(54) + chr(0b110010), 18867 - 18859), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + '\067' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(1031 - 983) + chr(0b1101111) + chr(51) + '\x32' + '\x37', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(645 - 534) + '\x35' + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x10'), chr(0b1100100) + chr(101) + chr(0b1100000 + 0o3) + chr(0b1101111) + chr(7905 - 7805) + '\x65')(chr(117) + chr(0b1110100) + chr(7657 - 7555) + chr(1372 - 1327) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def SgwFOM8vOH3k(FK0vqzZ5gPN6): for LK3cpXJU3UM0 in ilCwbky0yTag(FK0vqzZ5gPN6): if meZW2DEcyNIE(LK3cpXJU3UM0): if not xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b'v\xca\x1bQ\x07\xc7\xf6\x87'), '\144' + chr(101) + chr(7116 - 7017) + '\x6f' + '\144' + chr(101))(chr(117) + chr(921 - 805) + chr(102) + chr(45) + chr(0b101100 + 0o14)))(xafqLlk3kkUe(SXOLrMavuUCe(b'L\xca\x1fH\n\xc3\xee\x82'), chr(7635 - 7535) + '\145' + '\143' + chr(0b11010 + 0o125) + '\x64' + chr(0b10100 + 0o121))(chr(117) + '\x74' + '\x66' + chr(0b100001 + 0o14) + chr(1265 - 1209))): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'L\xca\x1fH\n\xc3\xee\x82\xa0\xc7UG\x8d\xcc\xb9\xa0\x99\x92pf\xf2\xf1\x86\x05\xc6\xcf\xfc\x1c\xbb'), '\144' + '\x65' + chr(99) + '\157' + '\x64' + chr(101))(chr(0b101110 + 0o107) + chr(0b10101 + 0o137) + chr(0b1100110) + chr(885 - 840) + chr(56))) del xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b'[\xd3\x1cr\x1c\xcc\xfb\x8f\xdf\xc5]V\x80'), chr(0b1010111 + 0o15) + chr(0b1100101) + chr(0b100000 + 0o103) + chr(0b1101111) + chr(100) + chr(0b1000101 + 0o40))('\165' + chr(116) + chr(102) + '\x2d' + '\070'))[:] LK3cpXJU3UM0.XuaajyF1cYUm = OQJZWUVbJZfJ.DEFAULT
onnx/onnx
onnx/external_data_helper.py
save_external_data
def save_external_data(tensor, base_path): # type: (TensorProto, Text) -> None """ Write tensor data to an external file according to information in the `external_data` field. @params tensor: Tensor object to be serialized base_path: System path of a folder where tensor data is to be stored """ info = ExternalDataInfo(tensor) external_data_file_path = os.path.join(base_path, info.location) # Retrieve the tensor's data from raw_data or load external file if not tensor.HasField("raw_data"): raise ValueError("raw_data field doesn't exist.") # Create file if it doesn't exist if not os.path.isfile(external_data_file_path): open(external_data_file_path, 'ab').close() # Open file for reading and writing at random locations ('r+b') with open(external_data_file_path, 'r+b') as data_file: data_file.seek(0, 2) if info.offset is not None: # Pad file to required offset if needed file_size = data_file.tell() if info.offset > file_size: data_file.write(b"\0" * (info.offset - file_size)) data_file.seek(info.offset) offset = data_file.tell() data_file.write(tensor.raw_data) set_external_data(tensor, info.location, offset, data_file.tell() - offset)
python
def save_external_data(tensor, base_path): # type: (TensorProto, Text) -> None """ Write tensor data to an external file according to information in the `external_data` field. @params tensor: Tensor object to be serialized base_path: System path of a folder where tensor data is to be stored """ info = ExternalDataInfo(tensor) external_data_file_path = os.path.join(base_path, info.location) # Retrieve the tensor's data from raw_data or load external file if not tensor.HasField("raw_data"): raise ValueError("raw_data field doesn't exist.") # Create file if it doesn't exist if not os.path.isfile(external_data_file_path): open(external_data_file_path, 'ab').close() # Open file for reading and writing at random locations ('r+b') with open(external_data_file_path, 'r+b') as data_file: data_file.seek(0, 2) if info.offset is not None: # Pad file to required offset if needed file_size = data_file.tell() if info.offset > file_size: data_file.write(b"\0" * (info.offset - file_size)) data_file.seek(info.offset) offset = data_file.tell() data_file.write(tensor.raw_data) set_external_data(tensor, info.location, offset, data_file.tell() - offset)
[ "def", "save_external_data", "(", "tensor", ",", "base_path", ")", ":", "# type: (TensorProto, Text) -> None", "info", "=", "ExternalDataInfo", "(", "tensor", ")", "external_data_file_path", "=", "os", ".", "path", ".", "join", "(", "base_path", ",", "info", ".", "location", ")", "# Retrieve the tensor's data from raw_data or load external file", "if", "not", "tensor", ".", "HasField", "(", "\"raw_data\"", ")", ":", "raise", "ValueError", "(", "\"raw_data field doesn't exist.\"", ")", "# Create file if it doesn't exist", "if", "not", "os", ".", "path", ".", "isfile", "(", "external_data_file_path", ")", ":", "open", "(", "external_data_file_path", ",", "'ab'", ")", ".", "close", "(", ")", "# Open file for reading and writing at random locations ('r+b')", "with", "open", "(", "external_data_file_path", ",", "'r+b'", ")", "as", "data_file", ":", "data_file", ".", "seek", "(", "0", ",", "2", ")", "if", "info", ".", "offset", "is", "not", "None", ":", "# Pad file to required offset if needed", "file_size", "=", "data_file", ".", "tell", "(", ")", "if", "info", ".", "offset", ">", "file_size", ":", "data_file", ".", "write", "(", "b\"\\0\"", "*", "(", "info", ".", "offset", "-", "file_size", ")", ")", "data_file", ".", "seek", "(", "info", ".", "offset", ")", "offset", "=", "data_file", ".", "tell", "(", ")", "data_file", ".", "write", "(", "tensor", ".", "raw_data", ")", "set_external_data", "(", "tensor", ",", "info", ".", "location", ",", "offset", ",", "data_file", ".", "tell", "(", ")", "-", "offset", ")" ]
Write tensor data to an external file according to information in the `external_data` field. @params tensor: Tensor object to be serialized base_path: System path of a folder where tensor data is to be stored
[ "Write", "tensor", "data", "to", "an", "external", "file", "according", "to", "information", "in", "the", "external_data", "field", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/external_data_helper.py#L128-L159
train
Writes tensor data to an external file according to information in the external_data field.
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,Iiw8L0MH5q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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(0b1010001 + 0o36) + chr(55) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(0b101000 + 0o10) + chr(0b110000), 42876 - 42868), ehT0Px3KOsy9(chr(48) + chr(2959 - 2848) + '\061' + chr(1670 - 1620) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(1682 - 1634) + chr(0b1000010 + 0o55) + chr(332 - 278), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + '\x33' + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(10104 - 9993) + chr(1133 - 1082) + chr(0b10001 + 0o46) + '\x33', 54870 - 54862), ehT0Px3KOsy9(chr(2228 - 2180) + chr(0b101001 + 0o106) + chr(0b1001 + 0o50) + chr(0b110111) + chr(0b10011 + 0o36), ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(9282 - 9171) + chr(0b110010) + chr(1683 - 1635) + '\067', 46428 - 46420), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(53) + chr(0b100010 + 0o22), ord("\x08")), ehT0Px3KOsy9(chr(1233 - 1185) + '\x6f' + '\062' + '\x33' + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x35' + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1110 + 0o43) + chr(0b1101 + 0o51) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + chr(0b110001) + chr(1603 - 1550) + chr(0b11 + 0o56), 0b1000), ehT0Px3KOsy9('\060' + chr(2107 - 1996) + chr(1377 - 1326) + '\063', 18257 - 18249), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + chr(50) + chr(0b11010 + 0o26) + chr(2066 - 2016), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\063' + chr(0b11111 + 0o21) + '\063', 48798 - 48790), ehT0Px3KOsy9(chr(1182 - 1134) + chr(111) + chr(0b10001 + 0o44), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b1101 + 0o46) + chr(0b10000 + 0o41) + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + '\062' + chr(49), 0o10), ehT0Px3KOsy9('\060' + chr(6371 - 6260) + '\063' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + chr(0b100111 + 0o12) + chr(0b110110) + '\x34', 0o10), ehT0Px3KOsy9(chr(2107 - 2059) + chr(111) + chr(244 - 195) + chr(1352 - 1298) + '\061', 5023 - 5015), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(111) + '\062' + chr(2509 - 2458) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b101101 + 0o102) + chr(0b100110 + 0o14) + '\x37' + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(2327 - 2278) + chr(2194 - 2141) + chr(1140 - 1090), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(0b110000) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(2153 - 2105) + '\x6f' + chr(0b110010) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + '\060' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + chr(49) + chr(0b10011 + 0o43) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(1619 - 1571) + chr(111) + chr(0b10000 + 0o42) + chr(0b111 + 0o57) + chr(2902 - 2848), 0o10), ehT0Px3KOsy9(chr(48) + chr(11108 - 10997) + chr(0b101 + 0o55) + '\064' + chr(0b100011 + 0o24), ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + '\062' + '\067' + '\064', 8), ehT0Px3KOsy9(chr(165 - 117) + chr(111) + chr(50) + chr(53) + '\x36', 11978 - 11970), ehT0Px3KOsy9('\x30' + chr(0b1101001 + 0o6) + '\x37' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(573 - 519) + chr(0b10101 + 0o40), 25219 - 25211), ehT0Px3KOsy9(chr(48) + chr(6228 - 6117) + chr(0b1011 + 0o53) + chr(893 - 839), ord("\x08")), ehT0Px3KOsy9(chr(2038 - 1990) + chr(0b100111 + 0o110) + chr(0b110010) + '\x35' + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\x30' + chr(2054 - 1999), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(50) + chr(0b110000 + 0o7), 29276 - 29268), ehT0Px3KOsy9('\060' + chr(111) + chr(366 - 313) + chr(0b110100), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(53) + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x12'), '\x64' + chr(101) + '\x63' + chr(111) + chr(2956 - 2856) + '\x65')('\x75' + '\164' + chr(0b1100110) + chr(1631 - 1586) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def N4ZKgDE87k13(LK3cpXJU3UM0, KgrmZtb2Du8f): S7Hxucg7jlZk = wVDXoZurSMM_(LK3cpXJU3UM0) Bw1eCBBu3T8a = oqhJDdMJfuwx.path._oWXztVNnqHF(KgrmZtb2Du8f, S7Hxucg7jlZk.location) if not xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b"t!'@\xf1\x9e\x15\xe3"), '\x64' + chr(0b1100101) + chr(0b10010 + 0o121) + chr(0b110110 + 0o71) + chr(8415 - 8315) + chr(0b1100101))('\x75' + chr(7325 - 7209) + '\x66' + chr(45) + chr(1107 - 1051)))(xafqLlk3kkUe(SXOLrMavuUCe(b'N!#Y\xfc\x9a\r\xe6'), chr(0b1100000 + 0o4) + chr(6982 - 6881) + '\x63' + chr(0b1101111) + '\x64' + chr(0b101100 + 0o71))(chr(0b101110 + 0o107) + '\164' + chr(0b1100110) + chr(45) + chr(0b111000))): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'N!#Y\xfc\x9a\r\xe6L\xfcB\x16\x05\x7f\xa2\xa7j\xae"vS\x05\xbf\xd9\x12\xa8`\xf2\\'), '\144' + '\x65' + chr(0b111111 + 0o44) + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(3406 - 3289) + chr(0b1000001 + 0o63) + chr(102) + chr(1822 - 1777) + chr(56))) if not xafqLlk3kkUe(oqhJDdMJfuwx.path, xafqLlk3kkUe(SXOLrMavuUCe(b'U32o\xf4\x9e'), chr(100) + chr(4378 - 4277) + chr(5331 - 5232) + chr(11491 - 11380) + chr(0b1100100) + '\145')(chr(494 - 377) + chr(116) + chr(0b1100110) + chr(1203 - 1158) + chr(0b100011 + 0o25)))(Bw1eCBBu3T8a): xafqLlk3kkUe(_fwkIVCGgtAN(Bw1eCBBu3T8a, xafqLlk3kkUe(SXOLrMavuUCe(b']"'), chr(100) + chr(0b1000100 + 0o41) + chr(0b1110 + 0o125) + chr(111) + chr(100) + chr(101))('\x75' + '\164' + chr(10395 - 10293) + chr(449 - 404) + chr(0b110011 + 0o5))), xafqLlk3kkUe(SXOLrMavuUCe(b'_,;u\xfd'), '\144' + chr(0b1100101) + chr(4601 - 4502) + '\x6f' + chr(0b1011111 + 0o5) + chr(3516 - 3415))(chr(0b1110101 + 0o0) + '\164' + '\146' + '\x2d' + '\070'))() with _fwkIVCGgtAN(Bw1eCBBu3T8a, xafqLlk3kkUe(SXOLrMavuUCe(b'Nk6'), chr(100) + chr(0b0 + 0o145) + '\143' + chr(0b1010110 + 0o31) + '\x64' + '\x65')(chr(0b101 + 0o160) + chr(0b1110100) + '\146' + '\x2d' + chr(0b100010 + 0o26))) as CRm8xD274Xgy: xafqLlk3kkUe(CRm8xD274Xgy, xafqLlk3kkUe(SXOLrMavuUCe(b'O%1m'), chr(8157 - 8057) + chr(7834 - 7733) + chr(6504 - 6405) + chr(111) + chr(5479 - 5379) + chr(0b1100101))(chr(9834 - 9717) + '\164' + '\x66' + '\x2d' + '\x38'))(ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10011 + 0o35), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(50), 57006 - 56998)) if xafqLlk3kkUe(S7Hxucg7jlZk, xafqLlk3kkUe(SXOLrMavuUCe(b'S&2u\xfd\x8f'), '\144' + chr(9507 - 9406) + chr(4819 - 4720) + chr(3785 - 3674) + chr(0b100 + 0o140) + chr(1520 - 1419))('\165' + chr(0b1110100) + '\146' + chr(0b101101) + '\x38')) is not None: EJ21fFXkDNKR = CRm8xD274Xgy.tell() if xafqLlk3kkUe(S7Hxucg7jlZk, xafqLlk3kkUe(SXOLrMavuUCe(b'S&2u\xfd\x8f'), chr(0b1001011 + 0o31) + chr(5655 - 5554) + chr(0b1000010 + 0o41) + '\157' + chr(100) + chr(0b1100101))(chr(0b1000111 + 0o56) + chr(0b1101010 + 0o12) + chr(0b100111 + 0o77) + '\055' + chr(0b101001 + 0o17))) > EJ21fFXkDNKR: xafqLlk3kkUe(CRm8xD274Xgy, xafqLlk3kkUe(SXOLrMavuUCe(b'K2=r\xfd'), '\144' + '\145' + chr(0b111010 + 0o51) + '\x6f' + chr(0b1100100) + '\x65')('\165' + chr(116) + '\146' + chr(1671 - 1626) + chr(56)))(SXOLrMavuUCe(b'<') * (xafqLlk3kkUe(S7Hxucg7jlZk, xafqLlk3kkUe(SXOLrMavuUCe(b'S&2u\xfd\x8f'), '\144' + chr(1467 - 1366) + chr(99) + '\157' + '\144' + '\145')(chr(0b1110101) + chr(0b1100 + 0o150) + chr(0b1000 + 0o136) + chr(528 - 483) + chr(0b100111 + 0o21))) - EJ21fFXkDNKR)) xafqLlk3kkUe(CRm8xD274Xgy, xafqLlk3kkUe(SXOLrMavuUCe(b'O%1m'), chr(0b101110 + 0o66) + chr(0b1100000 + 0o5) + chr(2456 - 2357) + chr(111) + '\144' + chr(0b1100 + 0o131))(chr(117) + chr(116) + chr(102) + chr(45) + chr(0b111000)))(xafqLlk3kkUe(S7Hxucg7jlZk, xafqLlk3kkUe(SXOLrMavuUCe(b'S&2u\xfd\x8f'), '\x64' + chr(101) + chr(0b1100011) + chr(111) + '\144' + chr(0b1100101))('\165' + chr(0b100000 + 0o124) + '\x66' + '\x2d' + chr(56)))) VRaYxwVeIO1g = CRm8xD274Xgy.tell() xafqLlk3kkUe(CRm8xD274Xgy, xafqLlk3kkUe(SXOLrMavuUCe(b'K2=r\xfd'), chr(0b100000 + 0o104) + chr(101) + chr(6744 - 6645) + '\157' + '\x64' + chr(0b11110 + 0o107))(chr(9983 - 9866) + chr(13011 - 12895) + chr(0b1110 + 0o130) + '\x2d' + chr(0b111000)))(xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b'p*=u\xf7\xbcH\xfd\x02\xc2S&'), chr(100) + chr(101) + chr(99) + '\x6f' + chr(2754 - 2654) + chr(0b101110 + 0o67))('\x75' + '\164' + '\146' + chr(45) + chr(56)))) R7v5KKIhHzy1(LK3cpXJU3UM0, xafqLlk3kkUe(S7Hxucg7jlZk, xafqLlk3kkUe(SXOLrMavuUCe(b'P/7g\xec\x92\x16\xe9'), '\x64' + chr(101) + chr(8394 - 8295) + chr(0b1101111) + '\x64' + chr(101))(chr(117) + chr(0b1110100) + '\146' + chr(0b1 + 0o54) + chr(0b1101 + 0o53))), VRaYxwVeIO1g, xafqLlk3kkUe(CRm8xD274Xgy, xafqLlk3kkUe(SXOLrMavuUCe(b'H%8j'), chr(1101 - 1001) + chr(222 - 121) + '\143' + chr(111) + chr(100) + '\x65')(chr(2176 - 2059) + '\164' + '\146' + chr(45) + chr(0b111 + 0o61)))() - VRaYxwVeIO1g)
onnx/onnx
onnx/external_data_helper.py
_get_attribute_tensors
def _get_attribute_tensors(onnx_model_proto): # type: (ModelProto) -> Iterable[TensorProto] """Create an iterator of tensors from node attributes of an ONNX model.""" for node in onnx_model_proto.graph.node: for attribute in node.attribute: if attribute.HasField("t"): yield attribute.t for tensor in attribute.tensors: yield tensor
python
def _get_attribute_tensors(onnx_model_proto): # type: (ModelProto) -> Iterable[TensorProto] """Create an iterator of tensors from node attributes of an ONNX model.""" for node in onnx_model_proto.graph.node: for attribute in node.attribute: if attribute.HasField("t"): yield attribute.t for tensor in attribute.tensors: yield tensor
[ "def", "_get_attribute_tensors", "(", "onnx_model_proto", ")", ":", "# type: (ModelProto) -> Iterable[TensorProto]", "for", "node", "in", "onnx_model_proto", ".", "graph", ".", "node", ":", "for", "attribute", "in", "node", ".", "attribute", ":", "if", "attribute", ".", "HasField", "(", "\"t\"", ")", ":", "yield", "attribute", ".", "t", "for", "tensor", "in", "attribute", ".", "tensors", ":", "yield", "tensor" ]
Create an iterator of tensors from node attributes of an ONNX model.
[ "Create", "an", "iterator", "of", "tensors", "from", "node", "attributes", "of", "an", "ONNX", "model", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/external_data_helper.py#L174-L181
train
Yields the tensors from the node attributes of an ONNX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MA3VWp,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(7914 - 7803) + chr(0b110010) + '\061' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110 + 0o53) + chr(0b110000) + chr(0b101111 + 0o2), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8662 - 8551) + chr(0b110011) + chr(49) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b111000 + 0o67) + '\067' + chr(0b110 + 0o52), 0o10), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\x6f' + '\x32' + chr(51) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(0b11010 + 0o33) + chr(1552 - 1502), 25847 - 25839), ehT0Px3KOsy9(chr(1380 - 1332) + '\x6f' + chr(0b110010) + chr(53) + '\063', 0b1000), ehT0Px3KOsy9(chr(2127 - 2079) + chr(10056 - 9945) + chr(0b101001 + 0o14), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + chr(2921 - 2866) + chr(2077 - 2028), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x35' + chr(54), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b11100 + 0o25) + '\061' + chr(0b110101 + 0o0), 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(111) + chr(0b100010 + 0o17) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(7991 - 7880) + chr(2484 - 2433) + chr(1189 - 1140), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b101110 + 0o101) + chr(50) + chr(0b110010) + '\x30', 0b1000), ehT0Px3KOsy9(chr(329 - 281) + '\x6f' + chr(298 - 247) + chr(53) + chr(1988 - 1938), 0o10), ehT0Px3KOsy9(chr(951 - 903) + '\x6f' + chr(564 - 509) + '\061', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(0b1001 + 0o54) + '\066', 0b1000), ehT0Px3KOsy9(chr(182 - 134) + '\157' + chr(0b10101 + 0o36) + '\x35' + chr(0b101101 + 0o6), 0b1000), ehT0Px3KOsy9(chr(1109 - 1061) + chr(0b1101111) + chr(53) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(111) + '\063' + chr(0b110100), 46290 - 46282), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + chr(52) + chr(0b110010), 44912 - 44904), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(53) + chr(1533 - 1478), 0o10), ehT0Px3KOsy9(chr(2294 - 2246) + chr(111) + chr(0b110011) + chr(55) + chr(49), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\067' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(1144 - 1033) + chr(51) + '\x36' + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11110 + 0o23) + chr(0b1000 + 0o55) + chr(0b11111 + 0o22), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1100 + 0o143) + chr(0b10 + 0o57) + '\x34' + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1290 - 1236) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\157' + '\x33' + '\061' + chr(0b110 + 0o52), 8), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\x6f' + chr(0b101100 + 0o7) + chr(920 - 872) + '\x35', 35553 - 35545), ehT0Px3KOsy9(chr(215 - 167) + '\157' + chr(1112 - 1060) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(9794 - 9683) + '\x33' + chr(0b110010) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2462 - 2412) + chr(2936 - 2881) + chr(0b110000 + 0o7), 38605 - 38597), ehT0Px3KOsy9('\x30' + chr(2657 - 2546) + '\x33' + chr(0b110110) + '\064', 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(6556 - 6445) + chr(0b100 + 0o55) + chr(48) + '\x35', 41593 - 41585), ehT0Px3KOsy9(chr(478 - 430) + chr(0b1101111) + chr(0b11001 + 0o32) + chr(0b110100) + chr(0b10011 + 0o36), 39125 - 39117), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(326 - 278) + chr(365 - 310), ord("\x08")), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + chr(49) + chr(0b110000) + chr(0b1110 + 0o51), 20620 - 20612), ehT0Px3KOsy9(chr(48) + '\157' + '\064' + '\066', 50529 - 50521), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + '\066' + '\066', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1011001 + 0o26) + chr(0b110101) + chr(1211 - 1163), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0'), chr(1405 - 1305) + '\x65' + chr(2361 - 2262) + chr(111) + chr(0b11101 + 0o107) + chr(0b1011 + 0o132))('\165' + '\x74' + chr(0b110110 + 0o60) + '\x2d' + chr(285 - 229)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def mKk18qNsDW6Q(lZ278n1Evxew): for FDgyextYBrUF in xafqLlk3kkUe(lZ278n1Evxew.graph, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8\x05\xafA\xfb\x12\xdf\\{\\\x18O'), chr(0b1100 + 0o130) + chr(101) + chr(0b1100011) + chr(0b11010 + 0o125) + chr(0b1100100) + chr(0b10010 + 0o123))(chr(117) + chr(116) + chr(0b1011000 + 0o16) + '\055' + chr(0b0 + 0o70))): for bwS4NWAfevsZ in xafqLlk3kkUe(FDgyextYBrUF, xafqLlk3kkUe(SXOLrMavuUCe(b'\xef5\xbcJ\xf7\x08\xdeq\\'), chr(0b1001001 + 0o33) + chr(0b1100101) + chr(0b111000 + 0o53) + '\x6f' + chr(0b1001111 + 0o25) + chr(9375 - 9274))(chr(0b1110101) + chr(0b1110100) + chr(0b1010001 + 0o25) + chr(1667 - 1622) + chr(56))): if xafqLlk3kkUe(bwS4NWAfevsZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc6 \xbb~\xf7\x0f\xc7a'), '\x64' + chr(4517 - 4416) + '\143' + chr(0b1101111) + '\144' + chr(0b1100101))(chr(117) + chr(0b101111 + 0o105) + chr(0b1001001 + 0o35) + chr(0b101101) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\157' + chr(1820 - 1720) + '\x65')(chr(0b1110101) + '\164' + chr(0b1100110) + chr(45) + '\070')): yield xafqLlk3kkUe(bwS4NWAfevsZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa'), chr(8615 - 8515) + chr(101) + '\143' + '\x6f' + chr(6485 - 6385) + chr(2134 - 2033))(chr(0b101111 + 0o106) + chr(116) + chr(5822 - 5720) + '\x2d' + chr(0b11 + 0o65))) for LK3cpXJU3UM0 in xafqLlk3kkUe(bwS4NWAfevsZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xda8\xb1\x0c\xec\t\xc3`\x01\x1f)^'), chr(0b1100100) + chr(101) + '\143' + chr(0b1101111) + '\x64' + chr(2274 - 2173))(chr(0b1110101) + chr(5074 - 4958) + chr(0b11100 + 0o112) + chr(45) + chr(0b111000))): yield LK3cpXJU3UM0
onnx/onnx
onnx/external_data_helper.py
remove_external_data_field
def remove_external_data_field(tensor, field_key): # type: (TensorProto, Text) -> None """ Remove a field from a Tensor's external_data key-value store. Modifies tensor object in place. @params tensor: Tensor object from which value will be removed field_key: The key of the field to be removed """ for (i, field) in enumerate(tensor.external_data): if field.key == field_key: del tensor.external_data[i]
python
def remove_external_data_field(tensor, field_key): # type: (TensorProto, Text) -> None """ Remove a field from a Tensor's external_data key-value store. Modifies tensor object in place. @params tensor: Tensor object from which value will be removed field_key: The key of the field to be removed """ for (i, field) in enumerate(tensor.external_data): if field.key == field_key: del tensor.external_data[i]
[ "def", "remove_external_data_field", "(", "tensor", ",", "field_key", ")", ":", "# type: (TensorProto, Text) -> None", "for", "(", "i", ",", "field", ")", "in", "enumerate", "(", "tensor", ".", "external_data", ")", ":", "if", "field", ".", "key", "==", "field_key", ":", "del", "tensor", ".", "external_data", "[", "i", "]" ]
Remove a field from a Tensor's external_data key-value store. Modifies tensor object in place. @params tensor: Tensor object from which value will be removed field_key: The key of the field to be removed
[ "Remove", "a", "field", "from", "a", "Tensor", "s", "external_data", "key", "-", "value", "store", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/external_data_helper.py#L197-L209
train
Removes a field from a Tensor s external_data key - value store.
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,OTstrxJf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4lf,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' + '\063' + '\066' + chr(0b101010 + 0o6), ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(8745 - 8634) + chr(0b110011) + chr(1216 - 1168) + chr(48), 0b1000), ehT0Px3KOsy9(chr(733 - 685) + '\x6f' + chr(0b101000 + 0o17) + chr(1584 - 1529), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011101 + 0o22) + '\061' + '\060' + chr(1901 - 1847), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2507 - 2453) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(207 - 157) + chr(0b110011) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1101111) + chr(0b110001) + chr(0b110011) + chr(55), 32963 - 32955), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11 + 0o60) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1731 - 1680) + '\066' + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(50) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(1067 - 1019) + chr(0b1101001 + 0o6) + chr(0b1111 + 0o43) + '\066' + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(51) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(1466 - 1416) + chr(0b110011) + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(55) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b11011 + 0o124) + chr(0b110001) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(50), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11101 + 0o25) + chr(1848 - 1797) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(1405 - 1357) + chr(0b1101111) + chr(50) + chr(0b1111 + 0o50) + '\x33', 17547 - 17539), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\x6f' + chr(1597 - 1548) + '\x36' + '\063', 51002 - 50994), ehT0Px3KOsy9('\060' + chr(0b11001 + 0o126) + chr(0b110010) + chr(0b1000 + 0o52) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b111000 + 0o67) + '\x31' + chr(1824 - 1772) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2216 - 2167) + chr(48) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b111111 + 0o60) + '\x34' + chr(558 - 508), 0o10), ehT0Px3KOsy9(chr(1128 - 1080) + chr(0b1011001 + 0o26) + chr(0b110010 + 0o0) + chr(0b1111 + 0o44) + chr(535 - 486), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + chr(2274 - 2224) + '\x36' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000100 + 0o53) + chr(1231 - 1181) + chr(48) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x37' + chr(1586 - 1533), 29223 - 29215), ehT0Px3KOsy9('\060' + '\157' + chr(0b1011 + 0o46) + chr(0b11010 + 0o35) + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1101 + 0o46) + chr(55) + chr(0b110111), 25400 - 25392), ehT0Px3KOsy9('\x30' + chr(308 - 197) + chr(0b11110 + 0o25) + '\067' + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(598 - 545) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1100 + 0o143) + chr(0b100010 + 0o21) + chr(1563 - 1513) + chr(53), 0b1000), ehT0Px3KOsy9(chr(68 - 20) + chr(111) + chr(0b111 + 0o54) + chr(536 - 485) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(2291 - 2243) + '\157' + chr(0b110010) + '\062' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + chr(0b11001 + 0o31) + '\x32' + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1001110 + 0o41) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(2254 - 2206) + chr(9408 - 9297) + chr(0b101111 + 0o3) + '\060' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(990 - 938) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + '\x32' + chr(1036 - 985) + '\065', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\065' + chr(48), 25722 - 25714)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xde'), chr(0b1100100) + chr(0b1100101) + chr(5332 - 5233) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(3600 - 3483) + '\164' + chr(0b11101 + 0o111) + chr(0b101101) + chr(694 - 638)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def tkNgtupDesku(LK3cpXJU3UM0, bKsbg81ppmA6): for (WVxHKyX45z_L, fEcfxx4smAdS) in YlkZvXL8qwsX(xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b'\x95\xb8K#@\xf1c3G\x915\xc3\xfa'), chr(7591 - 7491) + chr(4195 - 4094) + chr(4583 - 4484) + chr(0b1001101 + 0o42) + chr(0b10100 + 0o120) + chr(9886 - 9785))(chr(117) + '\x74' + chr(4168 - 4066) + chr(592 - 547) + '\070'))): if xafqLlk3kkUe(fEcfxx4smAdS, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b\xa5F'), chr(0b110001 + 0o63) + '\x65' + chr(0b1100011) + '\157' + '\144' + chr(101))(chr(0b1110101) + '\164' + '\x66' + chr(0b101101) + chr(543 - 487))) == bKsbg81ppmA6: del xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b'\x95\xb8K#@\xf1c3G\x915\xc3\xfa'), chr(100) + '\x65' + chr(0b1100011) + chr(0b1000010 + 0o55) + chr(100) + chr(101))('\165' + chr(0b11111 + 0o125) + chr(0b1100110) + chr(1131 - 1086) + chr(1784 - 1728)))[WVxHKyX45z_L]
onnx/onnx
onnx/external_data_helper.py
write_external_data_tensors
def write_external_data_tensors(model, filepath): # type: (ModelProto, Text) -> ModelProto """ Write external data of all tensors to files on disk. Note: This function also strips basepath information from all tensors' external_data fields. @params model: Model object which is the source of tensors to serialize. filepath: System path to the directory which should be treated as base path for external data. @return The modified model object. """ for tensor in _get_all_tensors(model): if uses_external_data(tensor): save_external_data(tensor, filepath) tensor.ClearField(str('raw_data')) return model
python
def write_external_data_tensors(model, filepath): # type: (ModelProto, Text) -> ModelProto """ Write external data of all tensors to files on disk. Note: This function also strips basepath information from all tensors' external_data fields. @params model: Model object which is the source of tensors to serialize. filepath: System path to the directory which should be treated as base path for external data. @return The modified model object. """ for tensor in _get_all_tensors(model): if uses_external_data(tensor): save_external_data(tensor, filepath) tensor.ClearField(str('raw_data')) return model
[ "def", "write_external_data_tensors", "(", "model", ",", "filepath", ")", ":", "# type: (ModelProto, Text) -> ModelProto", "for", "tensor", "in", "_get_all_tensors", "(", "model", ")", ":", "if", "uses_external_data", "(", "tensor", ")", ":", "save_external_data", "(", "tensor", ",", "filepath", ")", "tensor", ".", "ClearField", "(", "str", "(", "'raw_data'", ")", ")", "return", "model" ]
Write external data of all tensors to files on disk. Note: This function also strips basepath information from all tensors' external_data fields. @params model: Model object which is the source of tensors to serialize. filepath: System path to the directory which should be treated as base path for external data. @return The modified model object.
[ "Write", "external", "data", "of", "all", "tensors", "to", "files", "on", "disk", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/external_data_helper.py#L212-L230
train
Writes external data of all tensors to files on disk.
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,sbc9gub6L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3KOsy9,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) + '\x31' + '\x33' + '\067', 11026 - 11018), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1475 - 1426) + '\066' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + chr(10011 - 9900) + chr(853 - 802) + chr(996 - 945) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(52) + '\x33', 62851 - 62843), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(48) + '\066', 18830 - 18822), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + '\x31' + chr(2390 - 2340) + chr(0b110001), 5020 - 5012), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(7682 - 7571) + chr(0b110001) + chr(50) + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + '\x34' + chr(1357 - 1302), 0o10), ehT0Px3KOsy9(chr(74 - 26) + '\x6f' + '\x33' + chr(53) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b10101 + 0o132) + '\x35' + chr(1160 - 1109), 0b1000), ehT0Px3KOsy9('\060' + chr(9713 - 9602) + chr(491 - 442) + chr(0b110001) + '\065', 0o10), ehT0Px3KOsy9('\x30' + chr(0b100011 + 0o114) + chr(0b110010) + chr(50) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b11101 + 0o122) + chr(0b110011) + '\061' + chr(1934 - 1879), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + '\x32' + chr(0b10000 + 0o44), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(1732 - 1677) + chr(0b11001 + 0o36), 10125 - 10117), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1010101 + 0o32) + chr(0b110010) + '\x30' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b111110 + 0o61) + chr(0b110011) + '\063' + chr(0b110010), 57784 - 57776), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + chr(0b100010 + 0o23) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1892 - 1842) + chr(1470 - 1417) + '\063', 61278 - 61270), ehT0Px3KOsy9(chr(0b110000) + chr(11902 - 11791) + '\063' + '\x32' + chr(2312 - 2263), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b110110 + 0o71) + chr(49) + chr(1239 - 1189) + chr(0b100000 + 0o22), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(2360 - 2311) + chr(48) + '\065', 58644 - 58636), ehT0Px3KOsy9(chr(1639 - 1591) + chr(3857 - 3746) + chr(0b101011 + 0o10) + chr(0b10001 + 0o41), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\060', 11475 - 11467), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + '\061' + '\067' + '\061', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100001 + 0o21) + chr(0b110011) + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b110110 + 0o71) + chr(51) + '\x37' + chr(0b110110), 40141 - 40133), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(0b110001 + 0o5) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(0b110100) + chr(0b110100), 8425 - 8417), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + '\066' + chr(0b10011 + 0o40), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + '\062' + chr(0b101100 + 0o12), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(55) + chr(0b100111 + 0o15), 0b1000), ehT0Px3KOsy9('\060' + chr(2716 - 2605) + '\061' + chr(48) + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(8937 - 8826) + chr(2267 - 2218) + '\062' + chr(0b10111 + 0o32), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110111) + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100001 + 0o24) + chr(120 - 67), 33319 - 33311), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(111) + chr(53) + chr(1479 - 1430), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(761 - 650) + chr(0b10011 + 0o37) + '\x33' + '\x31', 25764 - 25756), ehT0Px3KOsy9(chr(48) + chr(0b1110 + 0o141) + '\062' + chr(0b111 + 0o55) + '\067', 0o10), ehT0Px3KOsy9('\060' + chr(2744 - 2633) + '\x32' + chr(50), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + chr(1732 - 1679) + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'q'), '\x64' + chr(0b11110 + 0o107) + chr(99) + chr(0b1101111) + chr(100) + chr(0b1011110 + 0o7))(chr(117) + chr(0b1101001 + 0o13) + chr(2616 - 2514) + '\x2d' + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Sy1z19CnsoeF(FK0vqzZ5gPN6, D3zslhgxMHWQ): for LK3cpXJU3UM0 in ilCwbky0yTag(FK0vqzZ5gPN6): if meZW2DEcyNIE(LK3cpXJU3UM0): N4ZKgDE87k13(LK3cpXJU3UM0, D3zslhgxMHWQ) xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1c\x18\xb9B\xb4\x17:\x82\x86O'), chr(100) + chr(4543 - 4442) + '\x63' + chr(0b1010000 + 0o37) + chr(100) + chr(4391 - 4290))(chr(0b1001000 + 0o55) + chr(10196 - 10080) + '\146' + '\055' + chr(0b111000)))(M8_cKLkHVB2V(xafqLlk3kkUe(SXOLrMavuUCe(b"-\x15\xab|\xa20'\x86"), '\x64' + chr(0b1000001 + 0o44) + chr(1197 - 1098) + '\x6f' + chr(9377 - 9277) + '\145')('\x75' + '\164' + chr(102) + chr(0b100110 + 0o7) + '\x38'))) return FK0vqzZ5gPN6
onnx/onnx
tools/protoc-gen-mypy.py
PkgWriter._import
def _import(self, path, name): # type: (Text, Text) -> Text """Imports a stdlib path and returns a handle to it eg. self._import("typing", "Optional") -> "Optional" """ imp = path.replace('/', '.') self.imports[imp].add(name) return name
python
def _import(self, path, name): # type: (Text, Text) -> Text """Imports a stdlib path and returns a handle to it eg. self._import("typing", "Optional") -> "Optional" """ imp = path.replace('/', '.') self.imports[imp].add(name) return name
[ "def", "_import", "(", "self", ",", "path", ",", "name", ")", ":", "# type: (Text, Text) -> Text", "imp", "=", "path", ".", "replace", "(", "'/'", ",", "'.'", ")", "self", ".", "imports", "[", "imp", "]", ".", "add", "(", "name", ")", "return", "name" ]
Imports a stdlib path and returns a handle to it eg. self._import("typing", "Optional") -> "Optional"
[ "Imports", "a", "stdlib", "path", "and", "returns", "a", "handle", "to", "it", "eg", ".", "self", ".", "_import", "(", "typing", "Optional", ")", "-", ">", "Optional" ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/tools/protoc-gen-mypy.py#L74-L81
train
Imports a stdlib path and returns a handle to it eg. self. imports [ path ] = name
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,NE1Y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7R_,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' + '\063' + '\063' + chr(0b10100 + 0o41), 0b1000), ehT0Px3KOsy9(chr(1261 - 1213) + '\x6f' + chr(49) + '\x30' + '\x30', 49988 - 49980), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101010 + 0o7) + chr(0b110111) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b110010) + chr(1254 - 1199), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1183 - 1131) + chr(162 - 111), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + '\062' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(9727 - 9616) + chr(50) + '\x36' + chr(50), 23142 - 23134), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + '\062' + '\x37', 0b1000), ehT0Px3KOsy9(chr(1965 - 1917) + '\x6f' + '\x32' + chr(49) + '\065', 15797 - 15789), ehT0Px3KOsy9('\060' + chr(111) + '\x36' + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(2039 - 1928) + chr(49) + '\067' + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\x6f' + '\x32' + chr(0b110110) + chr(54), 0o10), ehT0Px3KOsy9(chr(81 - 33) + chr(0b1101111) + chr(49) + chr(0b1111 + 0o47), 0o10), ehT0Px3KOsy9('\x30' + chr(6670 - 6559) + chr(0b110011) + chr(50) + chr(0b100101 + 0o21), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9836 - 9725) + '\063' + '\063' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(355 - 244) + '\061' + '\x31' + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x36' + chr(1377 - 1329), 10783 - 10775), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(0b111 + 0o57) + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(0b110011 + 0o74) + chr(0b110011) + chr(0b1011 + 0o50) + chr(0b1001 + 0o50), 0b1000), ehT0Px3KOsy9('\x30' + chr(6556 - 6445) + chr(0b110001) + chr(666 - 616) + chr(0b101110 + 0o10), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1771 - 1719) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1011 + 0o144) + '\x32' + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + '\x34' + '\067', 2482 - 2474), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + '\x35', 62969 - 62961), ehT0Px3KOsy9('\060' + chr(111) + chr(0b10000 + 0o43) + '\x36' + '\064', 15144 - 15136), ehT0Px3KOsy9(chr(48) + chr(0b1101011 + 0o4) + chr(53) + '\062', 0b1000), ehT0Px3KOsy9(chr(1059 - 1011) + '\x6f' + chr(0b100001 + 0o20) + '\x33' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + chr(51) + '\061' + '\065', 36373 - 36365), ehT0Px3KOsy9(chr(549 - 501) + chr(8206 - 8095) + chr(0b11111 + 0o25) + chr(0b110001), 25000 - 24992), ehT0Px3KOsy9('\x30' + chr(7773 - 7662) + chr(386 - 335) + chr(51) + chr(0b110001), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110110) + chr(1871 - 1823), 8), ehT0Px3KOsy9('\x30' + chr(0b100111 + 0o110) + chr(2363 - 2312) + chr(50) + '\061', 0b1000), ehT0Px3KOsy9(chr(2060 - 2012) + '\157' + chr(0b101101 + 0o5) + chr(0b1100 + 0o45) + chr(53), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1011 + 0o54), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(2054 - 2004) + chr(0b11001 + 0o33), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110101) + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + chr(8872 - 8761) + chr(50) + chr(1007 - 958) + chr(0b11100 + 0o25), 0b1000), ehT0Px3KOsy9(chr(1672 - 1624) + chr(10718 - 10607) + '\x31' + '\065' + chr(54), 44791 - 44783), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(7516 - 7405) + '\062' + '\x36' + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(640 - 591) + '\x35' + chr(0b1001 + 0o50), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1448 - 1395) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3'), chr(100) + chr(101) + chr(0b1100011) + chr(5759 - 5648) + '\144' + chr(101))('\165' + chr(6694 - 6578) + '\146' + chr(0b101101) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def MmO60g2pStN8(oVre8I6UXc3b, EaCjyhZptSer, AIvJRzLdDfgF): NrZWEgp7SU9j = EaCjyhZptSer.replace(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf2'), '\144' + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(5863 - 5763) + chr(6457 - 6356))(chr(0b101 + 0o160) + chr(0b1110100) + chr(0b10 + 0o144) + chr(0b101101) + chr(2295 - 2239)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3'), '\144' + chr(0b11001 + 0o114) + chr(0b1100011) + chr(2245 - 2134) + '\x64' + chr(101))(chr(117) + chr(116) + chr(102) + chr(502 - 457) + chr(56))) xafqLlk3kkUe(oVre8I6UXc3b.imports[NrZWEgp7SU9j], xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8\nN&\x1a\xf7\xf5\xa2\xd7y+\x85'), '\144' + chr(101) + chr(99) + chr(3544 - 3433) + chr(0b1100100) + chr(0b111 + 0o136))('\165' + chr(0b100010 + 0o122) + chr(0b1100110 + 0o0) + chr(511 - 466) + chr(56)))(AIvJRzLdDfgF) return AIvJRzLdDfgF
onnx/onnx
tools/protoc-gen-mypy.py
PkgWriter._import_message
def _import_message(self, type_name): # type: (d.FieldDescriptorProto) -> Text """Import a referenced message and return a handle""" name = cast(Text, type_name) if name[0] == '.' and name[1].isupper() and name[2].islower(): # Message defined in this file return name[1:] message_fd = self.descriptors.message_to_fd[name] if message_fd.name == self.fd.name: # message defined in this package split = name.split('.') for i, segment in enumerate(split): if segment and segment[0].isupper() and segment[1].islower(): return ".".join(split[i:]) # Not in package. Must import split = name.split(".") for i, segment in enumerate(split): if segment and segment[0].isupper() and segment[1].islower(): assert message_fd.name.endswith('.proto') import_name = self._import(message_fd.name[:-6].replace('-', '_') + "_pb2", segment) remains = ".".join(split[i + 1:]) if not remains: return import_name raise AssertionError("Don't support nested imports yet") # return new_nested_import(import_name, remains) raise AssertionError("Could not parse local name " + name)
python
def _import_message(self, type_name): # type: (d.FieldDescriptorProto) -> Text """Import a referenced message and return a handle""" name = cast(Text, type_name) if name[0] == '.' and name[1].isupper() and name[2].islower(): # Message defined in this file return name[1:] message_fd = self.descriptors.message_to_fd[name] if message_fd.name == self.fd.name: # message defined in this package split = name.split('.') for i, segment in enumerate(split): if segment and segment[0].isupper() and segment[1].islower(): return ".".join(split[i:]) # Not in package. Must import split = name.split(".") for i, segment in enumerate(split): if segment and segment[0].isupper() and segment[1].islower(): assert message_fd.name.endswith('.proto') import_name = self._import(message_fd.name[:-6].replace('-', '_') + "_pb2", segment) remains = ".".join(split[i + 1:]) if not remains: return import_name raise AssertionError("Don't support nested imports yet") # return new_nested_import(import_name, remains) raise AssertionError("Could not parse local name " + name)
[ "def", "_import_message", "(", "self", ",", "type_name", ")", ":", "# type: (d.FieldDescriptorProto) -> Text", "name", "=", "cast", "(", "Text", ",", "type_name", ")", "if", "name", "[", "0", "]", "==", "'.'", "and", "name", "[", "1", "]", ".", "isupper", "(", ")", "and", "name", "[", "2", "]", ".", "islower", "(", ")", ":", "# Message defined in this file", "return", "name", "[", "1", ":", "]", "message_fd", "=", "self", ".", "descriptors", ".", "message_to_fd", "[", "name", "]", "if", "message_fd", ".", "name", "==", "self", ".", "fd", ".", "name", ":", "# message defined in this package", "split", "=", "name", ".", "split", "(", "'.'", ")", "for", "i", ",", "segment", "in", "enumerate", "(", "split", ")", ":", "if", "segment", "and", "segment", "[", "0", "]", ".", "isupper", "(", ")", "and", "segment", "[", "1", "]", ".", "islower", "(", ")", ":", "return", "\".\"", ".", "join", "(", "split", "[", "i", ":", "]", ")", "# Not in package. Must import", "split", "=", "name", ".", "split", "(", "\".\"", ")", "for", "i", ",", "segment", "in", "enumerate", "(", "split", ")", ":", "if", "segment", "and", "segment", "[", "0", "]", ".", "isupper", "(", ")", "and", "segment", "[", "1", "]", ".", "islower", "(", ")", ":", "assert", "message_fd", ".", "name", ".", "endswith", "(", "'.proto'", ")", "import_name", "=", "self", ".", "_import", "(", "message_fd", ".", "name", "[", ":", "-", "6", "]", ".", "replace", "(", "'-'", ",", "'_'", ")", "+", "\"_pb2\"", ",", "segment", ")", "remains", "=", "\".\"", ".", "join", "(", "split", "[", "i", "+", "1", ":", "]", ")", "if", "not", "remains", ":", "return", "import_name", "raise", "AssertionError", "(", "\"Don't support nested imports yet\"", ")", "# return new_nested_import(import_name, remains)", "raise", "AssertionError", "(", "\"Could not parse local name \"", "+", "name", ")" ]
Import a referenced message and return a handle
[ "Import", "a", "referenced", "message", "and", "return", "a", "handle" ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7d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6HRbn,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(0b111 + 0o51) + '\x6f' + chr(0b101000 + 0o13) + chr(0b110101) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(1092 - 981) + '\x33' + chr(51) + '\067', 0o10), ehT0Px3KOsy9(chr(1684 - 1636) + '\157' + chr(0b110110) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(2663 - 2609) + chr(893 - 838), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + '\x34' + chr(788 - 740), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\061' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + '\x32' + '\065', 0o10), ehT0Px3KOsy9(chr(892 - 844) + '\x6f' + chr(0b110010) + '\063' + chr(0b100111 + 0o16), 59316 - 59308), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(0b1000 + 0o52) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + '\x36' + chr(0b1110 + 0o51), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(49) + chr(0b10001 + 0o40), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(0b110000) + chr(1909 - 1855), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110100) + '\065', 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + '\x32' + '\061' + chr(481 - 431), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1000110 + 0o51) + chr(845 - 796) + '\065' + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(10340 - 10229) + '\061' + '\x30' + chr(2415 - 2363), 0o10), ehT0Px3KOsy9(chr(880 - 832) + '\157' + chr(0b110101) + chr(1426 - 1376), 0o10), ehT0Px3KOsy9('\060' + chr(3785 - 3674) + '\062' + chr(50) + '\x31', 30328 - 30320), ehT0Px3KOsy9('\060' + chr(2537 - 2426) + chr(0b110001) + chr(48) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101110 + 0o5) + chr(1051 - 999) + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11 + 0o56) + '\062' + chr(2861 - 2806), 0b1000), ehT0Px3KOsy9(chr(1157 - 1109) + chr(111) + chr(0b110001) + chr(55) + chr(0b110000 + 0o1), ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(111) + chr(552 - 503) + '\x37' + chr(0b110111), 56668 - 56660), ehT0Px3KOsy9(chr(506 - 458) + chr(111) + '\x33' + chr(0b110110) + chr(0b10001 + 0o43), 20608 - 20600), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(2441 - 2390), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1070 - 1021) + '\x33' + chr(48), 4319 - 4311), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100100 + 0o17) + '\060' + '\062', 14114 - 14106), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(378 - 329) + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11100 + 0o26) + chr(0b10 + 0o65) + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + '\063' + '\x30', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b11111 + 0o120) + chr(0b100100 + 0o16) + chr(0b110010) + chr(51), 13775 - 13767), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(51) + chr(53), 0o10), ehT0Px3KOsy9(chr(759 - 711) + chr(0b1110 + 0o141) + '\061' + chr(1155 - 1107) + '\x32', 8), ehT0Px3KOsy9(chr(681 - 633) + chr(0b101110 + 0o101) + chr(2053 - 2003) + chr(0b1 + 0o66) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + chr(49) + '\067' + chr(2280 - 2230), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b11 + 0o56) + chr(54) + chr(55), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + '\062' + '\061', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\066' + chr(0b100100 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(1577 - 1529) + chr(111) + '\061', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1001110 + 0o41) + '\x35' + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5'), chr(0b1100100) + '\145' + '\x63' + '\x6f' + chr(0b1001011 + 0o31) + '\145')('\165' + chr(9559 - 9443) + chr(1768 - 1666) + chr(851 - 806) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def g6Q471b9Iufc(oVre8I6UXc3b, SzFiEIj4hjFJ): AIvJRzLdDfgF = iMeWigHN5SYe(q8dtU4b0Qq1O, SzFiEIj4hjFJ) if AIvJRzLdDfgF[ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110000), 62378 - 62370)] == xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5'), chr(0b1000 + 0o134) + '\x65' + chr(0b101110 + 0o65) + chr(9302 - 9191) + '\x64' + '\145')('\x75' + chr(116) + '\146' + chr(0b1110 + 0o37) + '\070') and xafqLlk3kkUe(AIvJRzLdDfgF[ehT0Px3KOsy9(chr(48) + chr(3920 - 3809) + '\x31', 8)], xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xacEG\x90\xad\xa7'), chr(8581 - 8481) + chr(0b1100101) + chr(99) + '\157' + chr(0b111101 + 0o47) + chr(0b111011 + 0o52))('\165' + chr(1465 - 1349) + chr(0b1010110 + 0o20) + chr(0b101101) + '\070'))() and xafqLlk3kkUe(AIvJRzLdDfgF[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100111 + 0o13), 4953 - 4945)], xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xac\\X\x97\xad\xa7'), chr(100) + chr(101) + '\143' + chr(0b10101 + 0o132) + chr(100) + '\x65')('\165' + chr(3976 - 3860) + chr(0b1100110) + chr(728 - 683) + chr(719 - 663)))(): return AIvJRzLdDfgF[ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(580 - 469) + '\061', 8):] tDJd1TTiJALP = oVre8I6UXc3b.descriptors.message_to_fd[AIvJRzLdDfgF] if xafqLlk3kkUe(tDJd1TTiJALP, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa\x96F}\xb2\xb2\x99\xf9\xd1\xd1.\x80'), '\144' + chr(0b1100101) + chr(3685 - 3586) + chr(0b10100 + 0o133) + chr(0b1100100) + '\145')(chr(10583 - 10466) + chr(0b1110100) + chr(879 - 777) + '\055' + '\x38')) == xafqLlk3kkUe(oVre8I6UXc3b.fd, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa\x96F}\xb2\xb2\x99\xf9\xd1\xd1.\x80'), chr(9805 - 9705) + chr(0b110000 + 0o65) + chr(0b101000 + 0o73) + '\157' + '\x64' + chr(0b1100101))(chr(117) + chr(0b10100 + 0o140) + '\x66' + '\055' + '\x38')): vsJU7GhuEuh6 = AIvJRzLdDfgF.split(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5'), chr(8917 - 8817) + chr(365 - 264) + chr(6144 - 6045) + chr(4396 - 4285) + chr(7248 - 7148) + chr(4965 - 4864))(chr(2280 - 2163) + chr(0b111101 + 0o67) + '\146' + chr(0b101101) + '\070')) for (WVxHKyX45z_L, _Wv4RRy2aVmP) in YlkZvXL8qwsX(vsJU7GhuEuh6): if _Wv4RRy2aVmP and xafqLlk3kkUe(_Wv4RRy2aVmP[ehT0Px3KOsy9(chr(48) + chr(0b111100 + 0o63) + chr(48), 8)], xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xacEG\x90\xad\xa7'), chr(0b101000 + 0o74) + chr(101) + '\143' + '\157' + chr(100) + chr(3333 - 3232))('\165' + chr(116) + chr(0b1100110) + '\x2d' + chr(0b101 + 0o63)))() and xafqLlk3kkUe(_Wv4RRy2aVmP[ehT0Px3KOsy9(chr(48) + chr(111) + '\061', 8)], xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xac\\X\x97\xad\xa7'), chr(2904 - 2804) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(0b1001110 + 0o27))(chr(0b1010 + 0o153) + chr(116) + chr(0b1100110) + chr(45) + '\070'))(): return xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5'), chr(9041 - 8941) + chr(8036 - 7935) + '\x63' + '\x6f' + chr(2972 - 2872) + '\145')(chr(0b1110101 + 0o0) + '\164' + chr(102) + chr(0b101101) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb4\xb0go\x9a\xbc\x83\xd3\xfb\xc6\x01\x80'), '\144' + chr(101) + chr(308 - 209) + chr(0b1101111) + chr(0b1010100 + 0o20) + '\145')(chr(117) + '\x74' + chr(0b1100110) + chr(0b11011 + 0o22) + chr(0b111000)))(vsJU7GhuEuh6[WVxHKyX45z_L:]) vsJU7GhuEuh6 = AIvJRzLdDfgF.split(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5'), '\x64' + chr(4656 - 4555) + '\x63' + '\157' + chr(0b1100100) + chr(2968 - 2867))(chr(0b1110101) + chr(0b1110100) + '\146' + '\x2d' + chr(56))) for (WVxHKyX45z_L, _Wv4RRy2aVmP) in YlkZvXL8qwsX(vsJU7GhuEuh6): if _Wv4RRy2aVmP and xafqLlk3kkUe(_Wv4RRy2aVmP[ehT0Px3KOsy9(chr(48) + chr(11213 - 11102) + chr(1902 - 1854), 8)], xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xacEG\x90\xad\xa7'), chr(7809 - 7709) + chr(0b1100011 + 0o2) + chr(0b1100011) + chr(111) + chr(6529 - 6429) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(0b1100 + 0o132) + '\055' + '\x38'))() and xafqLlk3kkUe(_Wv4RRy2aVmP[ehT0Px3KOsy9('\x30' + chr(0b111100 + 0o63) + '\061', 8)], xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xac\\X\x97\xad\xa7'), '\144' + chr(1177 - 1076) + chr(99) + '\x6f' + chr(100) + chr(101))(chr(0b1110101) + '\164' + chr(102) + chr(45) + chr(2798 - 2742)))(): assert xafqLlk3kkUe(tDJd1TTiJALP.name, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e\xb1TD\x97\xa1\xa1\xf5'), chr(0b1001111 + 0o25) + chr(0b1011000 + 0o15) + '\143' + chr(0b1010111 + 0o30) + chr(0b111000 + 0o54) + '\145')('\165' + '\164' + chr(102) + chr(0b101101) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5\xafBX\x94\xa7'), '\144' + '\145' + '\143' + chr(10072 - 9961) + chr(6985 - 6885) + chr(0b111011 + 0o52))(chr(117) + '\164' + chr(2708 - 2606) + chr(45) + chr(56))) GAtvRnF5lmFm = oVre8I6UXc3b._import(tDJd1TTiJALP.name[:-ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b111101 + 0o62) + chr(0b1101 + 0o51), 48780 - 48772)].replace(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc6'), '\144' + chr(0b1000010 + 0o43) + chr(0b110110 + 0o55) + chr(111) + chr(0b1100100) + '\x65')(chr(6040 - 5923) + '\164' + chr(0b1100110) + chr(0b100110 + 0o7) + chr(0b100111 + 0o21)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb4'), chr(100) + chr(995 - 894) + chr(0b1010100 + 0o17) + chr(1940 - 1829) + '\x64' + '\x65')('\x75' + chr(9832 - 9716) + chr(1176 - 1074) + chr(0b101101) + '\x38')) + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb4\xafR\x05'), chr(100) + '\x65' + chr(5585 - 5486) + '\x6f' + chr(0b101111 + 0o65) + chr(0b1000101 + 0o40))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b101101) + '\x38'), _Wv4RRy2aVmP) pVZJj23PneZt = xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5'), '\144' + chr(101) + chr(6850 - 6751) + chr(0b100100 + 0o113) + '\x64' + chr(101))(chr(117) + chr(0b1110100) + chr(1443 - 1341) + chr(45) + chr(731 - 675))._oWXztVNnqHF(vsJU7GhuEuh6[WVxHKyX45z_L + ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49), 8):]) if not pVZJj23PneZt: return GAtvRnF5lmFm raise vcEHXBQXuDuh(xafqLlk3kkUe(SXOLrMavuUCe(b"\xaf\xb0^\x10\x94\xe8\xa6\xe8\xe5\xc7&\xb4Q\xaa\x01!Y\xe5'\x81+>\x14\x0f\x9by,\xb1\xea\xc7=\xe7"), chr(0b10001 + 0o123) + chr(0b1100101) + chr(0b100010 + 0o101) + chr(0b1011111 + 0o20) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(0b1110 + 0o37) + '\070')) raise vcEHXBQXuDuh(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8\xb0E[\x84\xe8\xbb\xf2\xe1\x979\xa7W\xf9\ndF\xfe!\x84gw\x17\x1e\x99nx'), chr(0b1100100) + chr(1455 - 1354) + '\143' + chr(9532 - 9421) + chr(0b1100100) + chr(0b1000100 + 0o41))(chr(0b1110100 + 0o1) + chr(4853 - 4737) + chr(0b101011 + 0o73) + '\055' + '\070') + AIvJRzLdDfgF)
onnx/onnx
setup.py
mypy_type_check.run
def run(self): """Run command.""" onnx_script = os.path.realpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "tools/mypy-onnx.py")) returncode = subprocess.call([sys.executable, onnx_script]) sys.exit(returncode)
python
def run(self): """Run command.""" onnx_script = os.path.realpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "tools/mypy-onnx.py")) returncode = subprocess.call([sys.executable, onnx_script]) sys.exit(returncode)
[ "def", "run", "(", "self", ")", ":", "onnx_script", "=", "os", ".", "path", ".", "realpath", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "abspath", "(", "__file__", ")", ")", ",", "\"tools/mypy-onnx.py\"", ")", ")", "returncode", "=", "subprocess", ".", "call", "(", "[", "sys", ".", "executable", ",", "onnx_script", "]", ")", "sys", ".", "exit", "(", "returncode", ")" ]
Run command.
[ "Run", "command", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/setup.py#L252-L256
train
Run command.
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,O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4tpXu4lf,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), 56739 - 56731), ehT0Px3KOsy9('\060' + chr(0b1000101 + 0o52) + chr(0b100101 + 0o15) + chr(51) + '\063', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1000101 + 0o52) + chr(50) + '\067' + chr(0b11 + 0o63), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(8355 - 8244) + chr(49) + chr(0b110001 + 0o3) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101100 + 0o3) + chr(49) + chr(54) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(0b1101 + 0o52) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(76 - 28) + '\157' + chr(50) + '\066' + chr(0b100101 + 0o13), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b110101) + chr(0b10111 + 0o35), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(54) + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(48) + chr(0b100011 + 0o20), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100 + 0o63) + '\060', 0o10), ehT0Px3KOsy9(chr(207 - 159) + '\x6f' + chr(1605 - 1554) + chr(0b1 + 0o57) + chr(1379 - 1326), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(0b110100) + chr(0b110111 + 0o0), 0b1000), ehT0Px3KOsy9(chr(1473 - 1425) + chr(2866 - 2755) + chr(0b110001) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(2122 - 2071) + chr(0b100100 + 0o22) + chr(100 - 48), 52745 - 52737), ehT0Px3KOsy9('\x30' + chr(0b1011101 + 0o22) + chr(803 - 753) + chr(0b110100) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31', 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1717 - 1666) + '\065' + chr(0b1100 + 0o51), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b10011 + 0o134) + chr(0b100000 + 0o23) + chr(0b110100 + 0o2) + chr(0b0 + 0o65), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(0b101 + 0o54), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + '\063' + chr(0b1111 + 0o42), 62362 - 62354), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + '\063' + chr(51) + '\x35', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + chr(1278 - 1229) + chr(2508 - 2453) + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10010 + 0o41) + '\x34' + chr(1358 - 1308), 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1100010 + 0o15) + chr(0b110011) + chr(1765 - 1714) + '\x32', 58682 - 58674), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1163 - 1114) + '\x32' + chr(0b100011 + 0o20), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b11001 + 0o31) + chr(55) + chr(0b110100), 25409 - 25401), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(53) + chr(1529 - 1481), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(51) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(527 - 478) + chr(132 - 83) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b110001) + '\066', 0o10), ehT0Px3KOsy9(chr(1453 - 1405) + chr(0b1101111) + chr(0b110100) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x34' + chr(0b11011 + 0o26), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\x36' + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1010 + 0o51) + '\x33' + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\064' + chr(1949 - 1900), 8), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\157' + chr(50) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(51) + '\x32' + '\060', 59042 - 59034), ehT0Px3KOsy9('\060' + '\x6f' + chr(2272 - 2223) + '\062' + chr(529 - 481), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1010101 + 0o32) + '\063' + chr(1711 - 1663) + chr(105 - 57), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(8263 - 8152) + '\x35' + '\060', 58016 - 58008)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'/'), chr(0b1100100) + chr(0b11 + 0o142) + chr(0b1000001 + 0o42) + '\157' + '\144' + chr(6230 - 6129))(chr(117) + '\164' + chr(0b1011001 + 0o15) + '\x2d' + chr(1228 - 1172)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def sgt5BU61bwZ2(oVre8I6UXc3b): XewOR36Ak0b5 = oqhJDdMJfuwx.path.realpath(oqhJDdMJfuwx.path._oWXztVNnqHF(oqhJDdMJfuwx.path.dirname(oqhJDdMJfuwx.path.abspath(tmzuw0hjv33u)), xafqLlk3kkUe(SXOLrMavuUCe(b'u\xf4\xd1\x08\x05\x95\xdd\x95\xc3\xba\x15\xaa\te\x8c\x8aq\x94'), chr(100) + '\145' + '\x63' + chr(2768 - 2657) + chr(100) + chr(0b1100101))(chr(117) + chr(0b1110 + 0o146) + '\146' + chr(0b10011 + 0o32) + '\070'))) rDLPMNbWWfl7 = SorA9b5x63bd.call([a2SYDDomXDZ2.executable, XewOR36Ak0b5]) xafqLlk3kkUe(a2SYDDomXDZ2, xafqLlk3kkUe(SXOLrMavuUCe(b'd\xe3\xd7\x10'), chr(100) + chr(2243 - 2142) + '\143' + chr(111) + chr(0b1011111 + 0o5) + chr(0b1110 + 0o127))('\x75' + '\x74' + chr(2311 - 2209) + chr(45) + chr(0b11011 + 0o35)))(rDLPMNbWWfl7)
onnx/onnx
onnx/helper.py
make_node
def make_node( op_type, # type: Text inputs, # type: Sequence[Text] outputs, # type: Sequence[Text] name=None, # type: Optional[Text] doc_string=None, # type: Optional[Text] domain=None, # type: Optional[Text] **kwargs # type: Any ): # type: (...) -> NodeProto """Construct a NodeProto. Arguments: op_type (string): The name of the operator to construct inputs (list of string): list of input names outputs (list of string): list of output names name (string, default None): optional unique identifier for NodeProto doc_string (string, default None): optional documentation string for NodeProto domain (string, default None): optional domain for NodeProto. If it's None, we will just use default domain (which is empty) **kwargs (dict): the attributes of the node. The acceptable values are documented in :func:`make_attribute`. """ node = NodeProto() node.op_type = op_type node.input.extend(inputs) node.output.extend(outputs) if name: node.name = name if doc_string: node.doc_string = doc_string if domain is not None: node.domain = domain if kwargs: node.attribute.extend( make_attribute(key, value) for key, value in sorted(kwargs.items())) return node
python
def make_node( op_type, # type: Text inputs, # type: Sequence[Text] outputs, # type: Sequence[Text] name=None, # type: Optional[Text] doc_string=None, # type: Optional[Text] domain=None, # type: Optional[Text] **kwargs # type: Any ): # type: (...) -> NodeProto """Construct a NodeProto. Arguments: op_type (string): The name of the operator to construct inputs (list of string): list of input names outputs (list of string): list of output names name (string, default None): optional unique identifier for NodeProto doc_string (string, default None): optional documentation string for NodeProto domain (string, default None): optional domain for NodeProto. If it's None, we will just use default domain (which is empty) **kwargs (dict): the attributes of the node. The acceptable values are documented in :func:`make_attribute`. """ node = NodeProto() node.op_type = op_type node.input.extend(inputs) node.output.extend(outputs) if name: node.name = name if doc_string: node.doc_string = doc_string if domain is not None: node.domain = domain if kwargs: node.attribute.extend( make_attribute(key, value) for key, value in sorted(kwargs.items())) return node
[ "def", "make_node", "(", "op_type", ",", "# type: Text", "inputs", ",", "# type: Sequence[Text]", "outputs", ",", "# type: Sequence[Text]", "name", "=", "None", ",", "# type: Optional[Text]", "doc_string", "=", "None", ",", "# type: Optional[Text]", "domain", "=", "None", ",", "# type: Optional[Text]", "*", "*", "kwargs", "# type: Any", ")", ":", "# type: (...) -> NodeProto", "node", "=", "NodeProto", "(", ")", "node", ".", "op_type", "=", "op_type", "node", ".", "input", ".", "extend", "(", "inputs", ")", "node", ".", "output", ".", "extend", "(", "outputs", ")", "if", "name", ":", "node", ".", "name", "=", "name", "if", "doc_string", ":", "node", ".", "doc_string", "=", "doc_string", "if", "domain", "is", "not", "None", ":", "node", ".", "domain", "=", "domain", "if", "kwargs", ":", "node", ".", "attribute", ".", "extend", "(", "make_attribute", "(", "key", ",", "value", ")", "for", "key", ",", "value", "in", "sorted", "(", "kwargs", ".", "items", "(", ")", ")", ")", "return", "node" ]
Construct a NodeProto. Arguments: op_type (string): The name of the operator to construct inputs (list of string): list of input names outputs (list of string): list of output names name (string, default None): optional unique identifier for NodeProto doc_string (string, default None): optional documentation string for NodeProto domain (string, default None): optional domain for NodeProto. If it's None, we will just use default domain (which is empty) **kwargs (dict): the attributes of the node. The acceptable values are documented in :func:`make_attribute`.
[ "Construct", "a", "NodeProto", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/helper.py#L20-L57
train
Construct a NodeProto object from the given arguments.
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,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IvNSaRMa,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) + '\x32' + '\x37' + chr(152 - 98), 0b1000), ehT0Px3KOsy9('\x30' + chr(8901 - 8790) + chr(0b101110 + 0o4) + chr(0b110111) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1000100 + 0o53) + '\x33' + chr(91 - 41) + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101010 + 0o5) + '\x37' + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(0b110011) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2464 - 2413) + chr(0b110111) + '\061', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110101) + chr(1569 - 1517), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + chr(1302 - 1252) + '\x32' + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(1654 - 1600) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + '\x30' + chr(1617 - 1568), ord("\x08")), ehT0Px3KOsy9(chr(1989 - 1941) + '\157' + chr(0b110010) + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + chr(1943 - 1832) + chr(745 - 696) + '\x37' + '\x32', 13560 - 13552), ehT0Px3KOsy9(chr(0b110000) + chr(2311 - 2200) + chr(54) + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(49) + chr(74 - 25), 10434 - 10426), ehT0Px3KOsy9(chr(48) + chr(111) + chr(55) + chr(0b110110), 19224 - 19216), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b110000) + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110101) + chr(2085 - 2031), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(242 - 188) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(1040 - 992) + '\x6f' + chr(51) + chr(679 - 630) + chr(0b110000), 34699 - 34691), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\x32' + chr(0b100010 + 0o22), 4916 - 4908), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101111) + chr(0b100110 + 0o13) + '\061' + chr(460 - 411), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110111) + chr(484 - 436), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100000 + 0o117) + chr(0b110011) + chr(0b110111) + chr(1163 - 1111), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10101 + 0o37) + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + '\x30' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1000 + 0o52) + chr(52) + chr(50), 42965 - 42957), ehT0Px3KOsy9('\060' + chr(5426 - 5315) + chr(50) + chr(49) + '\062', 0o10), ehT0Px3KOsy9(chr(887 - 839) + '\157' + chr(0b1000 + 0o51) + chr(0b110100) + '\x35', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(1311 - 1260) + '\x30' + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + chr(2336 - 2225) + '\x33' + chr(0b1000 + 0o57) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1527 - 1477) + '\066' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + chr(3062 - 2951) + chr(1412 - 1363) + '\061', 0o10), ehT0Px3KOsy9('\x30' + chr(2676 - 2565) + chr(0b1100 + 0o46) + chr(0b110110) + '\x33', 17996 - 17988), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\x6f' + chr(0b110011) + '\062' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100 + 0o55) + chr(48) + chr(0b110000 + 0o5), 0o10), ehT0Px3KOsy9('\060' + chr(0b100000 + 0o117) + '\x32' + chr(96 - 41) + '\x33', 41063 - 41055), ehT0Px3KOsy9('\060' + chr(0b1000011 + 0o54) + chr(0b100100 + 0o16) + '\x31' + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1856 - 1801) + chr(63 - 11), 58470 - 58462), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(753 - 702) + '\064' + '\x33', 63917 - 63909), ehT0Px3KOsy9(chr(0b110000) + chr(8675 - 8564) + chr(50) + '\x31', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1951 - 1903) + chr(111) + '\x35' + chr(521 - 473), 19471 - 19463)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x90'), '\144' + '\x65' + '\x63' + '\157' + chr(4449 - 4349) + chr(0b0 + 0o145))(chr(4863 - 4746) + chr(0b1110100) + '\x66' + chr(0b101101) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ABLE8eiiLfB_(Z2snvw94fARv, vXoupepMtCXU, Dx_DllZ8uCko, AIvJRzLdDfgF=None, fXIsleWcuc4e=None, psizfxY_oCoV=None, **M8EIoTs2GJXE): FDgyextYBrUF = fNKkDTFhloF1() FDgyextYBrUF.Z2snvw94fARv = Z2snvw94fARv xafqLlk3kkUe(FDgyextYBrUF.input, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\xc1\xa4^\xb5\x9d'), chr(100) + chr(0b1100010 + 0o3) + '\x63' + chr(0b1010010 + 0o35) + chr(100) + '\145')(chr(117) + chr(0b1000 + 0o154) + chr(0b1001111 + 0o27) + '\x2d' + '\070'))(vXoupepMtCXU) xafqLlk3kkUe(FDgyextYBrUF.output, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\xc1\xa4^\xb5\x9d'), '\x64' + chr(586 - 485) + '\143' + '\157' + chr(1924 - 1824) + '\145')('\165' + chr(6502 - 6386) + '\146' + chr(0b101101) + '\070'))(Dx_DllZ8uCko) if AIvJRzLdDfgF: FDgyextYBrUF.AIvJRzLdDfgF = AIvJRzLdDfgF if fXIsleWcuc4e: FDgyextYBrUF.fXIsleWcuc4e = fXIsleWcuc4e if psizfxY_oCoV is not None: FDgyextYBrUF.psizfxY_oCoV = psizfxY_oCoV if M8EIoTs2GJXE: xafqLlk3kkUe(FDgyextYBrUF.attribute, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\xc1\xa4^\xb5\x9d'), chr(100) + '\145' + '\x63' + chr(111) + chr(0b1100100) + chr(101))(chr(9058 - 8941) + '\164' + chr(2383 - 2281) + '\x2d' + chr(56)))((iXan894AvAgV(K3J4ZwSlE0sT, QmmgWUB13VCJ) for (K3J4ZwSlE0sT, QmmgWUB13VCJ) in vUlqIvNSaRMa(xafqLlk3kkUe(M8EIoTs2GJXE, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf0\xc3\xa6^\x92\xa3\x1f\xdb\x9d\xd2]C'), chr(0b110101 + 0o57) + chr(0b1100101) + chr(0b11011 + 0o110) + chr(0b1010000 + 0o37) + '\x64' + chr(0b1000101 + 0o40))(chr(117) + '\x74' + '\146' + chr(0b101101) + chr(0b110011 + 0o5)))()))) return FDgyextYBrUF
onnx/onnx
onnx/helper.py
make_operatorsetid
def make_operatorsetid( domain, # type: Text version, # type: int ): # type: (...) -> OperatorSetIdProto """Construct an OperatorSetIdProto. Arguments: domain (string): The domain of the operator set id version (integer): Version of operator set id """ operatorsetid = OperatorSetIdProto() operatorsetid.domain = domain operatorsetid.version = version return operatorsetid
python
def make_operatorsetid( domain, # type: Text version, # type: int ): # type: (...) -> OperatorSetIdProto """Construct an OperatorSetIdProto. Arguments: domain (string): The domain of the operator set id version (integer): Version of operator set id """ operatorsetid = OperatorSetIdProto() operatorsetid.domain = domain operatorsetid.version = version return operatorsetid
[ "def", "make_operatorsetid", "(", "domain", ",", "# type: Text", "version", ",", "# type: int", ")", ":", "# type: (...) -> OperatorSetIdProto", "operatorsetid", "=", "OperatorSetIdProto", "(", ")", "operatorsetid", ".", "domain", "=", "domain", "operatorsetid", ".", "version", "=", "version", "return", "operatorsetid" ]
Construct an OperatorSetIdProto. Arguments: domain (string): The domain of the operator set id version (integer): Version of operator set id
[ "Construct", "an", "OperatorSetIdProto", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/helper.py#L60-L73
train
Construct an OperatorSetIdProto object from the given domain and version.
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(48) + '\157' + chr(1761 - 1712) + chr(0b1111 + 0o42) + chr(0b110101), 56375 - 56367), ehT0Px3KOsy9(chr(2252 - 2204) + chr(111) + '\061' + '\062' + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(53) + chr(0b110111), 50537 - 50529), ehT0Px3KOsy9('\x30' + chr(0b1010110 + 0o31) + '\x31' + chr(0b110100) + chr(2542 - 2489), 33253 - 33245), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(7188 - 7077) + '\x32' + '\x30' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + chr(1525 - 1475) + chr(1573 - 1518), 0b1000), ehT0Px3KOsy9(chr(1000 - 952) + chr(0b111111 + 0o60) + '\063' + '\062' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1010000 + 0o37) + chr(0b110011) + chr(95 - 43) + chr(2492 - 2437), 0o10), ehT0Px3KOsy9('\060' + chr(0b1001011 + 0o44) + '\062' + chr(1690 - 1635) + chr(0b11 + 0o56), 0o10), ehT0Px3KOsy9(chr(1193 - 1145) + '\157' + chr(0b1100 + 0o46) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + chr(0b101 + 0o56) + chr(2109 - 2056) + chr(53), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(1492 - 1437) + chr(54), 0o10), ehT0Px3KOsy9(chr(144 - 96) + chr(111) + chr(1152 - 1103) + chr(0b100110 + 0o20) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(0b10011 + 0o36) + chr(0b100 + 0o57), 47299 - 47291), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(50) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(863 - 811) + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1011011 + 0o24) + chr(1466 - 1415) + chr(0b101010 + 0o15) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + '\x31' + chr(0b110011) + chr(0b110000 + 0o2), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(166 - 115) + chr(1321 - 1269) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\157' + chr(0b11100 + 0o25) + chr(0b11000 + 0o30) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1888 - 1838) + chr(0b110000) + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(5523 - 5412) + chr(51) + chr(0b110100) + chr(1831 - 1780), 8), ehT0Px3KOsy9(chr(1467 - 1419) + chr(152 - 41) + chr(2177 - 2126) + chr(50) + chr(0b11110 + 0o27), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b101000 + 0o11) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(53) + chr(0b10100 + 0o41), 0b1000), ehT0Px3KOsy9('\060' + chr(0b111100 + 0o63) + chr(49) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(52) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(10101 - 9990) + chr(50) + chr(53) + '\063', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + '\x30' + chr(0b101101 + 0o12), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + chr(0b100111 + 0o20) + chr(0b110011), 17104 - 17096), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + '\060' + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(0b110001) + '\x37' + chr(416 - 367), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(2021 - 1972) + chr(0b110100) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(10144 - 10033) + chr(624 - 573) + chr(0b10100 + 0o43) + chr(0b1110 + 0o50), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\067' + '\x36', 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + chr(0b101111 + 0o2) + chr(1565 - 1514) + chr(1493 - 1444), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1001 + 0o146) + '\x35' + '\x31', 59713 - 59705), ehT0Px3KOsy9(chr(503 - 455) + '\157' + '\066' + chr(0b10010 + 0o45), 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + chr(2351 - 2300) + chr(0b1001 + 0o51) + '\x31', 64478 - 64470), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + '\x30', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1790 - 1737) + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'c'), '\x64' + '\x65' + '\143' + '\157' + chr(100) + '\145')(chr(9064 - 8947) + chr(6207 - 6091) + chr(0b1100110) + '\055' + chr(0b100101 + 0o23)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def DBc73GxT5e4e(psizfxY_oCoV, cpMfQ_4_Vb7C): eZ20wtfsoHL6 = ALr4Gl4W_9yC() eZ20wtfsoHL6.psizfxY_oCoV = psizfxY_oCoV eZ20wtfsoHL6.cpMfQ_4_Vb7C = cpMfQ_4_Vb7C return eZ20wtfsoHL6
onnx/onnx
onnx/helper.py
_to_bytes_or_false
def _to_bytes_or_false(val): # type: (Union[Text, bytes]) -> Union[bytes, bool] """An internal graph to convert the input to a bytes or to False. The criteria for conversion is as follows and should be python 2 and 3 compatible: - If val is py2 str or py3 bytes: return bytes - If val is py2 unicode or py3 str: return val.decode('utf-8') - Otherwise, return False """ if isinstance(val, bytes): return val else: try: return val.encode('utf-8') except AttributeError: return False
python
def _to_bytes_or_false(val): # type: (Union[Text, bytes]) -> Union[bytes, bool] """An internal graph to convert the input to a bytes or to False. The criteria for conversion is as follows and should be python 2 and 3 compatible: - If val is py2 str or py3 bytes: return bytes - If val is py2 unicode or py3 str: return val.decode('utf-8') - Otherwise, return False """ if isinstance(val, bytes): return val else: try: return val.encode('utf-8') except AttributeError: return False
[ "def", "_to_bytes_or_false", "(", "val", ")", ":", "# type: (Union[Text, bytes]) -> Union[bytes, bool]", "if", "isinstance", "(", "val", ",", "bytes", ")", ":", "return", "val", "else", ":", "try", ":", "return", "val", ".", "encode", "(", "'utf-8'", ")", "except", "AttributeError", ":", "return", "False" ]
An internal graph to convert the input to a bytes or to False. The criteria for conversion is as follows and should be python 2 and 3 compatible: - If val is py2 str or py3 bytes: return bytes - If val is py2 unicode or py3 str: return val.decode('utf-8') - Otherwise, return False
[ "An", "internal", "graph", "to", "convert", "the", "input", "to", "a", "bytes", "or", "to", "False", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/helper.py#L179-L194
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w0hjv33u,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(0b100100 + 0o15) + chr(128 - 79) + chr(48), 21063 - 21055), ehT0Px3KOsy9('\060' + chr(8034 - 7923) + chr(1928 - 1877) + chr(1290 - 1241) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1010010 + 0o35) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(1819 - 1771) + chr(0b111011 + 0o64) + chr(0b100 + 0o55) + chr(911 - 860) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(10839 - 10728) + '\063' + chr(48) + chr(0b0 + 0o61), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11001 + 0o32) + '\x34' + chr(49), 33429 - 33421), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1101111) + '\063' + '\x36' + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + chr(0b110101) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(54) + chr(1787 - 1738), 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(0b110100) + chr(1285 - 1235), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(8814 - 8703) + chr(0b110010) + '\x37' + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b111100 + 0o63) + chr(0b0 + 0o63) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(1478 - 1430) + chr(0b100 + 0o153) + chr(1598 - 1547) + chr(0b110110) + chr(0b10100 + 0o43), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + '\064', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + '\064' + chr(0b110110), 42171 - 42163), ehT0Px3KOsy9(chr(0b110000) + chr(10165 - 10054) + chr(0b110 + 0o54) + chr(54) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + chr(0b110001) + chr(50) + chr(1373 - 1318), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(55) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(96 - 47) + '\064' + '\060', 26472 - 26464), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110101) + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + '\x31' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4683 - 4572) + chr(0b100 + 0o55) + '\x31' + chr(0b100000 + 0o26), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1004 - 953) + chr(0b110000) + chr(0b110101), 61962 - 61954), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101110 + 0o5) + chr(2511 - 2460) + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(6371 - 6260) + chr(51) + '\062' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100010 + 0o21) + chr(52) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + '\061' + chr(1703 - 1651) + chr(1454 - 1403), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(0b100001 + 0o21) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110100) + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + '\065' + chr(0b110011), 37404 - 37396), ehT0Px3KOsy9(chr(48) + chr(111) + chr(392 - 343) + '\062', 55180 - 55172), ehT0Px3KOsy9(chr(99 - 51) + chr(0b1101111) + chr(0b101011 + 0o10) + chr(0b110011 + 0o4) + chr(0b11010 + 0o35), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(0b10001 + 0o46) + chr(2543 - 2488), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(921 - 868) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(304 - 249) + chr(0b101011 + 0o11), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(5206 - 5095) + chr(0b11010 + 0o30) + chr(1228 - 1173) + chr(48), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11010 + 0o34) + '\065', 0b1000), ehT0Px3KOsy9(chr(1868 - 1820) + '\157' + chr(0b101 + 0o54) + chr(0b1111 + 0o46), 39427 - 39419), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + '\064', 8), ehT0Px3KOsy9(chr(2075 - 2027) + '\157' + '\x33' + '\067' + chr(0b110000), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(694 - 583) + chr(2598 - 2545) + chr(48), 65424 - 65416)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'f'), '\144' + chr(0b0 + 0o145) + chr(0b1100011) + '\x6f' + chr(8417 - 8317) + chr(0b10001 + 0o124))('\x75' + '\164' + '\x66' + chr(0b101101) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def v3MCnsE98WOy(pQxH2D_k9sXQ): if PlSM16l2KDPD(pQxH2D_k9sXQ, QOfmzcVJsrp8): return pQxH2D_k9sXQ else: try: return xafqLlk3kkUe(pQxH2D_k9sXQ, xafqLlk3kkUe(SXOLrMavuUCe(b'-\xa5e0\xa5\x84'), chr(1612 - 1512) + '\145' + '\x63' + '\x6f' + '\x64' + '\x65')('\165' + '\164' + '\146' + chr(0b10001 + 0o34) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'=\xbf`r\xf9'), chr(100) + chr(4426 - 4325) + chr(1509 - 1410) + chr(111) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(0b111010 + 0o72) + chr(0b1000011 + 0o43) + chr(689 - 644) + chr(0b10 + 0o66))) except sHOWSIAKtU58: return ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1965 - 1917), 0o10)
onnx/onnx
onnx/helper.py
make_attribute
def make_attribute( key, # type: Text value, # type: Any doc_string=None # type: Optional[Text] ): # type: (...) -> AttributeProto """Makes an AttributeProto based on the value type.""" attr = AttributeProto() attr.name = key if doc_string: attr.doc_string = doc_string is_iterable = isinstance(value, collections.Iterable) bytes_or_false = _to_bytes_or_false(value) # First, singular cases # float if isinstance(value, float): attr.f = value attr.type = AttributeProto.FLOAT # integer elif isinstance(value, numbers.Integral): attr.i = cast(int, value) attr.type = AttributeProto.INT # string elif bytes_or_false: assert isinstance(bytes_or_false, bytes) attr.s = bytes_or_false attr.type = AttributeProto.STRING elif isinstance(value, TensorProto): attr.t.CopyFrom(value) attr.type = AttributeProto.TENSOR elif isinstance(value, GraphProto): attr.g.CopyFrom(value) attr.type = AttributeProto.GRAPH # third, iterable cases elif is_iterable: byte_array = [_to_bytes_or_false(v) for v in value] if all(isinstance(v, float) for v in value): attr.floats.extend(value) attr.type = AttributeProto.FLOATS elif all(isinstance(v, numbers.Integral) for v in value): # Turn np.int32/64 into Python built-in int. attr.ints.extend(int(v) for v in value) attr.type = AttributeProto.INTS elif all(byte_array): attr.strings.extend(cast(List[bytes], byte_array)) attr.type = AttributeProto.STRINGS elif all(isinstance(v, TensorProto) for v in value): attr.tensors.extend(value) attr.type = AttributeProto.TENSORS elif all(isinstance(v, GraphProto) for v in value): attr.graphs.extend(value) attr.type = AttributeProto.GRAPHS else: raise ValueError( "You passed in an iterable attribute but I cannot figure out " "its applicable type.") else: raise ValueError( 'Value "{}" is not valid attribute data type.'.format(value)) return attr
python
def make_attribute( key, # type: Text value, # type: Any doc_string=None # type: Optional[Text] ): # type: (...) -> AttributeProto """Makes an AttributeProto based on the value type.""" attr = AttributeProto() attr.name = key if doc_string: attr.doc_string = doc_string is_iterable = isinstance(value, collections.Iterable) bytes_or_false = _to_bytes_or_false(value) # First, singular cases # float if isinstance(value, float): attr.f = value attr.type = AttributeProto.FLOAT # integer elif isinstance(value, numbers.Integral): attr.i = cast(int, value) attr.type = AttributeProto.INT # string elif bytes_or_false: assert isinstance(bytes_or_false, bytes) attr.s = bytes_or_false attr.type = AttributeProto.STRING elif isinstance(value, TensorProto): attr.t.CopyFrom(value) attr.type = AttributeProto.TENSOR elif isinstance(value, GraphProto): attr.g.CopyFrom(value) attr.type = AttributeProto.GRAPH # third, iterable cases elif is_iterable: byte_array = [_to_bytes_or_false(v) for v in value] if all(isinstance(v, float) for v in value): attr.floats.extend(value) attr.type = AttributeProto.FLOATS elif all(isinstance(v, numbers.Integral) for v in value): # Turn np.int32/64 into Python built-in int. attr.ints.extend(int(v) for v in value) attr.type = AttributeProto.INTS elif all(byte_array): attr.strings.extend(cast(List[bytes], byte_array)) attr.type = AttributeProto.STRINGS elif all(isinstance(v, TensorProto) for v in value): attr.tensors.extend(value) attr.type = AttributeProto.TENSORS elif all(isinstance(v, GraphProto) for v in value): attr.graphs.extend(value) attr.type = AttributeProto.GRAPHS else: raise ValueError( "You passed in an iterable attribute but I cannot figure out " "its applicable type.") else: raise ValueError( 'Value "{}" is not valid attribute data type.'.format(value)) return attr
[ "def", "make_attribute", "(", "key", ",", "# type: Text", "value", ",", "# type: Any", "doc_string", "=", "None", "# type: Optional[Text]", ")", ":", "# type: (...) -> AttributeProto", "attr", "=", "AttributeProto", "(", ")", "attr", ".", "name", "=", "key", "if", "doc_string", ":", "attr", ".", "doc_string", "=", "doc_string", "is_iterable", "=", "isinstance", "(", "value", ",", "collections", ".", "Iterable", ")", "bytes_or_false", "=", "_to_bytes_or_false", "(", "value", ")", "# First, singular cases", "# float", "if", "isinstance", "(", "value", ",", "float", ")", ":", "attr", ".", "f", "=", "value", "attr", ".", "type", "=", "AttributeProto", ".", "FLOAT", "# integer", "elif", "isinstance", "(", "value", ",", "numbers", ".", "Integral", ")", ":", "attr", ".", "i", "=", "cast", "(", "int", ",", "value", ")", "attr", ".", "type", "=", "AttributeProto", ".", "INT", "# string", "elif", "bytes_or_false", ":", "assert", "isinstance", "(", "bytes_or_false", ",", "bytes", ")", "attr", ".", "s", "=", "bytes_or_false", "attr", ".", "type", "=", "AttributeProto", ".", "STRING", "elif", "isinstance", "(", "value", ",", "TensorProto", ")", ":", "attr", ".", "t", ".", "CopyFrom", "(", "value", ")", "attr", ".", "type", "=", "AttributeProto", ".", "TENSOR", "elif", "isinstance", "(", "value", ",", "GraphProto", ")", ":", "attr", ".", "g", ".", "CopyFrom", "(", "value", ")", "attr", ".", "type", "=", "AttributeProto", ".", "GRAPH", "# third, iterable cases", "elif", "is_iterable", ":", "byte_array", "=", "[", "_to_bytes_or_false", "(", "v", ")", "for", "v", "in", "value", "]", "if", "all", "(", "isinstance", "(", "v", ",", "float", ")", "for", "v", "in", "value", ")", ":", "attr", ".", "floats", ".", "extend", "(", "value", ")", "attr", ".", "type", "=", "AttributeProto", ".", "FLOATS", "elif", "all", "(", "isinstance", "(", "v", ",", "numbers", ".", "Integral", ")", "for", "v", "in", "value", ")", ":", "# Turn np.int32/64 into Python built-in int.", "attr", ".", "ints", ".", "extend", "(", "int", "(", "v", ")", "for", "v", "in", "value", ")", "attr", ".", "type", "=", "AttributeProto", ".", "INTS", "elif", "all", "(", "byte_array", ")", ":", "attr", ".", "strings", ".", "extend", "(", "cast", "(", "List", "[", "bytes", "]", ",", "byte_array", ")", ")", "attr", ".", "type", "=", "AttributeProto", ".", "STRINGS", "elif", "all", "(", "isinstance", "(", "v", ",", "TensorProto", ")", "for", "v", "in", "value", ")", ":", "attr", ".", "tensors", ".", "extend", "(", "value", ")", "attr", ".", "type", "=", "AttributeProto", ".", "TENSORS", "elif", "all", "(", "isinstance", "(", "v", ",", "GraphProto", ")", "for", "v", "in", "value", ")", ":", "attr", ".", "graphs", ".", "extend", "(", "value", ")", "attr", ".", "type", "=", "AttributeProto", ".", "GRAPHS", "else", ":", "raise", "ValueError", "(", "\"You passed in an iterable attribute but I cannot figure out \"", "\"its applicable type.\"", ")", "else", ":", "raise", "ValueError", "(", "'Value \"{}\" is not valid attribute data type.'", ".", "format", "(", "value", ")", ")", "return", "attr" ]
Makes an AttributeProto based on the value type.
[ "Makes", "an", "AttributeProto", "based", "on", "the", "value", "type", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/helper.py#L197-L256
train
Makes an AttributeProto based on the value 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,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,sznF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2g7fO0,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(49) + '\x35' + chr(0b11010 + 0o32), 13069 - 13061), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + '\061' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101101 + 0o4) + chr(0b110101) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(1170 - 1122) + chr(4852 - 4741) + '\x33' + chr(52) + chr(1064 - 1011), 56861 - 56853), ehT0Px3KOsy9(chr(48) + chr(5189 - 5078) + chr(2196 - 2146) + chr(1179 - 1127), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + '\x34' + '\x35', 0o10), ehT0Px3KOsy9('\060' + chr(0b1000000 + 0o57) + '\063' + chr(0b10111 + 0o36), 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(9771 - 9660) + chr(2225 - 2176) + chr(0b110111) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100101 + 0o112) + chr(51) + chr(0b0 + 0o67) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + chr(0b11110 + 0o24) + chr(55) + chr(1611 - 1557), 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b111101 + 0o62) + chr(0b110001) + chr(0b110110) + chr(53), 59730 - 59722), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\061' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101 + 0o54) + chr(0b110110) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + '\x32' + chr(0b11000 + 0o34), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(2394 - 2342) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + '\061' + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b11111 + 0o23), 47488 - 47480), ehT0Px3KOsy9('\060' + chr(12190 - 12079) + chr(0b110011) + '\066' + chr(49), 0b1000), ehT0Px3KOsy9('\060' + chr(3096 - 2985) + '\x34' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1011101 + 0o22) + chr(49) + chr(1813 - 1762) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(7904 - 7793) + '\066' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b100100 + 0o113) + chr(1515 - 1464) + chr(48) + chr(53), 0b1000), ehT0Px3KOsy9('\060' + chr(11989 - 11878) + '\x32', 0o10), ehT0Px3KOsy9(chr(1129 - 1081) + '\x6f' + chr(0b11111 + 0o22) + '\x31' + '\064', 8), ehT0Px3KOsy9('\060' + chr(671 - 560) + '\063' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + '\063' + '\065' + chr(0b1010 + 0o55), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + '\x32' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b111 + 0o56), ord("\x08")), ehT0Px3KOsy9(chr(79 - 31) + '\157' + chr(0b10100 + 0o36) + '\x33' + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1165 - 1116) + chr(0b10110 + 0o33) + '\x31', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(52) + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10001 + 0o41) + '\x30' + '\x31', 3070 - 3062), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10101 + 0o34) + '\x34' + chr(0b101111 + 0o5), 50941 - 50933), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(0b110110) + chr(0b11100 + 0o26), 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(8876 - 8765) + chr(0b100111 + 0o12) + '\060', 56808 - 56800), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(48) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + chr(0b10110 + 0o36) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\157' + chr(0b11011 + 0o27) + '\063' + chr(0b110000 + 0o1), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110110) + chr(0b100010 + 0o22), 41378 - 41370)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1457 - 1404) + chr(0b11 + 0o55), 55316 - 55308)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'B'), '\x64' + chr(101) + chr(0b100 + 0o137) + '\157' + chr(0b1100000 + 0o4) + '\145')(chr(0b111101 + 0o70) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(0b101010 + 0o16)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def iXan894AvAgV(K3J4ZwSlE0sT, QmmgWUB13VCJ, fXIsleWcuc4e=None): uwnd9_euJYKT = jel77znP798e() uwnd9_euJYKT.AIvJRzLdDfgF = K3J4ZwSlE0sT if fXIsleWcuc4e: uwnd9_euJYKT.fXIsleWcuc4e = fXIsleWcuc4e l0b_ys92_fz2 = PlSM16l2KDPD(QmmgWUB13VCJ, FGhnnwoh1Dd8.Iterable) hVHEYOTEggn8 = v3MCnsE98WOy(QmmgWUB13VCJ) if PlSM16l2KDPD(QmmgWUB13VCJ, kkSX4ccExqw4): uwnd9_euJYKT.EGyt1xfPT1P6 = QmmgWUB13VCJ uwnd9_euJYKT.wmQmyeWBmUpv = jel77znP798e.FLOAT elif PlSM16l2KDPD(QmmgWUB13VCJ, xafqLlk3kkUe(uU3ppLOUY_t7, xafqLlk3kkUe(SXOLrMavuUCe(b'%\xa6\x1f\x80s\xd7|\x15'), chr(737 - 637) + chr(7292 - 7191) + '\143' + chr(0b1101111) + chr(0b1100100) + '\145')('\165' + '\x74' + chr(102) + chr(0b101101) + chr(2161 - 2105)))): uwnd9_euJYKT.WVxHKyX45z_L = iMeWigHN5SYe(ehT0Px3KOsy9, QmmgWUB13VCJ) uwnd9_euJYKT.wmQmyeWBmUpv = jel77znP798e.INT elif hVHEYOTEggn8: assert PlSM16l2KDPD(hVHEYOTEggn8, QOfmzcVJsrp8) uwnd9_euJYKT.vGrByMSYMp9h = hVHEYOTEggn8 uwnd9_euJYKT.wmQmyeWBmUpv = jel77znP798e.STRING elif PlSM16l2KDPD(QmmgWUB13VCJ, OQJZWUVbJZfJ): xafqLlk3kkUe(uwnd9_euJYKT.t, xafqLlk3kkUe(SXOLrMavuUCe(b'/\xa7\x1b\x9cR\xd7r\x14'), chr(100) + '\x65' + '\x63' + chr(0b1101111) + '\x64' + '\145')(chr(0b1110101) + chr(0b110110 + 0o76) + chr(102) + chr(0b1011 + 0o42) + chr(0b111000)))(QmmgWUB13VCJ) uwnd9_euJYKT.wmQmyeWBmUpv = jel77znP798e.TENSOR elif PlSM16l2KDPD(QmmgWUB13VCJ, nec8F8AqDfUJ): xafqLlk3kkUe(uwnd9_euJYKT.g, xafqLlk3kkUe(SXOLrMavuUCe(b'/\xa7\x1b\x9cR\xd7r\x14'), '\x64' + '\145' + chr(99) + '\x6f' + chr(100) + chr(101))('\165' + chr(1709 - 1593) + chr(0b1100110) + '\x2d' + '\070'))(QmmgWUB13VCJ) uwnd9_euJYKT.wmQmyeWBmUpv = jel77znP798e.GRAPH elif l0b_ys92_fz2: hYiiYEANfn4z = [v3MCnsE98WOy(cMbll0QYhULo) for cMbll0QYhULo in QmmgWUB13VCJ] if Dl48nj1rbi23((PlSM16l2KDPD(cMbll0QYhULo, kkSX4ccExqw4) for cMbll0QYhULo in QmmgWUB13VCJ)): xafqLlk3kkUe(uwnd9_euJYKT.floats, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xb0\x1f\x80z\xc1'), chr(0b110 + 0o136) + chr(101) + chr(9078 - 8979) + chr(0b1001110 + 0o41) + chr(0b101101 + 0o67) + chr(0b100100 + 0o101))('\165' + chr(0b1110100) + chr(102) + '\x2d' + '\070'))(QmmgWUB13VCJ) uwnd9_euJYKT.wmQmyeWBmUpv = jel77znP798e.FLOATS elif Dl48nj1rbi23((PlSM16l2KDPD(cMbll0QYhULo, xafqLlk3kkUe(uU3ppLOUY_t7, xafqLlk3kkUe(SXOLrMavuUCe(b'%\xa6\x1f\x80s\xd7|\x15'), chr(0b11010 + 0o112) + chr(101) + '\143' + chr(111) + chr(7431 - 7331) + '\145')('\165' + '\x74' + chr(102) + '\055' + chr(1455 - 1399)))) for cMbll0QYhULo in QmmgWUB13VCJ)): xafqLlk3kkUe(uwnd9_euJYKT.ints, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xb0\x1f\x80z\xc1'), '\x64' + chr(101) + chr(0b1100011) + chr(0b1101111) + '\144' + '\x65')(chr(117) + '\x74' + '\146' + chr(45) + chr(0b111000)))((ehT0Px3KOsy9(cMbll0QYhULo) for cMbll0QYhULo in QmmgWUB13VCJ)) uwnd9_euJYKT.wmQmyeWBmUpv = jel77znP798e.INTS elif Dl48nj1rbi23(hYiiYEANfn4z): xafqLlk3kkUe(uwnd9_euJYKT.strings, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xb0\x1f\x80z\xc1'), chr(0b1001101 + 0o27) + '\x65' + '\x63' + '\157' + '\x64' + chr(0b1100101))(chr(117) + '\164' + '\146' + chr(2010 - 1965) + chr(0b11111 + 0o31)))(iMeWigHN5SYe(qRxF7OQ0y39T[QOfmzcVJsrp8], hYiiYEANfn4z)) uwnd9_euJYKT.wmQmyeWBmUpv = jel77znP798e.STRINGS elif Dl48nj1rbi23((PlSM16l2KDPD(cMbll0QYhULo, OQJZWUVbJZfJ) for cMbll0QYhULo in QmmgWUB13VCJ)): xafqLlk3kkUe(uwnd9_euJYKT.tensors, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xb0\x1f\x80z\xc1'), chr(100) + '\145' + chr(0b1100000 + 0o3) + chr(0b11100 + 0o123) + chr(100) + '\x65')(chr(117) + chr(8645 - 8529) + chr(0b1001110 + 0o30) + '\x2d' + chr(2411 - 2355)))(QmmgWUB13VCJ) uwnd9_euJYKT.wmQmyeWBmUpv = jel77znP798e.TENSORS elif Dl48nj1rbi23((PlSM16l2KDPD(cMbll0QYhULo, nec8F8AqDfUJ) for cMbll0QYhULo in QmmgWUB13VCJ)): xafqLlk3kkUe(uwnd9_euJYKT.graphs, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xb0\x1f\x80z\xc1'), '\x64' + chr(0b1000010 + 0o43) + chr(99) + chr(111) + '\x64' + chr(101))(chr(1706 - 1589) + chr(0b10100 + 0o140) + '\146' + chr(45) + chr(1418 - 1362)))(QmmgWUB13VCJ) uwnd9_euJYKT.wmQmyeWBmUpv = jel77znP798e.GRAPHS else: raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'5\xa7\x1e\xc5d\xc4n\n\x98\xdaU%\x1c4\x00\xe32\x98V9qT\xa7n)<\x8e"q\xe9 F\xf4\x10\x97(\xa2\x16\xed\x14%\xe8\x08\x84z\xcbr\r\xdd\xd8\x1c+\x07f\x04\xad}\x84V|jA\xb6"-l\x9f:l\xf8(F\xed\x01\xd2|\xb9\x13\xfc\x1a'), '\x64' + chr(7972 - 7871) + '\x63' + chr(4715 - 4604) + chr(0b1100100) + '\x65')(chr(9247 - 9130) + '\x74' + '\146' + '\x2d' + chr(56))) else: raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b':\xa9\x07\x90q\x85?\x02\x80\x9cU%\x014\x0f\xe2f\xd1T=o\\\xa1"-h\x9b$l\xf9<P\xe4D\x96i\xb4\x02\xb9@\x15\xb8\x0e\xcb'), '\x64' + chr(101) + '\143' + chr(0b1001111 + 0o40) + '\x64' + '\x65')(chr(117) + '\164' + chr(1524 - 1422) + '\x2d' + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b':\xfc\x19\x8a\\\xc4NJ\xad\xce\x10&'), '\x64' + chr(8797 - 8696) + '\143' + '\x6f' + '\144' + chr(101))('\165' + chr(12815 - 12699) + '\x66' + chr(331 - 286) + chr(2925 - 2869)))(QmmgWUB13VCJ)) return uwnd9_euJYKT
onnx/onnx
onnx/helper.py
make_tensor_value_info
def make_tensor_value_info( name, # type: Text elem_type, # type: int shape, # type: Optional[Sequence[Union[Text, int]]] doc_string="", # type: Text shape_denotation=None, # type: Optional[List[Text]] ): # type: (...) -> ValueInfoProto """Makes a ValueInfoProto based on the data type and shape.""" value_info_proto = ValueInfoProto() value_info_proto.name = name if doc_string: value_info_proto.doc_string = doc_string tensor_type_proto = value_info_proto.type.tensor_type tensor_type_proto.elem_type = elem_type tensor_shape_proto = tensor_type_proto.shape if shape is not None: # You might think this is a no-op (extending a normal Python # list by [] certainly is), but protobuf lists work a little # differently; if a field is never set, it is omitted from the # resulting protobuf; a list that is explicitly set to be # empty will get an (empty) entry in the protobuf. This # difference is visible to our consumers, so make sure we emit # an empty shape! tensor_shape_proto.dim.extend([]) if shape_denotation: if len(shape_denotation) != len(shape): raise ValueError( 'Invalid shape_denotation. ' 'Must be of the same length as shape.') for i, d in enumerate(shape): dim = tensor_shape_proto.dim.add() if d is None: pass elif isinstance(d, integer_types): dim.dim_value = d elif isinstance(d, text_type): dim.dim_param = d else: raise ValueError( 'Invalid item in shape: {}. ' 'Needs to of integer_types or text_type.'.format(d)) if shape_denotation: dim.denotation = shape_denotation[i] return value_info_proto
python
def make_tensor_value_info( name, # type: Text elem_type, # type: int shape, # type: Optional[Sequence[Union[Text, int]]] doc_string="", # type: Text shape_denotation=None, # type: Optional[List[Text]] ): # type: (...) -> ValueInfoProto """Makes a ValueInfoProto based on the data type and shape.""" value_info_proto = ValueInfoProto() value_info_proto.name = name if doc_string: value_info_proto.doc_string = doc_string tensor_type_proto = value_info_proto.type.tensor_type tensor_type_proto.elem_type = elem_type tensor_shape_proto = tensor_type_proto.shape if shape is not None: # You might think this is a no-op (extending a normal Python # list by [] certainly is), but protobuf lists work a little # differently; if a field is never set, it is omitted from the # resulting protobuf; a list that is explicitly set to be # empty will get an (empty) entry in the protobuf. This # difference is visible to our consumers, so make sure we emit # an empty shape! tensor_shape_proto.dim.extend([]) if shape_denotation: if len(shape_denotation) != len(shape): raise ValueError( 'Invalid shape_denotation. ' 'Must be of the same length as shape.') for i, d in enumerate(shape): dim = tensor_shape_proto.dim.add() if d is None: pass elif isinstance(d, integer_types): dim.dim_value = d elif isinstance(d, text_type): dim.dim_param = d else: raise ValueError( 'Invalid item in shape: {}. ' 'Needs to of integer_types or text_type.'.format(d)) if shape_denotation: dim.denotation = shape_denotation[i] return value_info_proto
[ "def", "make_tensor_value_info", "(", "name", ",", "# type: Text", "elem_type", ",", "# type: int", "shape", ",", "# type: Optional[Sequence[Union[Text, int]]]", "doc_string", "=", "\"\"", ",", "# type: Text", "shape_denotation", "=", "None", ",", "# type: Optional[List[Text]]", ")", ":", "# type: (...) -> ValueInfoProto", "value_info_proto", "=", "ValueInfoProto", "(", ")", "value_info_proto", ".", "name", "=", "name", "if", "doc_string", ":", "value_info_proto", ".", "doc_string", "=", "doc_string", "tensor_type_proto", "=", "value_info_proto", ".", "type", ".", "tensor_type", "tensor_type_proto", ".", "elem_type", "=", "elem_type", "tensor_shape_proto", "=", "tensor_type_proto", ".", "shape", "if", "shape", "is", "not", "None", ":", "# You might think this is a no-op (extending a normal Python", "# list by [] certainly is), but protobuf lists work a little", "# differently; if a field is never set, it is omitted from the", "# resulting protobuf; a list that is explicitly set to be", "# empty will get an (empty) entry in the protobuf. This", "# difference is visible to our consumers, so make sure we emit", "# an empty shape!", "tensor_shape_proto", ".", "dim", ".", "extend", "(", "[", "]", ")", "if", "shape_denotation", ":", "if", "len", "(", "shape_denotation", ")", "!=", "len", "(", "shape", ")", ":", "raise", "ValueError", "(", "'Invalid shape_denotation. '", "'Must be of the same length as shape.'", ")", "for", "i", ",", "d", "in", "enumerate", "(", "shape", ")", ":", "dim", "=", "tensor_shape_proto", ".", "dim", ".", "add", "(", ")", "if", "d", "is", "None", ":", "pass", "elif", "isinstance", "(", "d", ",", "integer_types", ")", ":", "dim", ".", "dim_value", "=", "d", "elif", "isinstance", "(", "d", ",", "text_type", ")", ":", "dim", ".", "dim_param", "=", "d", "else", ":", "raise", "ValueError", "(", "'Invalid item in shape: {}. '", "'Needs to of integer_types or text_type.'", ".", "format", "(", "d", ")", ")", "if", "shape_denotation", ":", "dim", ".", "denotation", "=", "shape_denotation", "[", "i", "]", "return", "value_info_proto" ]
Makes a ValueInfoProto based on the data type and shape.
[ "Makes", "a", "ValueInfoProto", "based", "on", "the", "data", "type", "and", "shape", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/helper.py#L290-L340
train
Makes a ValueInfoProto based on the data type and shape.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0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sS9P6_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(1217 - 1169) + '\x6f' + '\061' + '\x30' + '\065', 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1000000 + 0o57) + chr(1537 - 1486) + '\x34' + '\x35', 6382 - 6374), ehT0Px3KOsy9(chr(1789 - 1741) + '\x6f' + '\066' + '\067', 29812 - 29804), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + '\x30' + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10000 + 0o42) + chr(0b101001 + 0o11) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(569 - 458) + '\062' + chr(2761 - 2707) + chr(1878 - 1828), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + '\063' + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\x36' + '\066', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + '\x30' + '\062', ord("\x08")), ehT0Px3KOsy9('\060' + chr(6797 - 6686) + '\063' + chr(2338 - 2283) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + '\x31' + '\063' + '\065', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9782 - 9671) + chr(0b110001) + chr(0b110000 + 0o1) + chr(0b100111 + 0o12), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b10001 + 0o42) + '\x30' + chr(48), 0o10), ehT0Px3KOsy9('\060' + chr(0b100100 + 0o113) + '\x37' + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1000010 + 0o55) + chr(296 - 247) + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(0b110000) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(2064 - 2013) + chr(0b10010 + 0o45), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1700 - 1649) + '\064' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100100 + 0o13) + chr(2246 - 2197) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b100001 + 0o17), 28834 - 28826), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1549 - 1499) + chr(1616 - 1568) + chr(49), 35372 - 35364), ehT0Px3KOsy9('\x30' + '\157' + chr(1532 - 1482) + '\060' + chr(0b110111), 498 - 490), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(9992 - 9881) + chr(51) + '\x30' + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\061' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b0 + 0o157) + chr(51) + chr(0b1011 + 0o46) + chr(0b1011 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(683 - 635) + '\157' + chr(1322 - 1272), 0o10), ehT0Px3KOsy9(chr(1135 - 1087) + chr(111) + chr(0b101111 + 0o3) + '\x30' + chr(55), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + '\064' + '\x35', 8), ehT0Px3KOsy9(chr(1088 - 1040) + chr(7883 - 7772) + chr(0b110011) + chr(1624 - 1571) + '\066', 35272 - 35264), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1010 + 0o54) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(52) + chr(933 - 883), 16333 - 16325), ehT0Px3KOsy9(chr(48) + chr(0b101101 + 0o102) + chr(0b110010) + chr(0b110100) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + '\066' + '\x36', 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(1906 - 1855) + chr(0b110100) + chr(448 - 400), 26327 - 26319), ehT0Px3KOsy9('\x30' + chr(0b1001101 + 0o42) + chr(2058 - 2008) + chr(0b10 + 0o57), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(1827 - 1777) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(992 - 941) + chr(55) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + '\063' + chr(1880 - 1826), 39691 - 39683), ehT0Px3KOsy9('\x30' + chr(0b1010100 + 0o33) + chr(0b110011) + '\x36' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(53), 64197 - 64189)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + chr(0b10100 + 0o41) + chr(0b0 + 0o60), 27151 - 27143)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'k'), chr(0b1001111 + 0o25) + chr(0b11 + 0o142) + chr(0b1010001 + 0o22) + chr(4620 - 4509) + '\144' + chr(0b1100000 + 0o5))(chr(0b1110101) + chr(0b1110100) + chr(9296 - 9194) + '\055' + chr(1398 - 1342)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Jz_TRkmyU9Xd(AIvJRzLdDfgF, fyJ_W97SUnEJ, nauYfLglTpcb, fXIsleWcuc4e=xafqLlk3kkUe(SXOLrMavuUCe(b''), '\144' + chr(0b100011 + 0o102) + chr(0b11101 + 0o106) + chr(0b1000011 + 0o54) + '\144' + chr(512 - 411))('\x75' + chr(116) + chr(102) + chr(0b101101) + '\x38'), HLOPNjPYYTwA=None): xky_qTfLwyD9 = Yf8JEu4aue5i() xky_qTfLwyD9.AIvJRzLdDfgF = AIvJRzLdDfgF if fXIsleWcuc4e: xky_qTfLwyD9.fXIsleWcuc4e = fXIsleWcuc4e nobzoLsb2UzP = xky_qTfLwyD9.type.tensor_type nobzoLsb2UzP.fyJ_W97SUnEJ = fyJ_W97SUnEJ LVtAdcfi1SZI = nobzoLsb2UzP.nauYfLglTpcb if nauYfLglTpcb is not None: xafqLlk3kkUe(LVtAdcfi1SZI.dim, xafqLlk3kkUe(SXOLrMavuUCe(b' \x9dC\xe3\xfe\xd6'), chr(0b1001100 + 0o30) + chr(8332 - 8231) + '\x63' + chr(0b1001110 + 0o41) + chr(0b101010 + 0o72) + chr(3912 - 3811))(chr(0b1100110 + 0o17) + '\164' + '\146' + chr(45) + chr(56)))([]) if HLOPNjPYYTwA: if c2A0yzQpDQB3(HLOPNjPYYTwA) != c2A0yzQpDQB3(nauYfLglTpcb): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\x8bA\xe7\xfc\xdb\xf8\x96\xb1\x92<9\xa5fk%q\x89}q\xf5\xee\xaa\xa5\xe4"\xca\x90\x9dB\x82\xc6\xd3\xc0~\xb0\xdb\xea\x9che\x96V\xeb\xf5\x92\xf0\xd3\xac\x9d)!\xe0X|`l\x8eh`\xe4\xa9'), '\144' + '\x65' + chr(0b11111 + 0o104) + chr(0b100010 + 0o115) + chr(100) + chr(101))(chr(0b1000010 + 0o63) + chr(12578 - 12462) + '\x66' + chr(45) + chr(0b110110 + 0o2))) for (WVxHKyX45z_L, pd3lxn9vqWxp) in YlkZvXL8qwsX(nauYfLglTpcb): Nl_JhL3qUwSN = LVtAdcfi1SZI.dim.uJ0q9cG5ZOR3() if pd3lxn9vqWxp is None: pass elif PlSM16l2KDPD(pd3lxn9vqWxp, GakrcjanQCW1): Nl_JhL3qUwSN.z1Ii6rDQzKMR = pd3lxn9vqWxp elif PlSM16l2KDPD(pd3lxn9vqWxp, q1MiJcALIjIZ): Nl_JhL3qUwSN.O8hCNADt3_xA = pd3lxn9vqWxp else: raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\x8bA\xe7\xfc\xdb\xf8\x96\xab\x8e8$\xe0Pa`l\x8eh`\xe4\xbd\xe5\xb0\xb7,\xa7\xab\x8bS\xc6\xd7\x96\x94~\xf6\x94\xf8\xd4d+\x91R\xe1\xf5\xc0\xc3\xc2\xbb\x8a8:\xe0V}`k\x83qd\xde\xf3\xbc\xbb\xaf,'), chr(0b11111 + 0o105) + chr(0b1100101) + '\143' + chr(10907 - 10796) + '\x64' + '\x65')(chr(117) + '\x74' + chr(102) + '\055' + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x13\xd1E\xe9\xd8\xd3\xcf\x85\x92\x8a8#'), chr(100) + chr(7641 - 7540) + chr(0b1100011) + '\157' + chr(2321 - 2221) + chr(0b1100101))(chr(0b1110101) + '\164' + chr(102) + '\x2d' + chr(0b111000)))(pd3lxn9vqWxp)) if HLOPNjPYYTwA: Nl_JhL3qUwSN.fmQWOhgtirwx = HLOPNjPYYTwA[WVxHKyX45z_L] return xky_qTfLwyD9
onnx/onnx
onnx/helper.py
strip_doc_string
def strip_doc_string(proto): # type: (google.protobuf.message.Message) -> None """ Empties `doc_string` field on any nested protobuf messages """ assert isinstance(proto, google.protobuf.message.Message) for descriptor in proto.DESCRIPTOR.fields: if descriptor.name == 'doc_string': proto.ClearField(descriptor.name) elif descriptor.type == descriptor.TYPE_MESSAGE: if descriptor.label == descriptor.LABEL_REPEATED: for x in getattr(proto, descriptor.name): strip_doc_string(x) elif proto.HasField(descriptor.name): strip_doc_string(getattr(proto, descriptor.name))
python
def strip_doc_string(proto): # type: (google.protobuf.message.Message) -> None """ Empties `doc_string` field on any nested protobuf messages """ assert isinstance(proto, google.protobuf.message.Message) for descriptor in proto.DESCRIPTOR.fields: if descriptor.name == 'doc_string': proto.ClearField(descriptor.name) elif descriptor.type == descriptor.TYPE_MESSAGE: if descriptor.label == descriptor.LABEL_REPEATED: for x in getattr(proto, descriptor.name): strip_doc_string(x) elif proto.HasField(descriptor.name): strip_doc_string(getattr(proto, descriptor.name))
[ "def", "strip_doc_string", "(", "proto", ")", ":", "# type: (google.protobuf.message.Message) -> None", "assert", "isinstance", "(", "proto", ",", "google", ".", "protobuf", ".", "message", ".", "Message", ")", "for", "descriptor", "in", "proto", ".", "DESCRIPTOR", ".", "fields", ":", "if", "descriptor", ".", "name", "==", "'doc_string'", ":", "proto", ".", "ClearField", "(", "descriptor", ".", "name", ")", "elif", "descriptor", ".", "type", "==", "descriptor", ".", "TYPE_MESSAGE", ":", "if", "descriptor", ".", "label", "==", "descriptor", ".", "LABEL_REPEATED", ":", "for", "x", "in", "getattr", "(", "proto", ",", "descriptor", ".", "name", ")", ":", "strip_doc_string", "(", "x", ")", "elif", "proto", ".", "HasField", "(", "descriptor", ".", "name", ")", ":", "strip_doc_string", "(", "getattr", "(", "proto", ",", "descriptor", ".", "name", ")", ")" ]
Empties `doc_string` field on any nested protobuf messages
[ "Empties", "doc_string", "field", "on", "any", "nested", "protobuf", "messages" ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/helper.py#L538-L551
train
Removes the doc_string field from any nested protobuf 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,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,p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UzGokYBM2Z,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(3381 - 3270) + '\x31' + '\066' + chr(483 - 431), 10614 - 10606), ehT0Px3KOsy9('\060' + '\157' + chr(535 - 482) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11031 - 10920) + '\x32' + chr(0b110000) + chr(0b100100 + 0o21), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(50) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(146 - 95) + chr(0b110111), 49040 - 49032), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1163 - 1108) + chr(0b10000 + 0o44), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(0b11011 + 0o34) + '\x35', 24350 - 24342), ehT0Px3KOsy9(chr(48) + chr(9720 - 9609) + chr(0b110110) + chr(1568 - 1513), ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(7465 - 7354) + chr(0b110010) + chr(1212 - 1157) + chr(1459 - 1406), ord("\x08")), ehT0Px3KOsy9(chr(2009 - 1961) + chr(2228 - 2117) + chr(0b100000 + 0o21) + chr(54) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(8228 - 8117) + chr(412 - 362) + chr(0b11001 + 0o36) + chr(0b10111 + 0o36), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + '\x31' + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(0b110001) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b110110 + 0o71) + chr(1441 - 1390) + '\061' + chr(52), 8), ehT0Px3KOsy9(chr(48) + chr(0b110011 + 0o74) + '\062' + chr(107 - 56) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(820 - 772) + chr(111) + chr(52) + chr(151 - 103), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(3393 - 3282) + '\061' + chr(0b100011 + 0o15) + chr(1540 - 1487), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + '\x32' + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + '\x34' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(8386 - 8275) + '\x31' + '\x30' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(55) + chr(52), 8), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(111) + chr(51) + chr(54) + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + '\x35' + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(11317 - 11206) + '\063' + chr(0b11011 + 0o27) + chr(0b1100 + 0o47), 19244 - 19236), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + chr(12139 - 12028) + chr(1123 - 1072) + chr(48) + '\x33', 43753 - 43745), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b110100) + chr(0b110101), 17782 - 17774), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(389 - 278) + chr(0b10010 + 0o40) + '\060' + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2357 - 2305) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10110 + 0o131) + '\x33' + chr(0b110011 + 0o1) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\157' + chr(0b110011) + chr(49) + chr(0b10101 + 0o35), 7845 - 7837), ehT0Px3KOsy9('\060' + '\157' + chr(0b10111 + 0o32) + '\060' + chr(0b100110 + 0o12), 61228 - 61220), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1101 + 0o46) + chr(0b110101), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(531 - 479) + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + chr(2300 - 2189) + chr(0b1001 + 0o50) + '\x35' + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(874 - 823) + chr(0b110101), 8), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + '\x32' + '\060' + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(0b110001) + chr(0b11111 + 0o25), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b100010 + 0o21) + chr(0b110111) + chr(0b10010 + 0o37), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1313 - 1263) + chr(0b110111) + chr(2551 - 2500), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + chr(0b0 + 0o65) + chr(0b110000), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'Z'), chr(0b1000110 + 0o36) + chr(0b1100101) + '\x63' + chr(4221 - 4110) + chr(0b1100100) + chr(101))('\165' + chr(116) + chr(5508 - 5406) + '\x2d' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ZozRXV7JIUHw(EjgP3Uo4AYh3): assert PlSM16l2KDPD(EjgP3Uo4AYh3, xafqLlk3kkUe(c_77XUPV_xy5.protobuf.message, xafqLlk3kkUe(SXOLrMavuUCe(b'9M\xf6\xa1\xbe[\x98'), chr(8944 - 8844) + '\145' + chr(99) + chr(0b1101111) + chr(100) + chr(3764 - 3663))(chr(117) + '\164' + chr(102) + chr(1741 - 1696) + chr(0b111000)))) for pp8qvsPuVDye in xafqLlk3kkUe(EjgP3Uo4AYh3.DESCRIPTOR, xafqLlk3kkUe(SXOLrMavuUCe(b'+Q\xe4\xa4\x99i\xcba\xf7E\xca\x96'), '\144' + chr(0b1011000 + 0o15) + '\143' + chr(7600 - 7489) + '\144' + chr(0b1010001 + 0o24))('\165' + chr(0b1110100) + '\146' + chr(0b100101 + 0o10) + '\x38')): if xafqLlk3kkUe(pp8qvsPuVDye, xafqLlk3kkUe(SXOLrMavuUCe(b'5a\xf3\x98\x8dF\xb1S\xf9\x13\xda\x89'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1011110 + 0o21) + chr(0b1110 + 0o126) + chr(0b1100101))(chr(10660 - 10543) + chr(0b110 + 0o156) + chr(102) + chr(0b101000 + 0o5) + '\x38')) == xafqLlk3kkUe(SXOLrMavuUCe(b'\x10G\xe6\x8d\xacH\x8f^\xd3\x12'), chr(1712 - 1612) + '\x65' + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(0b101101 + 0o110) + '\x74' + chr(0b1100110) + chr(0b11 + 0o52) + chr(0b10001 + 0o47)): xafqLlk3kkUe(EjgP3Uo4AYh3, xafqLlk3kkUe(SXOLrMavuUCe(b'7D\xe0\xb3\xadz\x94R\xd1\x11'), chr(0b1100100) + chr(2000 - 1899) + '\x63' + '\x6f' + '\x64' + chr(0b1100100 + 0o1))(chr(0b1111 + 0o146) + chr(0b111100 + 0o70) + chr(0b1100110) + '\055' + chr(56)))(xafqLlk3kkUe(pp8qvsPuVDye, xafqLlk3kkUe(SXOLrMavuUCe(b'5a\xf3\x98\x8dF\xb1S\xf9\x13\xda\x89'), '\x64' + chr(0b1100101) + chr(99) + chr(0b1000000 + 0o57) + '\144' + chr(101))(chr(0b1110 + 0o147) + '\164' + chr(0b1100110) + chr(45) + '\x38'))) elif xafqLlk3kkUe(pp8qvsPuVDye, xafqLlk3kkUe(SXOLrMavuUCe(b'\x03E\xd4\xbf\xa6Y\xaau\xd0 \xcd\xb9'), '\144' + '\x65' + chr(0b100101 + 0o76) + chr(0b1000 + 0o147) + '\144' + chr(0b1011000 + 0o15))(chr(0b1110100 + 0o1) + chr(0b1110100 + 0o0) + chr(4363 - 4261) + '\x2d' + chr(0b10010 + 0o46))) == xafqLlk3kkUe(pp8qvsPuVDye, xafqLlk3kkUe(SXOLrMavuUCe(b' q\xd5\x97\x80q\xb8d\xee4\xfa\x8a'), chr(0b1100100) + chr(10152 - 10051) + '\143' + chr(111) + chr(0b1100100) + chr(101))(chr(117) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(56))): if xafqLlk3kkUe(pp8qvsPuVDye, xafqLlk3kkUe(SXOLrMavuUCe(b' z\xd0\x9d\x93z\xb1B\xf9E\x85\xb7'), '\x64' + '\x65' + chr(99) + chr(0b1101111) + '\x64' + chr(0b110 + 0o137))(chr(13499 - 13382) + '\164' + chr(102) + chr(158 - 113) + chr(0b111000))) == xafqLlk3kkUe(pp8qvsPuVDye, xafqLlk3kkUe(SXOLrMavuUCe(b'8i\xc7\x97\x93c\xafr\xed0\xfc\x9b\x89\x88'), chr(3904 - 3804) + chr(101) + '\x63' + chr(2931 - 2820) + chr(100) + '\x65')(chr(117) + chr(0b1110100) + chr(7168 - 7066) + '\055' + chr(0b111000))): for OeWW0F1dBPRQ in xafqLlk3kkUe(EjgP3Uo4AYh3, xafqLlk3kkUe(pp8qvsPuVDye, xafqLlk3kkUe(SXOLrMavuUCe(b'5a\xf3\x98\x8dF\xb1S\xf9\x13\xda\x89'), chr(100) + chr(0b100001 + 0o104) + '\143' + '\x6f' + chr(0b1100100) + chr(484 - 383))(chr(0b101001 + 0o114) + chr(0b1110100) + chr(0b10110 + 0o120) + chr(0b101101) + chr(0b111000)))): ZozRXV7JIUHw(OeWW0F1dBPRQ) elif xafqLlk3kkUe(EjgP3Uo4AYh3, xafqLlk3kkUe(SXOLrMavuUCe(b'<I\xf6\x94\xb6Y\x91S'), '\x64' + chr(0b110110 + 0o57) + chr(3675 - 3576) + '\x6f' + chr(6169 - 6069) + chr(101))('\x75' + chr(116) + '\x66' + chr(0b100110 + 0o7) + chr(0b101110 + 0o12)))(xafqLlk3kkUe(pp8qvsPuVDye, xafqLlk3kkUe(SXOLrMavuUCe(b'5a\xf3\x98\x8dF\xb1S\xf9\x13\xda\x89'), chr(5917 - 5817) + chr(0b111101 + 0o50) + chr(8159 - 8060) + chr(7334 - 7223) + '\x64' + '\145')('\x75' + chr(116) + '\x66' + chr(0b1101 + 0o40) + chr(56)))): ZozRXV7JIUHw(xafqLlk3kkUe(EjgP3Uo4AYh3, xafqLlk3kkUe(pp8qvsPuVDye, xafqLlk3kkUe(SXOLrMavuUCe(b'5a\xf3\x98\x8dF\xb1S\xf9\x13\xda\x89'), '\144' + chr(1477 - 1376) + chr(9364 - 9265) + '\157' + '\144' + '\x65')(chr(117) + chr(116) + chr(102) + chr(45) + chr(1740 - 1684)))))
onnx/onnx
onnx/numpy_helper.py
to_array
def to_array(tensor): # type: (TensorProto) -> np.ndarray[Any] """Converts a tensor def object to a numpy array. Inputs: tensor: a TensorProto object. Returns: arr: the converted array. """ if tensor.HasField("segment"): raise ValueError( "Currently not supporting loading segments.") if tensor.data_type == TensorProto.UNDEFINED: raise ValueError("The data type is not defined.") tensor_dtype = tensor.data_type np_dtype = mapping.TENSOR_TYPE_TO_NP_TYPE[tensor_dtype] storage_type = mapping.TENSOR_TYPE_TO_STORAGE_TENSOR_TYPE[tensor_dtype] storage_np_dtype = mapping.TENSOR_TYPE_TO_NP_TYPE[storage_type] storage_field = mapping.STORAGE_TENSOR_TYPE_TO_FIELD[storage_type] dims = tensor.dims if tensor.data_type == TensorProto.STRING: utf8_strings = getattr(tensor, storage_field) ss = list(s.decode('utf-8') for s in utf8_strings) return np.asarray(ss).astype(np_dtype).reshape(dims) if tensor.HasField("raw_data"): # Raw_bytes support: using frombuffer. return np.frombuffer( tensor.raw_data, dtype=np_dtype).reshape(dims) else: data = getattr(tensor, storage_field), # type: Sequence[np.complex64] if (tensor_dtype == TensorProto.COMPLEX64 or tensor_dtype == TensorProto.COMPLEX128): data = combine_pairs_to_complex(data) return ( np.asarray( data, dtype=storage_np_dtype) .astype(np_dtype) .reshape(dims) )
python
def to_array(tensor): # type: (TensorProto) -> np.ndarray[Any] """Converts a tensor def object to a numpy array. Inputs: tensor: a TensorProto object. Returns: arr: the converted array. """ if tensor.HasField("segment"): raise ValueError( "Currently not supporting loading segments.") if tensor.data_type == TensorProto.UNDEFINED: raise ValueError("The data type is not defined.") tensor_dtype = tensor.data_type np_dtype = mapping.TENSOR_TYPE_TO_NP_TYPE[tensor_dtype] storage_type = mapping.TENSOR_TYPE_TO_STORAGE_TENSOR_TYPE[tensor_dtype] storage_np_dtype = mapping.TENSOR_TYPE_TO_NP_TYPE[storage_type] storage_field = mapping.STORAGE_TENSOR_TYPE_TO_FIELD[storage_type] dims = tensor.dims if tensor.data_type == TensorProto.STRING: utf8_strings = getattr(tensor, storage_field) ss = list(s.decode('utf-8') for s in utf8_strings) return np.asarray(ss).astype(np_dtype).reshape(dims) if tensor.HasField("raw_data"): # Raw_bytes support: using frombuffer. return np.frombuffer( tensor.raw_data, dtype=np_dtype).reshape(dims) else: data = getattr(tensor, storage_field), # type: Sequence[np.complex64] if (tensor_dtype == TensorProto.COMPLEX64 or tensor_dtype == TensorProto.COMPLEX128): data = combine_pairs_to_complex(data) return ( np.asarray( data, dtype=storage_np_dtype) .astype(np_dtype) .reshape(dims) )
[ "def", "to_array", "(", "tensor", ")", ":", "# type: (TensorProto) -> np.ndarray[Any]", "if", "tensor", ".", "HasField", "(", "\"segment\"", ")", ":", "raise", "ValueError", "(", "\"Currently not supporting loading segments.\"", ")", "if", "tensor", ".", "data_type", "==", "TensorProto", ".", "UNDEFINED", ":", "raise", "ValueError", "(", "\"The data type is not defined.\"", ")", "tensor_dtype", "=", "tensor", ".", "data_type", "np_dtype", "=", "mapping", ".", "TENSOR_TYPE_TO_NP_TYPE", "[", "tensor_dtype", "]", "storage_type", "=", "mapping", ".", "TENSOR_TYPE_TO_STORAGE_TENSOR_TYPE", "[", "tensor_dtype", "]", "storage_np_dtype", "=", "mapping", ".", "TENSOR_TYPE_TO_NP_TYPE", "[", "storage_type", "]", "storage_field", "=", "mapping", ".", "STORAGE_TENSOR_TYPE_TO_FIELD", "[", "storage_type", "]", "dims", "=", "tensor", ".", "dims", "if", "tensor", ".", "data_type", "==", "TensorProto", ".", "STRING", ":", "utf8_strings", "=", "getattr", "(", "tensor", ",", "storage_field", ")", "ss", "=", "list", "(", "s", ".", "decode", "(", "'utf-8'", ")", "for", "s", "in", "utf8_strings", ")", "return", "np", ".", "asarray", "(", "ss", ")", ".", "astype", "(", "np_dtype", ")", ".", "reshape", "(", "dims", ")", "if", "tensor", ".", "HasField", "(", "\"raw_data\"", ")", ":", "# Raw_bytes support: using frombuffer.", "return", "np", ".", "frombuffer", "(", "tensor", ".", "raw_data", ",", "dtype", "=", "np_dtype", ")", ".", "reshape", "(", "dims", ")", "else", ":", "data", "=", "getattr", "(", "tensor", ",", "storage_field", ")", ",", "# type: Sequence[np.complex64]", "if", "(", "tensor_dtype", "==", "TensorProto", ".", "COMPLEX64", "or", "tensor_dtype", "==", "TensorProto", ".", "COMPLEX128", ")", ":", "data", "=", "combine_pairs_to_complex", "(", "data", ")", "return", "(", "np", ".", "asarray", "(", "data", ",", "dtype", "=", "storage_np_dtype", ")", ".", "astype", "(", "np_dtype", ")", ".", "reshape", "(", "dims", ")", ")" ]
Converts a tensor def object to a numpy array. Inputs: tensor: a TensorProto object. Returns: arr: the converted array.
[ "Converts", "a", "tensor", "def", "object", "to", "a", "numpy", "array", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/numpy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YzwAeSQh7N,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(0b110001) + chr(0b100001 + 0o17) + '\065', 38908 - 38900), ehT0Px3KOsy9('\060' + '\x6f' + '\x37' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + chr(1721 - 1671) + '\060' + chr(0b101111 + 0o6), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(2748 - 2694) + chr(54), 8105 - 8097), ehT0Px3KOsy9('\x30' + chr(0b1100111 + 0o10) + chr(0b1101 + 0o46) + '\063' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(0b110110) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + '\061' + '\x31', 46268 - 46260), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(689 - 638), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(51) + '\x36' + chr(51), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + chr(0b110010) + '\067' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + chr(0b10110 + 0o37) + chr(182 - 131), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + chr(0b10 + 0o61) + chr(53) + chr(2100 - 2050), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(1990 - 1879) + chr(0b10110 + 0o34) + chr(0b101111 + 0o4) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x32' + '\x30' + chr(53), 8), ehT0Px3KOsy9(chr(905 - 857) + chr(0b110000 + 0o77) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1111 + 0o140) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + chr(9646 - 9535) + '\064', 14139 - 14131), ehT0Px3KOsy9('\060' + '\157' + chr(0b101010 + 0o7) + '\x31' + chr(1056 - 1008), 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\157' + '\x31' + '\x34' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x37' + chr(0b10111 + 0o31), 50734 - 50726), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101001 + 0o11) + chr(52) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111 + 0o0) + '\061' + chr(51) + chr(52), 12577 - 12569), ehT0Px3KOsy9('\060' + '\157' + chr(1746 - 1697) + chr(53) + '\067', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + chr(0b1011 + 0o54) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110 + 0o53) + '\061' + chr(0b100101 + 0o14), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110101) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\157' + '\x31' + '\x31' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b111111 + 0o60) + '\x31' + chr(55) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(895 - 847) + chr(7690 - 7579) + '\061' + chr(0b110111) + chr(0b10 + 0o61), 7707 - 7699), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + chr(2297 - 2246) + '\x31' + '\x30', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b11100 + 0o26) + chr(2251 - 2201) + chr(1868 - 1817), 41484 - 41476), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\157' + chr(1631 - 1581) + chr(53) + chr(2075 - 2026), 48654 - 48646), ehT0Px3KOsy9(chr(1940 - 1892) + chr(4883 - 4772) + chr(49) + '\063' + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(1701 - 1653) + chr(55), 47965 - 47957), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1010 + 0o47) + chr(0b11011 + 0o33) + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(0b11110 + 0o26) + chr(0b11000 + 0o34), 8), ehT0Px3KOsy9(chr(1748 - 1700) + chr(0b1010010 + 0o35) + '\063' + chr(55) + '\x31', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110110) + chr(1807 - 1754), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1010010 + 0o35) + chr(0b110001) + '\x34', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(556 - 508) + chr(0b1001 + 0o146) + chr(0b110101) + chr(0b10110 + 0o32), 65066 - 65058)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'k'), chr(0b1100100) + chr(101) + chr(99) + chr(111) + chr(0b1100100) + chr(0b1100101))('\165' + '\164' + chr(102) + chr(45) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def nZpbThUTDLyT(LK3cpXJU3UM0): if xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b'\r\\\xf6p\xb6\x10\xa5o'), chr(0b1100100) + chr(101) + '\x63' + chr(0b1001000 + 0o47) + '\x64' + '\145')(chr(13505 - 13388) + chr(1729 - 1613) + chr(0b111 + 0o137) + chr(0b101101) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'6X\xe2[\xba\x1b\xbd'), chr(100) + '\145' + chr(0b101 + 0o136) + chr(111) + chr(0b1100100) + chr(0b1001101 + 0o30))('\165' + '\164' + chr(102) + chr(0b101101) + chr(0b111000))): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x06H\xf7D\xba\x1b\xbdg\x8a\x9cE\x85\xeb\xa5qpt8\x0bJ\xd65\x01\xdfiE#p\x1e\x12\xa6\xf4\x89("\x11\t\x9c[x6\x13'), '\144' + '\x65' + chr(0b110010 + 0o61) + '\157' + chr(100) + '\x65')('\165' + '\164' + chr(9260 - 9158) + chr(0b1111 + 0o36) + chr(0b111000))) if xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b'!\\\xf1W\x80\x01\xb0{\x96'), chr(825 - 725) + '\145' + '\143' + chr(111) + '\144' + chr(101))('\165' + '\164' + '\x66' + chr(1929 - 1884) + chr(2318 - 2262))) == xafqLlk3kkUe(OQJZWUVbJZfJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\x10s\xc1s\x99<\x87N\xb7'), chr(8933 - 8833) + chr(0b100 + 0o141) + chr(6563 - 6464) + chr(0b1111 + 0o140) + chr(0b1100001 + 0o3) + chr(101))('\x75' + chr(0b1110100) + chr(3425 - 3323) + chr(45) + chr(56))): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x11U\xe0\x16\xbb\x14\xbdj\xd3\xc8R\x9a\xfa\xa5kv$&\x0bL\x828\n\xde G)uT'), '\144' + chr(0b101000 + 0o75) + chr(99) + '\157' + chr(1564 - 1464) + chr(0b10101 + 0o120))(chr(6960 - 6843) + '\x74' + chr(0b1100110 + 0o0) + chr(0b101100 + 0o1) + chr(1557 - 1501))) UZD3JDp79S0x = LK3cpXJU3UM0.data_type hhxuXgoHk9_L = lDyiwdy_JhxC.TENSOR_TYPE_TO_NP_TYPE[UZD3JDp79S0x] bgYGSsW4qQl5 = lDyiwdy_JhxC.TENSOR_TYPE_TO_STORAGE_TENSOR_TYPE[UZD3JDp79S0x] JqBUAP3FsaDz = lDyiwdy_JhxC.TENSOR_TYPE_TO_NP_TYPE[bgYGSsW4qQl5] MMehr4N4Eujf = lDyiwdy_JhxC.STORAGE_TENSOR_TYPE_TO_FIELD[bgYGSsW4qQl5] RbZ6GZw6Nz_V = LK3cpXJU3UM0.dims if xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b'!\\\xf1W\x80\x01\xb0{\x96'), chr(5949 - 5849) + chr(8325 - 8224) + chr(1574 - 1475) + chr(0b10100 + 0o133) + '\144' + '\145')(chr(117) + chr(2585 - 2469) + chr(0b1100110) + chr(0b100 + 0o51) + chr(0b101011 + 0o15))) == xafqLlk3kkUe(OQJZWUVbJZfJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16i\xd7\x7f\x912'), '\x64' + chr(0b1100101) + chr(2440 - 2341) + chr(4047 - 3936) + chr(100) + chr(0b110101 + 0o60))(chr(9751 - 9634) + chr(0b1110100) + chr(0b1010 + 0o134) + '\055' + '\x38')): kTsrGYhyEFkt = xafqLlk3kkUe(LK3cpXJU3UM0, MMehr4N4Eujf) ICCst8_vi4Sm = YyaZ4tpXu4lf((vGrByMSYMp9h.decode(xafqLlk3kkUe(SXOLrMavuUCe(b'0I\xe3\x1b\xe7'), '\x64' + chr(0b1000111 + 0o36) + chr(0b1100011) + '\x6f' + '\144' + chr(369 - 268))('\x75' + chr(0b1110100) + chr(925 - 823) + chr(45) + '\x38')) for vGrByMSYMp9h in kTsrGYhyEFkt)) return xafqLlk3kkUe(WqUC3KWvYVup.asarray(ICCst8_vi4Sm).astype(hhxuXgoHk9_L), xafqLlk3kkUe(SXOLrMavuUCe(b'7X\xf6^\xbe\x05\xac'), chr(100) + chr(101) + chr(99) + chr(0b1101111) + '\x64' + chr(0b1100100 + 0o1))(chr(0b1010101 + 0o40) + chr(0b1100010 + 0o22) + chr(0b1100110) + '\055' + '\x38'))(RbZ6GZw6Nz_V) if xafqLlk3kkUe(LK3cpXJU3UM0, xafqLlk3kkUe(SXOLrMavuUCe(b'\r\\\xf6p\xb6\x10\xa5o'), chr(100) + '\x65' + chr(99) + '\157' + chr(595 - 495) + chr(0b1100101))('\165' + chr(0b1110100) + chr(7840 - 7738) + '\055' + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'7\\\xf2i\xbb\x14\xbdj'), chr(0b1100100) + chr(688 - 587) + chr(0b1000001 + 0o42) + '\157' + chr(0b1100100) + chr(3766 - 3665))(chr(0b1110101) + chr(0b101 + 0o157) + '\x66' + chr(45) + '\070')): return xafqLlk3kkUe(WqUC3KWvYVup.frombuffer(LK3cpXJU3UM0.raw_data, dtype=hhxuXgoHk9_L), xafqLlk3kkUe(SXOLrMavuUCe(b'7X\xf6^\xbe\x05\xac'), chr(100) + chr(0b101100 + 0o71) + chr(99) + chr(0b1101111) + '\144' + '\x65')(chr(0b100100 + 0o121) + '\164' + '\x66' + chr(45) + chr(56)))(RbZ6GZw6Nz_V) else: ULnjp6D6efFH = (xafqLlk3kkUe(LK3cpXJU3UM0, MMehr4N4Eujf),) if UZD3JDp79S0x == xafqLlk3kkUe(OQJZWUVbJZfJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\x06r\xc8f\x930\x91=\xc7'), chr(0b1010010 + 0o22) + chr(101) + chr(99) + chr(0b1101111) + chr(0b11000 + 0o114) + chr(0b1100101))('\165' + '\164' + chr(8769 - 8667) + chr(759 - 714) + chr(0b111000))) or UZD3JDp79S0x == xafqLlk3kkUe(OQJZWUVbJZfJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\x06r\xc8f\x930\x91:\xc1\x84'), '\144' + chr(101) + '\x63' + chr(0b10001 + 0o136) + '\144' + chr(0b1011010 + 0o13))('\x75' + '\164' + chr(0b1001000 + 0o36) + chr(206 - 161) + '\070')): ULnjp6D6efFH = ofnppgtaNcP6(ULnjp6D6efFH) return xafqLlk3kkUe(WqUC3KWvYVup.asarray(ULnjp6D6efFH, dtype=JqBUAP3FsaDz).astype(hhxuXgoHk9_L), xafqLlk3kkUe(SXOLrMavuUCe(b'7X\xf6^\xbe\x05\xac'), '\144' + chr(0b101 + 0o140) + '\x63' + '\157' + '\x64' + '\x65')(chr(0b1110101) + chr(0b1101001 + 0o13) + chr(102) + '\x2d' + chr(56)))(RbZ6GZw6Nz_V)
onnx/onnx
onnx/numpy_helper.py
from_array
def from_array(arr, name=None): # type: (np.ndarray[Any], Optional[Text]) -> TensorProto """Converts a numpy array to a tensor def. Inputs: arr: a numpy array. name: (optional) the name of the tensor. Returns: tensor_def: the converted tensor def. """ tensor = TensorProto() tensor.dims.extend(arr.shape) if name: tensor.name = name if arr.dtype == np.object: # Special care for strings. tensor.data_type = mapping.NP_TYPE_TO_TENSOR_TYPE[arr.dtype] # TODO: Introduce full string support. # We flatten the array in case there are 2-D arrays are specified # We throw the error below if we have a 3-D array or some kind of other # object. If you want more complex shapes then follow the below instructions. # Unlike other types where the shape is automatically inferred from # nested arrays of values, the only reliable way now to feed strings # is to put them into a flat array then specify type astype(np.object) # (otherwise all strings may have different types depending on their length) # and then specify shape .reshape([x, y, z]) flat_array = arr.flatten() for e in flat_array: if isinstance(e, text_type): tensor.string_data.append(e.encode('utf-8')) elif isinstance(e, np.ndarray): for s in e: if isinstance(s, text_type): tensor.string_data.append(s.encode('utf-8')) else: raise NotImplementedError( "Unrecognized object in the object array, expect a string, or array of bytes: ", str(type(e))) return tensor # For numerical types, directly use numpy raw bytes. try: dtype = mapping.NP_TYPE_TO_TENSOR_TYPE[arr.dtype] except KeyError: raise RuntimeError( "Numpy data type not understood yet: {}".format(str(arr.dtype))) tensor.data_type = dtype tensor.raw_data = arr.tobytes() # note: tobytes() is only after 1.9. return tensor
python
def from_array(arr, name=None): # type: (np.ndarray[Any], Optional[Text]) -> TensorProto """Converts a numpy array to a tensor def. Inputs: arr: a numpy array. name: (optional) the name of the tensor. Returns: tensor_def: the converted tensor def. """ tensor = TensorProto() tensor.dims.extend(arr.shape) if name: tensor.name = name if arr.dtype == np.object: # Special care for strings. tensor.data_type = mapping.NP_TYPE_TO_TENSOR_TYPE[arr.dtype] # TODO: Introduce full string support. # We flatten the array in case there are 2-D arrays are specified # We throw the error below if we have a 3-D array or some kind of other # object. If you want more complex shapes then follow the below instructions. # Unlike other types where the shape is automatically inferred from # nested arrays of values, the only reliable way now to feed strings # is to put them into a flat array then specify type astype(np.object) # (otherwise all strings may have different types depending on their length) # and then specify shape .reshape([x, y, z]) flat_array = arr.flatten() for e in flat_array: if isinstance(e, text_type): tensor.string_data.append(e.encode('utf-8')) elif isinstance(e, np.ndarray): for s in e: if isinstance(s, text_type): tensor.string_data.append(s.encode('utf-8')) else: raise NotImplementedError( "Unrecognized object in the object array, expect a string, or array of bytes: ", str(type(e))) return tensor # For numerical types, directly use numpy raw bytes. try: dtype = mapping.NP_TYPE_TO_TENSOR_TYPE[arr.dtype] except KeyError: raise RuntimeError( "Numpy data type not understood yet: {}".format(str(arr.dtype))) tensor.data_type = dtype tensor.raw_data = arr.tobytes() # note: tobytes() is only after 1.9. return tensor
[ "def", "from_array", "(", "arr", ",", "name", "=", "None", ")", ":", "# type: (np.ndarray[Any], Optional[Text]) -> TensorProto", "tensor", "=", "TensorProto", "(", ")", "tensor", ".", "dims", ".", "extend", "(", "arr", ".", "shape", ")", "if", "name", ":", "tensor", ".", "name", "=", "name", "if", "arr", ".", "dtype", "==", "np", ".", "object", ":", "# Special care for strings.", "tensor", ".", "data_type", "=", "mapping", ".", "NP_TYPE_TO_TENSOR_TYPE", "[", "arr", ".", "dtype", "]", "# TODO: Introduce full string support.", "# We flatten the array in case there are 2-D arrays are specified", "# We throw the error below if we have a 3-D array or some kind of other", "# object. If you want more complex shapes then follow the below instructions.", "# Unlike other types where the shape is automatically inferred from", "# nested arrays of values, the only reliable way now to feed strings", "# is to put them into a flat array then specify type astype(np.object)", "# (otherwise all strings may have different types depending on their length)", "# and then specify shape .reshape([x, y, z])", "flat_array", "=", "arr", ".", "flatten", "(", ")", "for", "e", "in", "flat_array", ":", "if", "isinstance", "(", "e", ",", "text_type", ")", ":", "tensor", ".", "string_data", ".", "append", "(", "e", ".", "encode", "(", "'utf-8'", ")", ")", "elif", "isinstance", "(", "e", ",", "np", ".", "ndarray", ")", ":", "for", "s", "in", "e", ":", "if", "isinstance", "(", "s", ",", "text_type", ")", ":", "tensor", ".", "string_data", ".", "append", "(", "s", ".", "encode", "(", "'utf-8'", ")", ")", "else", ":", "raise", "NotImplementedError", "(", "\"Unrecognized object in the object array, expect a string, or array of bytes: \"", ",", "str", "(", "type", "(", "e", ")", ")", ")", "return", "tensor", "# For numerical types, directly use numpy raw bytes.", "try", ":", "dtype", "=", "mapping", ".", "NP_TYPE_TO_TENSOR_TYPE", "[", "arr", ".", "dtype", "]", "except", "KeyError", ":", "raise", "RuntimeError", "(", "\"Numpy data type not understood yet: {}\"", ".", "format", "(", "str", "(", "arr", ".", "dtype", ")", ")", ")", "tensor", ".", "data_type", "=", "dtype", "tensor", ".", "raw_data", "=", "arr", ".", "tobytes", "(", ")", "# note: tobytes() is only after 1.9.", "return", "tensor" ]
Converts a numpy array to a tensor def. Inputs: arr: a numpy array. name: (optional) the name of the tensor. Returns: tensor_def: the converted tensor def.
[ "Converts", "a", "numpy", "array", "to", "a", "tensor", "def", "." ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/numpy_helper.py#L69-L117
train
Converts a numpy array to a tensor def.
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,jIl9q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OH72k,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) + '\x33' + '\x37' + chr(0b10001 + 0o37), ord("\x08")), ehT0Px3KOsy9('\060' + chr(4931 - 4820) + '\063' + chr(50) + chr(458 - 410), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(1980 - 1927) + '\061', 0o10), ehT0Px3KOsy9(chr(1483 - 1435) + '\157' + '\x33' + '\x36' + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1670 - 1620) + '\x37' + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(8802 - 8691) + chr(0b110001) + chr(2262 - 2208) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(6149 - 6038) + '\063' + chr(0b11010 + 0o26), 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(9060 - 8949) + chr(0b110010) + chr(0b110000 + 0o1), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(9623 - 9512) + '\063' + chr(0b100010 + 0o24) + '\065', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + '\x30' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1101111) + chr(0b110011) + chr(51) + chr(589 - 535), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(2238 - 2184) + chr(0b10100 + 0o34), 25224 - 25216), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(0b110 + 0o60) + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(281 - 228) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(8416 - 8305) + chr(0b100110 + 0o13) + chr(55) + chr(51), 61700 - 61692), ehT0Px3KOsy9('\x30' + chr(0b111110 + 0o61) + '\061' + chr(0b11100 + 0o33) + chr(0b110000 + 0o1), 29630 - 29622), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(0b100110 + 0o12) + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10000 + 0o137) + chr(0b110011) + chr(53) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(1721 - 1670) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + '\x33' + chr(54) + chr(1942 - 1893), 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\157' + chr(0b110001) + chr(0b110100) + chr(0b10100 + 0o42), 16693 - 16685), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(0b101100 + 0o6) + chr(1148 - 1096), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100110 + 0o21) + '\x30', 4572 - 4564), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(2161 - 2108) + chr(0b10 + 0o57), 8), ehT0Px3KOsy9(chr(494 - 446) + '\x6f' + chr(0b110001) + chr(0b110101) + chr(1676 - 1627), 8), ehT0Px3KOsy9('\060' + chr(9891 - 9780) + '\062' + chr(0b110000 + 0o4) + '\061', 0b1000), ehT0Px3KOsy9(chr(1194 - 1146) + '\x6f' + '\x31' + chr(2298 - 2249) + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + chr(0b1011001 + 0o26) + chr(50) + '\x36' + chr(0b1 + 0o65), ord("\x08")), ehT0Px3KOsy9('\060' + chr(6782 - 6671) + '\061' + chr(342 - 294) + chr(48), 33148 - 33140), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(0b10101 + 0o36) + chr(1468 - 1420), 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\x6f' + chr(0b1101 + 0o46) + chr(54) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b101 + 0o152) + chr(521 - 470) + '\060' + '\063', 49518 - 49510), ehT0Px3KOsy9(chr(59 - 11) + chr(111) + chr(0b110011) + chr(0b110100 + 0o0) + chr(0b101110 + 0o7), 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\157' + '\x33' + chr(0b110111) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b100010 + 0o20) + chr(446 - 394) + chr(0b11 + 0o60), ord("\x08")), ehT0Px3KOsy9(chr(1750 - 1702) + chr(5257 - 5146) + '\061' + '\065' + '\065', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100110 + 0o13) + '\x31' + chr(49), 0o10), ehT0Px3KOsy9('\060' + chr(9344 - 9233) + '\x33' + '\060' + chr(698 - 644), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1924 - 1875) + '\062' + '\x31', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(49) + '\063', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1111 + 0o140) + '\065' + '\x30', 5009 - 5001)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6'), '\x64' + '\145' + '\143' + '\157' + chr(0b100110 + 0o76) + '\x65')(chr(0b1100110 + 0o17) + chr(0b1110100) + chr(6206 - 6104) + '\x2d' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ZTBR9CPkGtZ8(ZxkNvNvuRNy5, AIvJRzLdDfgF=None): LK3cpXJU3UM0 = OQJZWUVbJZfJ() xafqLlk3kkUe(LK3cpXJU3UM0.dims, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d\xa8\x1d\x90\xd7\x11'), '\144' + chr(0b1010001 + 0o24) + '\143' + chr(0b1010011 + 0o34) + chr(0b1100100) + '\145')(chr(117) + '\164' + '\146' + '\055' + '\x38'))(xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x96\xb1\x1c\xac\xdf9\x7f}\xa13\xbd\xd2'), chr(5668 - 5568) + chr(5375 - 5274) + '\143' + '\157' + chr(0b1100100) + '\x65')('\x75' + chr(0b1110100) + '\x66' + '\055' + chr(0b1100 + 0o54)))) if AIvJRzLdDfgF: LK3cpXJU3UM0.AIvJRzLdDfgF = AIvJRzLdDfgF if xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\x83?\xcc\xf0>vt\x98\x0b\xe9\xfb'), chr(100) + chr(9379 - 9278) + '\x63' + chr(0b10011 + 0o134) + '\144' + chr(0b1100101))('\x75' + '\164' + '\x66' + '\x2d' + chr(56))) == xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x97\xb2\x03\x90\xda\x01'), '\x64' + chr(0b1101 + 0o130) + chr(6417 - 6318) + '\x6f' + '\x64' + chr(7233 - 7132))(chr(1585 - 1468) + '\x74' + '\146' + chr(45) + chr(56))): LK3cpXJU3UM0.AgpR_GYuh7E5 = lDyiwdy_JhxC.NP_TYPE_TO_TENSOR_TYPE[ZxkNvNvuRNy5.jSV9IKnemH7K] HLIdZv74Zqwc = ZxkNvNvuRNy5.flatten() for GlnVAPeT6CUe in HLIdZv74Zqwc: if PlSM16l2KDPD(GlnVAPeT6CUe, q1MiJcALIjIZ): xafqLlk3kkUe(LK3cpXJU3UM0.string_data, xafqLlk3kkUe(SXOLrMavuUCe(b'\x99\xa0\x19\x90\xd7\x11'), chr(100) + chr(4253 - 4152) + '\143' + chr(0b1100010 + 0o15) + chr(7852 - 7752) + '\145')(chr(0b1110101) + chr(116) + chr(102) + chr(1274 - 1229) + chr(0b1000 + 0o60)))(xafqLlk3kkUe(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d\xbe\n\x9a\xdd\x10'), chr(0b10011 + 0o121) + chr(0b1010110 + 0o17) + chr(0b1100011) + '\157' + chr(100) + chr(0b11100 + 0o111))(chr(9659 - 9542) + chr(116) + '\x66' + chr(0b101101) + chr(0b110110 + 0o2)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8d\xa4\x0f\xd8\x81'), chr(0b1100100) + '\145' + chr(9244 - 9145) + chr(111) + chr(4516 - 4416) + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(0b110110 + 0o60) + chr(45) + chr(56)))) elif PlSM16l2KDPD(GlnVAPeT6CUe, xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x96\xb4\x08\x87\xcb\x14a'), chr(0b1011011 + 0o11) + chr(101) + chr(99) + chr(0b11 + 0o154) + chr(0b1001000 + 0o34) + chr(101))(chr(3913 - 3796) + chr(0b1110100) + '\146' + '\x2d' + '\x38'))): for vGrByMSYMp9h in GlnVAPeT6CUe: if PlSM16l2KDPD(vGrByMSYMp9h, q1MiJcALIjIZ): xafqLlk3kkUe(LK3cpXJU3UM0.string_data, xafqLlk3kkUe(SXOLrMavuUCe(b'\x99\xa0\x19\x90\xd7\x11'), chr(100) + chr(5100 - 4999) + chr(7546 - 7447) + chr(4873 - 4762) + '\x64' + chr(101))(chr(117) + chr(767 - 651) + '\146' + chr(744 - 699) + chr(0b111000)))(xafqLlk3kkUe(vGrByMSYMp9h, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d\xbe\n\x9a\xdd\x10'), chr(100) + chr(0b1100101) + chr(7302 - 7203) + '\157' + '\x64' + chr(0b1100101))('\x75' + chr(116) + chr(8625 - 8523) + chr(45) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8d\xa4\x0f\xd8\x81'), '\x64' + '\x65' + chr(5126 - 5027) + chr(111) + '\x64' + '\x65')(chr(0b1011110 + 0o27) + '\164' + chr(0b1100110) + chr(0b100000 + 0o15) + chr(487 - 431)))) else: raise _zJ24Vce7wp0(xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xbe\x1b\x90\xda\x1a\x7f\x7f\x9c9\xbb\xd4\x95\x07\x19\x13\xe5\x8e)\xd1\x0f:\x18\x1d\x01\xc4k\xd9"\xb2\x92\xa0\x91\xdc\xc2\x1f;\xa7(\'\xd8\xb5\x11\x85\xdc\x16l1\x94c\xad\xc4\xc7\x01\x15\x1e\xac\xcd2\x83F5J\x1b\x08\xd8k\xd9&\xf8\x95\xba\x91\x99\xd0Wi'), chr(0b1100100) + chr(0b10110 + 0o117) + '\143' + chr(1415 - 1304) + chr(2983 - 2883) + chr(0b100111 + 0o76))(chr(117) + chr(116) + '\146' + chr(833 - 788) + '\x38'), M8_cKLkHVB2V(wmQmyeWBmUpv(GlnVAPeT6CUe))) return LK3cpXJU3UM0 try: jSV9IKnemH7K = lDyiwdy_JhxC.NP_TYPE_TO_TENSOR_TYPE[ZxkNvNvuRNy5.jSV9IKnemH7K] except RQ6CSRrFArYB: raise n0ZkatoveZpF(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6\xa5\x04\x85\xc0U|p\x81"\xfe\xc4\xcc\x18\x1eY\xee\x82)\xd1\x13:\\\x0c\x1b\xd2?\xd9/\xbc\xd7\xba\x80\x88\x99M2\xbb'), chr(0b1100000 + 0o4) + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(2890 - 2790) + chr(101))(chr(117) + chr(0b1110100) + chr(102) + '\055' + chr(2586 - 2530)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xe4\x1b\x9a\xf1\x14K"\xa53\xbb\xda'), '\x64' + chr(0b1100101) + '\x63' + chr(0b1101111) + '\144' + chr(0b111000 + 0o55))(chr(0b101 + 0o160) + chr(116) + chr(120 - 18) + chr(0b11000 + 0o25) + '\070'))(M8_cKLkHVB2V(xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\x83?\xcc\xf0>vt\x98\x0b\xe9\xfb'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(100) + '\145')(chr(0b1110101) + chr(2243 - 2127) + '\146' + chr(0b101101) + chr(0b111000)))))) LK3cpXJU3UM0.AgpR_GYuh7E5 = jSV9IKnemH7K LK3cpXJU3UM0.LjisoG1znXxU = ZxkNvNvuRNy5.tobytes() return LK3cpXJU3UM0
onnx/onnx
onnx/__init__.py
_serialize
def _serialize(proto): # type: (Union[bytes, google.protobuf.message.Message]) -> bytes ''' Serialize a in-memory proto to bytes @params proto is a in-memory proto, such as a ModelProto, TensorProto, etc @return Serialized proto in bytes ''' if isinstance(proto, bytes): return proto elif hasattr(proto, 'SerializeToString') and callable(proto.SerializeToString): result = proto.SerializeToString() return result else: raise ValueError('No SerializeToString method is detected. ' 'neither proto is a str.\ntype is {}'.format(type(proto)))
python
def _serialize(proto): # type: (Union[bytes, google.protobuf.message.Message]) -> bytes ''' Serialize a in-memory proto to bytes @params proto is a in-memory proto, such as a ModelProto, TensorProto, etc @return Serialized proto in bytes ''' if isinstance(proto, bytes): return proto elif hasattr(proto, 'SerializeToString') and callable(proto.SerializeToString): result = proto.SerializeToString() return result else: raise ValueError('No SerializeToString method is detected. ' 'neither proto is a str.\ntype is {}'.format(type(proto)))
[ "def", "_serialize", "(", "proto", ")", ":", "# type: (Union[bytes, google.protobuf.message.Message]) -> bytes", "if", "isinstance", "(", "proto", ",", "bytes", ")", ":", "return", "proto", "elif", "hasattr", "(", "proto", ",", "'SerializeToString'", ")", "and", "callable", "(", "proto", ".", "SerializeToString", ")", ":", "result", "=", "proto", ".", "SerializeToString", "(", ")", "return", "result", "else", ":", "raise", "ValueError", "(", "'No SerializeToString method is detected. '", "'neither proto is a str.\\ntype is {}'", ".", "format", "(", "type", "(", "proto", ")", ")", ")" ]
Serialize a in-memory proto to bytes @params proto is a in-memory proto, such as a ModelProto, TensorProto, etc @return Serialized proto in bytes
[ "Serialize", "a", "in", "-", "memory", "proto", "to", "bytes" ]
2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4
https://github.com/onnx/onnx/blob/2f7dc10f03a072526d94b6820cedbf2a1ec5a2c4/onnx/__init__.py#L53-L70
train
Serialize a in - memory proto to bytes
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,bdLu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CViZiX,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(0b11011 + 0o27) + chr(0b110101) + '\x37', 37541 - 37533), ehT0Px3KOsy9('\x30' + chr(7609 - 7498) + '\x33' + '\067' + chr(1890 - 1835), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(10602 - 10491) + chr(0b110010) + '\066' + chr(50), 38817 - 38809), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\067' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101111 + 0o4) + chr(54) + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(1630 - 1581) + '\x32' + chr(2274 - 2226), 0o10), ehT0Px3KOsy9(chr(857 - 809) + chr(0b11100 + 0o123) + '\x31' + '\061' + chr(0b10000 + 0o44), ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101011 + 0o4) + chr(55) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b0 + 0o157) + chr(0b110001) + chr(0b110111) + '\061', 59921 - 59913), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + chr(0b11110 + 0o23) + chr(0b110110) + chr(0b110001), 59877 - 59869), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + '\066' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4455 - 4344) + '\063' + chr(426 - 374) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + '\063' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + '\x36' + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(997 - 946) + '\x31', 54239 - 54231), ehT0Px3KOsy9(chr(405 - 357) + chr(111) + chr(0b110011) + chr(1866 - 1813) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(9845 - 9734) + chr(1651 - 1598), 62171 - 62163), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b111001 + 0o66) + '\x33' + chr(0b110001) + '\x30', 13767 - 13759), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11010 + 0o35) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(49) + chr(662 - 609), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(7051 - 6940) + '\x33' + chr(50) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + chr(0b110010) + '\067' + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110100) + chr(1494 - 1446), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(0b110000) + '\060', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(518 - 469) + chr(0b11101 + 0o26) + chr(1870 - 1818), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + '\x32' + chr(0b10001 + 0o37), 42098 - 42090), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\064' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1011 + 0o47) + '\067' + '\x33', 62505 - 62497), ehT0Px3KOsy9(chr(639 - 591) + '\x6f' + chr(0b110001) + '\x30' + '\065', 31439 - 31431), ehT0Px3KOsy9('\060' + chr(111) + chr(123 - 74) + '\x31' + chr(0b110100), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(207 - 156) + chr(0b110110), 48588 - 48580), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + '\063' + '\x35' + chr(1343 - 1288), ord("\x08")), ehT0Px3KOsy9(chr(1496 - 1448) + chr(0b1101111) + '\x31' + chr(0b11 + 0o60) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(409 - 361) + chr(111) + chr(1027 - 977) + chr(2018 - 1963) + '\x37', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + '\061' + chr(0b101001 + 0o10), 0o10), ehT0Px3KOsy9(chr(1219 - 1171) + chr(0b1101111) + chr(2486 - 2435) + '\x33' + chr(0b110010), 8), ehT0Px3KOsy9(chr(1014 - 966) + chr(111) + chr(0b1101 + 0o44) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + '\x37' + chr(759 - 707), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(546 - 495) + '\x32' + chr(2135 - 2080), 8), ehT0Px3KOsy9('\x30' + chr(11110 - 10999) + chr(49) + chr(668 - 616) + '\x30', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1101111) + chr(2548 - 2495) + chr(421 - 373), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x81'), chr(0b1100100) + chr(0b1100101) + chr(0b10010 + 0o121) + chr(6658 - 6547) + '\x64' + '\145')(chr(0b1100100 + 0o21) + chr(0b10 + 0o162) + '\146' + chr(0b1100 + 0o41) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def FafGPp2Dvnci(EjgP3Uo4AYh3): if PlSM16l2KDPD(EjgP3Uo4AYh3, QOfmzcVJsrp8): return EjgP3Uo4AYh3 elif lot1PSoAwYhj(EjgP3Uo4AYh3, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfc\x9a\xc0V\x91<%F\x1c%\x9c\xb7\xae@\xf0\x86b'), chr(100) + '\x65' + chr(0b1100011) + chr(0b1101111) + chr(4465 - 4365) + chr(0b1001011 + 0o32))(chr(744 - 627) + chr(11590 - 11474) + chr(0b10000 + 0o126) + chr(0b101101) + '\x38')) and tzcpInYwBvYW(xafqLlk3kkUe(EjgP3Uo4AYh3, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfc\x9a\xc0V\x91<%F\x1c%\x9c\xb7\xae@\xf0\x86b'), '\144' + '\145' + chr(7153 - 7054) + '\x6f' + chr(0b1011000 + 0o14) + chr(9846 - 9745))(chr(117) + chr(0b11110 + 0o126) + '\146' + chr(407 - 362) + chr(56)))): ShZmEKfTkAOZ = EjgP3Uo4AYh3.SerializeToString() return ShZmEKfTkAOZ else: raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1\x90\x92l\x95"%]\x15\x18\x89\x81\x8e]\xca\x9cw\xa1U\xea\xf7\xd5E\xb44\xbf\x02\x9b,?>\x8b?\xcb\xac\xb9{\x19\xb3N\x8f\x91\xd7V\x848)NY\x01\x81\x8b\xae]\xb9\x81v\xe8Z\xad\xa4\xccR\xeeV\xa4\x1f\xcb lw\x9cz\xc4\xb4'), '\x64' + '\145' + chr(0b1011100 + 0o7) + chr(0b1101111) + chr(8931 - 8831) + chr(0b1000100 + 0o41))(chr(0b1100101 + 0o20) + '\164' + chr(10252 - 10150) + chr(1842 - 1797) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9\xcb\xc0P\xb81\x1f\x0f)\x01\x96\x8e'), '\x64' + chr(0b11010 + 0o113) + chr(0b101000 + 0o73) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(4502 - 4385) + '\x74' + chr(9221 - 9119) + chr(45) + chr(56)))(wmQmyeWBmUpv(EjgP3Uo4AYh3)))