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
ontio/ontology-python-sdk
ontology/io/binary_writer.py
BinaryWriter.write_var_bytes
def write_var_bytes(self, value, little_endian: bool = True): """ Write an integer value in a space saving way to the stream. :param value: :param little_endian: specify the endianness. (Default) Little endian. :return: int: the number of bytes written. """ length = len(value) self.write_var_int(length, little_endian) return self.write_bytes(value, to_bytes=False)
python
def write_var_bytes(self, value, little_endian: bool = True): """ Write an integer value in a space saving way to the stream. :param value: :param little_endian: specify the endianness. (Default) Little endian. :return: int: the number of bytes written. """ length = len(value) self.write_var_int(length, little_endian) return self.write_bytes(value, to_bytes=False)
[ "def", "write_var_bytes", "(", "self", ",", "value", ",", "little_endian", ":", "bool", "=", "True", ")", ":", "length", "=", "len", "(", "value", ")", "self", ".", "write_var_int", "(", "length", ",", "little_endian", ")", "return", "self", ".", "write_bytes", "(", "value", ",", "to_bytes", "=", "False", ")" ]
Write an integer value in a space saving way to the stream. :param value: :param little_endian: specify the endianness. (Default) Little endian. :return: int: the number of bytes written.
[ "Write", "an", "integer", "value", "in", "a", "space", "saving", "way", "to", "the", "stream", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_writer.py#L313-L323
train
Writes an integer value in a space saving way to the stream.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL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q,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1761 - 1710) + chr(54) + chr(0b110100 + 0o1), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(880 - 830) + chr(947 - 894) + '\060', 0o10), nzTpIcepk0o8('\x30' + '\157' + '\x33' + '\x37' + '\066', 24852 - 24844), nzTpIcepk0o8(chr(0b110000) + chr(0b1101001 + 0o6) + '\063' + chr(52) + '\x34', 45631 - 45623), nzTpIcepk0o8(chr(1844 - 1796) + chr(111) + chr(51) + chr(52) + chr(1375 - 1327), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(426 - 374) + '\066', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(1647 - 1592) + chr(52), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1122 - 1071) + chr(0b10111 + 0o32) + chr(0b110001 + 0o4), 0b1000), nzTpIcepk0o8('\x30' + chr(5366 - 5255) + chr(51) + '\x31' + '\060', ord("\x08")), nzTpIcepk0o8(chr(297 - 249) + chr(8304 - 8193) + '\064' + chr(53), 27714 - 27706), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110010) + chr(0b110000) + chr(48), 19689 - 19681), nzTpIcepk0o8(chr(0b110000) + chr(0b1011100 + 0o23) + '\063' + chr(48) + '\060', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\062' + chr(0b110100) + chr(0b101101 + 0o3), 8479 - 8471), nzTpIcepk0o8('\060' + '\x6f' + '\061' + chr(2225 - 2172) + chr(0b110101 + 0o0), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(51) + '\064' + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(141 - 93) + '\157' + chr(51) + '\060' + chr(0b10100 + 0o41), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(2803 - 2692) + chr(0b110010) + '\x37' + '\x37', 32382 - 32374), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\063' + chr(2524 - 2469) + chr(1286 - 1236), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110010) + chr(1871 - 1821) + chr(0b110110), 63393 - 63385), nzTpIcepk0o8('\x30' + '\157' + chr(0b110010) + '\x31' + '\x31', 44039 - 44031), nzTpIcepk0o8('\x30' + chr(111) + '\061' + '\x31' + '\x33', 48501 - 48493), nzTpIcepk0o8('\x30' + chr(0b111111 + 0o60) + chr(1333 - 1284) + '\x32', 0b1000), nzTpIcepk0o8(chr(1675 - 1627) + chr(3746 - 3635) + chr(0b110011) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(0b1101111) + chr(0b10111 + 0o32) + chr(50), 8), nzTpIcepk0o8(chr(2018 - 1970) + chr(0b1101111) + chr(1266 - 1215) + chr(53) + chr(0b110001), 0o10), nzTpIcepk0o8('\060' + chr(0b111001 + 0o66) + chr(0b101001 + 0o11) + chr(50) + chr(1643 - 1591), 0o10), nzTpIcepk0o8('\060' + chr(11496 - 11385) + '\061' + '\x35', 0o10), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(111) + '\x33' + chr(2150 - 2102) + chr(0b11100 + 0o33), ord("\x08")), nzTpIcepk0o8(chr(0b100111 + 0o11) + '\x6f' + chr(0b1010 + 0o47) + chr(0b101101 + 0o3), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b101011 + 0o6) + chr(0b110111) + chr(0b110 + 0o56), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(2325 - 2274) + '\065' + chr(1234 - 1183), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110001) + '\x35' + chr(0b101100 + 0o6), 53547 - 53539), nzTpIcepk0o8('\060' + chr(0b1101111) + '\063' + chr(0b101 + 0o61), 37914 - 37906), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110011) + chr(0b1111 + 0o47) + '\x31', 52679 - 52671), nzTpIcepk0o8('\060' + chr(111) + chr(0b11010 + 0o30) + chr(51) + chr(0b11100 + 0o31), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(242 - 188), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + chr(0b110101) + chr(52), ord("\x08")), nzTpIcepk0o8('\060' + chr(7336 - 7225) + chr(0b110010) + '\x34' + '\060', 8), nzTpIcepk0o8(chr(48) + '\157' + '\x33' + '\x33' + '\061', 32496 - 32488)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(683 - 635) + chr(0b1101111) + chr(1710 - 1657) + chr(48), 47826 - 47818)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'*'), chr(2220 - 2120) + '\x65' + '\143' + chr(111) + chr(0b1100100) + '\x65')(chr(0b1110101) + '\164' + chr(0b1100110) + '\055' + chr(0b100011 + 0o25)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def iR44mqfSNkFi(hXMPsSrOQzbh, uV9iBiw0y_Mp, TR9O9AaOWrcD=nzTpIcepk0o8(chr(48) + chr(1024 - 913) + chr(49), ord("\x08"))): a1RCQZREo3Kd = ftfygxgFas5X(uV9iBiw0y_Mp) roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b's\x87\xc1\x8a\x81\xbfP]\xbf\x97L\xee\xb4'), '\144' + '\x65' + chr(0b1100011) + chr(111) + '\144' + chr(7646 - 7545))(chr(117) + '\164' + chr(0b1100110) + '\x2d' + chr(0b100001 + 0o27)))(a1RCQZREo3Kd, TR9O9AaOWrcD) return roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b's\x87\xc1\x8a\x81\xbfDE\xb9\xadV'), chr(2515 - 2415) + chr(8864 - 8763) + '\143' + chr(4856 - 4745) + chr(0b1100100) + '\145')('\165' + '\164' + '\x66' + chr(0b101101) + chr(0b111000)))(uV9iBiw0y_Mp, to_bytes=nzTpIcepk0o8('\060' + chr(1756 - 1645) + '\060', 0b1000))
ontio/ontology-python-sdk
ontology/io/binary_writer.py
BinaryWriter.write_var_str
def write_var_str(self, value, encoding: str = 'utf-8'): """ Write a string value to the stream. :param value: value to write to the stream. :param encoding: string encoding format. """ if isinstance(value, str): value = value.encode(encoding) self.write_var_int(len(value)) self.write_bytes(value)
python
def write_var_str(self, value, encoding: str = 'utf-8'): """ Write a string value to the stream. :param value: value to write to the stream. :param encoding: string encoding format. """ if isinstance(value, str): value = value.encode(encoding) self.write_var_int(len(value)) self.write_bytes(value)
[ "def", "write_var_str", "(", "self", ",", "value", ",", "encoding", ":", "str", "=", "'utf-8'", ")", ":", "if", "isinstance", "(", "value", ",", "str", ")", ":", "value", "=", "value", ".", "encode", "(", "encoding", ")", "self", ".", "write_var_int", "(", "len", "(", "value", ")", ")", "self", ".", "write_bytes", "(", "value", ")" ]
Write a string value to the stream. :param value: value to write to the stream. :param encoding: string encoding format.
[ "Write", "a", "string", "value", "to", "the", "stream", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_writer.py#L325-L335
train
Writes a string value to the stream.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9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0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1505 - 1457) + '\157' + chr(49) + '\x32' + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(2417 - 2366) + '\x30' + chr(0b110101), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b10 + 0o57) + '\x30' + '\x31', 0b1000), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(0b1101111) + chr(0b110111) + chr(0b11001 + 0o33), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110010) + '\x34' + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(4337 - 4226) + '\063' + chr(0b110100) + chr(0b110101), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1568 - 1518) + '\x36' + chr(0b110011), 0b1000), nzTpIcepk0o8('\060' + chr(8242 - 8131) + chr(1237 - 1187) + chr(0b1001 + 0o53) + '\060', 8), nzTpIcepk0o8(chr(0b110000) + chr(0b111 + 0o150) + chr(0b101010 + 0o7) + chr(712 - 663) + chr(0b110010 + 0o5), 5808 - 5800), nzTpIcepk0o8('\x30' + '\x6f' + '\x31' + chr(0b110000 + 0o4) + '\061', ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\x32' + chr(0b10010 + 0o37) + '\x31', 0o10), nzTpIcepk0o8(chr(397 - 349) + chr(111) + '\x32' + chr(0b110111) + '\060', 0b1000), nzTpIcepk0o8('\060' + chr(0b11001 + 0o126) + '\063' + '\063' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(2282 - 2234) + chr(8077 - 7966) + '\067' + chr(0b100 + 0o57), 0o10), nzTpIcepk0o8('\x30' + chr(9820 - 9709) + chr(50) + '\063' + chr(0b1010 + 0o52), ord("\x08")), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(111) + chr(0b110101) + chr(48), 0b1000), nzTpIcepk0o8(chr(0b11001 + 0o27) + '\157' + '\061' + chr(0b100111 + 0o16) + chr(0b110011 + 0o0), 64902 - 64894), nzTpIcepk0o8(chr(0b110000) + chr(8147 - 8036) + '\063' + chr(0b100 + 0o55) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101000 + 0o7) + '\x33' + chr(572 - 521) + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b10000 + 0o40) + '\x6f' + chr(49) + chr(2882 - 2827), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b1110 + 0o51) + chr(1113 - 1060), 41758 - 41750), nzTpIcepk0o8(chr(48) + chr(6309 - 6198) + chr(0b110011) + chr(0b100110 + 0o13) + '\x35', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(51) + chr(52) + chr(0b110000), 50374 - 50366), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110010) + '\064', 0b1000), nzTpIcepk0o8('\x30' + chr(0b101100 + 0o103) + '\x33' + chr(50) + '\063', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\061' + chr(1657 - 1607) + chr(2820 - 2765), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(165 - 116) + '\065' + '\064', 38975 - 38967), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(111) + '\063' + chr(0b10010 + 0o41), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x32' + chr(0b110010) + '\065', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b11000 + 0o36) + chr(0b110000 + 0o2), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + '\x33' + '\x31' + chr(0b101101 + 0o6), 50266 - 50258), nzTpIcepk0o8('\060' + chr(12255 - 12144) + '\x32' + chr(53) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b110000 + 0o0) + '\157' + '\061' + chr(790 - 741) + chr(0b10010 + 0o43), 0o10), nzTpIcepk0o8(chr(48) + chr(0b110110 + 0o71) + chr(0b100111 + 0o13) + chr(183 - 135) + chr(51), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1011010 + 0o25) + chr(50) + '\x37' + '\x32', 0o10), nzTpIcepk0o8(chr(1917 - 1869) + chr(6594 - 6483) + chr(0b110001) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(111) + '\062' + chr(0b11011 + 0o25) + '\060', 0o10), nzTpIcepk0o8(chr(2000 - 1952) + chr(6913 - 6802) + '\062' + chr(50) + chr(0b110001), 12376 - 12368), nzTpIcepk0o8(chr(0b110000) + chr(9654 - 9543) + '\061' + chr(0b101100 + 0o11) + '\063', 8), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + '\x34' + chr(0b110011), 56478 - 56470)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\x6f' + '\065' + '\x30', 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'z'), chr(7700 - 7600) + chr(1870 - 1769) + chr(5439 - 5340) + '\x6f' + '\144' + chr(0b10001 + 0o124))('\x75' + chr(0b11111 + 0o125) + '\146' + chr(0b101101) + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Qa4VTEhYgkWh(hXMPsSrOQzbh, uV9iBiw0y_Mp, rt5yMsH2WFRk=roI3spqORKae(ES5oEprVxulp(b"!\xb1'\x11\x98"), chr(0b1100100) + chr(2709 - 2608) + chr(99) + chr(111) + chr(7120 - 7020) + '\x65')('\165' + chr(7244 - 7128) + chr(102) + chr(0b10110 + 0o27) + chr(790 - 734))): if suIjIS24Zkqw(uV9iBiw0y_Mp, N9zlRy29S1SS): uV9iBiw0y_Mp = uV9iBiw0y_Mp.YqIaRFfeo4Ha(rt5yMsH2WFRk) roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'#\xb7(H\xc5\xba\xc5\xc1=>\xe0\xd6\xae'), chr(0b1100100) + '\x65' + '\143' + '\x6f' + chr(0b1100100) + chr(0b1100101))('\165' + '\164' + '\x66' + chr(0b100011 + 0o12) + chr(0b111000)))(ftfygxgFas5X(uV9iBiw0y_Mp)) roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'#\xb7(H\xc5\xba\xd1\xd9;\x04\xfa'), chr(0b1000011 + 0o41) + chr(6355 - 6254) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(0b1000011 + 0o42))(chr(11080 - 10963) + chr(0b1101 + 0o147) + chr(102) + chr(45) + chr(0b111000)))(uV9iBiw0y_Mp)
ontio/ontology-python-sdk
ontology/io/binary_writer.py
BinaryWriter.write_fixed_str
def write_fixed_str(self, value, length): """ Write a string value to the stream. Args: value (str): value to write to the stream. length (int): length of the string to write. """ towrite = value.encode('utf-8') slen = len(towrite) if slen > length: raise SDKException(ErrorCode.param_err('string longer than fixed length: %s' % length)) self.write_bytes(towrite) diff = length - slen while diff > 0: self.write_byte(0) diff -= 1
python
def write_fixed_str(self, value, length): """ Write a string value to the stream. Args: value (str): value to write to the stream. length (int): length of the string to write. """ towrite = value.encode('utf-8') slen = len(towrite) if slen > length: raise SDKException(ErrorCode.param_err('string longer than fixed length: %s' % length)) self.write_bytes(towrite) diff = length - slen while diff > 0: self.write_byte(0) diff -= 1
[ "def", "write_fixed_str", "(", "self", ",", "value", ",", "length", ")", ":", "towrite", "=", "value", ".", "encode", "(", "'utf-8'", ")", "slen", "=", "len", "(", "towrite", ")", "if", "slen", ">", "length", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_err", "(", "'string longer than fixed length: %s'", "%", "length", ")", ")", "self", ".", "write_bytes", "(", "towrite", ")", "diff", "=", "length", "-", "slen", "while", "diff", ">", "0", ":", "self", ".", "write_byte", "(", "0", ")", "diff", "-=", "1" ]
Write a string value to the stream. Args: value (str): value to write to the stream. length (int): length of the string to write.
[ "Write", "a", "string", "value", "to", "the", "stream", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_writer.py#L337-L354
train
This interface is used to write a string value to the stream.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedr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0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(2698 - 2587) + chr(51) + chr(50) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(2023 - 1975) + chr(3094 - 2983) + chr(1576 - 1527) + chr(0b110011) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x33' + '\x33' + '\x35', 0b1000), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b1000010 + 0o55) + '\x32' + '\064' + chr(0b10010 + 0o40), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b11100 + 0o123) + chr(0b110010 + 0o0) + '\x35' + chr(55), 56312 - 56304), nzTpIcepk0o8('\x30' + chr(8794 - 8683) + '\x31' + chr(0b1010 + 0o50) + chr(0b10100 + 0o40), 0o10), nzTpIcepk0o8('\x30' + chr(4635 - 4524) + chr(0b110010) + chr(553 - 500) + chr(55), 8), nzTpIcepk0o8(chr(0b110000) + chr(8763 - 8652) + chr(903 - 853) + chr(55) + chr(51), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x32' + '\066' + chr(0b110100), 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(111) + chr(1057 - 1008) + chr(0b110010) + chr(0b11101 + 0o26), 12445 - 12437), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\063' + chr(49) + '\x37', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b111 + 0o150) + '\x33' + chr(0b101110 + 0o2) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(0b111 + 0o150) + '\x32' + chr(48) + chr(0b100111 + 0o12), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\063' + chr(0b110010), 0o10), nzTpIcepk0o8(chr(48) + chr(0b11110 + 0o121) + '\x33' + '\066' + '\067', ord("\x08")), nzTpIcepk0o8(chr(1916 - 1868) + chr(111) + chr(0b1101 + 0o46) + chr(0b110110) + chr(0b110011), 33715 - 33707), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b111 + 0o52) + chr(0b100011 + 0o17) + chr(0b11100 + 0o25), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\062' + '\060' + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(0b1101111) + chr(1692 - 1643) + chr(2071 - 2021) + chr(1841 - 1793), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\063' + '\x33' + chr(48), 31044 - 31036), nzTpIcepk0o8(chr(0b11101 + 0o23) + '\157' + '\063' + '\x37' + '\x36', 0b1000), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(111) + '\061' + chr(0b1000 + 0o53) + chr(1578 - 1528), 8), nzTpIcepk0o8(chr(460 - 412) + chr(111) + chr(51) + chr(2374 - 2324) + '\064', 0b1000), nzTpIcepk0o8(chr(0b101111 + 0o1) + '\x6f' + chr(50) + chr(0b110001) + chr(259 - 210), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(534 - 483) + '\x32' + '\063', 0o10), nzTpIcepk0o8(chr(285 - 237) + chr(7817 - 7706) + chr(333 - 282) + '\x34' + chr(0b110010), 3872 - 3864), nzTpIcepk0o8(chr(48) + '\x6f' + chr(49) + chr(1876 - 1821) + chr(0b110011), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(1363 - 1310) + '\062', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b1111 + 0o44) + '\066' + chr(0b110000), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(51) + chr(0b110110) + '\067', 8), nzTpIcepk0o8(chr(48) + '\x6f' + '\x37' + chr(1278 - 1226), 0o10), nzTpIcepk0o8(chr(0b100 + 0o54) + '\x6f' + chr(0b10000 + 0o47) + chr(0b10001 + 0o37), ord("\x08")), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1101111) + chr(0b110011) + chr(0b10011 + 0o44) + chr(0b110000), 17771 - 17763), nzTpIcepk0o8('\060' + '\157' + '\063' + chr(0b110000) + chr(0b1101 + 0o47), 8), nzTpIcepk0o8('\060' + '\157' + '\063' + chr(49) + chr(49), 0b1000), nzTpIcepk0o8('\x30' + chr(8336 - 8225) + chr(49) + chr(2264 - 2210) + chr(2545 - 2492), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110010) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1011011 + 0o24) + chr(0b110001) + '\x30', 0b1000), nzTpIcepk0o8(chr(0b11100 + 0o24) + '\x6f' + '\061' + chr(0b110110 + 0o1) + chr(0b101000 + 0o12), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(5228 - 5117) + '\065' + chr(0b1101 + 0o43), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xf9'), '\144' + '\x65' + chr(0b111110 + 0o45) + chr(111) + chr(0b1100100) + '\145')(chr(0b111101 + 0o70) + chr(2399 - 2283) + chr(102) + chr(0b10011 + 0o32) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def kurmevG1X8ET(hXMPsSrOQzbh, uV9iBiw0y_Mp, a1RCQZREo3Kd): Rf60lISnVaPt = uV9iBiw0y_Mp.YqIaRFfeo4Ha(roI3spqORKae(ES5oEprVxulp(b'\xa2.\xbb\x8f\x97'), chr(0b110011 + 0o61) + '\145' + chr(0b1100011) + '\157' + '\144' + '\145')(chr(10591 - 10474) + chr(0b1110100) + chr(102) + '\x2d' + '\070')) zwDLa7iWlFQ3 = ftfygxgFas5X(Rf60lISnVaPt) if zwDLa7iWlFQ3 > a1RCQZREo3Kd: raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'\xa7;\xaf\xc3\xc2\x0b\xca\xc9\xc6'), '\x64' + chr(351 - 250) + chr(3272 - 3173) + '\x6f' + '\144' + chr(101))(chr(117) + '\164' + chr(102) + '\x2d' + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'\xa4.\xaf\xcb\xc13\x8f\xd7\xdbm4\xaa\xb6\xa1n\x9f\x92?\xa36\xb1\x86?\xb0\xa9\xbf\x87\x15\xcd\x84\x9f\x06\x18\xdd\xb7'), chr(100) + chr(0b1100101) + chr(99) + chr(6610 - 6499) + chr(100) + '\x65')(chr(10109 - 9992) + '\x74' + '\146' + chr(213 - 168) + chr(56)) % a1RCQZREo3Kd)) roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xa0(\xb4\xd6\xca\x0b\xcd\xc2\xc0f '), '\144' + chr(0b110110 + 0o57) + chr(99) + chr(0b1101111) + chr(8187 - 8087) + chr(1806 - 1705))(chr(0b1110101) + chr(0b1110100) + chr(3729 - 3627) + '\055' + chr(0b111000)))(Rf60lISnVaPt) H5XQ4iF_jpSm = a1RCQZREo3Kd - zwDLa7iWlFQ3 while H5XQ4iF_jpSm > nzTpIcepk0o8(chr(48) + chr(6629 - 6518) + chr(0b101100 + 0o4), ord("\x08")): roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xa0(\xb4\xd6\xca\x0b\xcd\xc2\xc0f'), '\x64' + '\x65' + chr(99) + chr(0b1101011 + 0o4) + '\x64' + chr(2141 - 2040))('\x75' + chr(116) + chr(0b1100110) + chr(0b100101 + 0o10) + chr(56)))(nzTpIcepk0o8(chr(0b110000) + chr(0b11000 + 0o127) + chr(808 - 760), 8)) H5XQ4iF_jpSm -= nzTpIcepk0o8(chr(0b111 + 0o51) + chr(0b1001100 + 0o43) + '\061', ord("\x08"))
ontio/ontology-python-sdk
ontology/io/binary_writer.py
BinaryWriter.write_serializable_array
def write_serializable_array(self, array): """ Write an array of serializable objects to the stream. Args: array(list): a list of serializable objects. i.e. extending neo.IO.Mixins.SerializableMixin """ if array is None: self.write_byte(0) else: self.write_var_int(len(array)) for item in array: item.Serialize(self)
python
def write_serializable_array(self, array): """ Write an array of serializable objects to the stream. Args: array(list): a list of serializable objects. i.e. extending neo.IO.Mixins.SerializableMixin """ if array is None: self.write_byte(0) else: self.write_var_int(len(array)) for item in array: item.Serialize(self)
[ "def", "write_serializable_array", "(", "self", ",", "array", ")", ":", "if", "array", "is", "None", ":", "self", ".", "write_byte", "(", "0", ")", "else", ":", "self", ".", "write_var_int", "(", "len", "(", "array", ")", ")", "for", "item", "in", "array", ":", "item", ".", "Serialize", "(", "self", ")" ]
Write an array of serializable objects to the stream. Args: array(list): a list of serializable objects. i.e. extending neo.IO.Mixins.SerializableMixin
[ "Write", "an", "array", "of", "serializable", "objects", "to", "the", "stream", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_writer.py#L356-L368
train
Writes an array of serializable objects to the stream.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBL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ildProcessError,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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(111) + chr(0b1011 + 0o46) + chr(711 - 660) + '\x33', 0o10), nzTpIcepk0o8('\060' + chr(111) + '\x32' + '\x35', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1861 - 1811) + chr(0b110011) + chr(55), 31572 - 31564), nzTpIcepk0o8('\x30' + chr(12156 - 12045) + chr(51) + chr(0b110001) + chr(0b110001), 0b1000), nzTpIcepk0o8('\060' + chr(0b1100010 + 0o15) + chr(0b101010 + 0o7) + '\063' + chr(0b1000 + 0o50), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\x33' + '\066' + chr(0b110101), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001) + '\064' + '\067', 0b1000), nzTpIcepk0o8(chr(2048 - 2000) + chr(12276 - 12165) + chr(2408 - 2358) + chr(0b1101 + 0o51) + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(111) + chr(0b110011) + '\062' + chr(49), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\062' + '\x33', 60833 - 60825), nzTpIcepk0o8('\x30' + chr(8516 - 8405) + chr(579 - 529) + chr(1195 - 1145) + '\x30', ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(53) + chr(55), 0b1000), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(0b10000 + 0o137) + '\062' + chr(54) + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\060' + chr(3799 - 3688) + chr(1941 - 1890) + '\x30' + '\x32', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x31' + '\060' + chr(0b11111 + 0o21), 0b1000), nzTpIcepk0o8(chr(2297 - 2249) + chr(0b1101111) + chr(0b101000 + 0o12) + chr(53) + chr(53), 0o10), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(0b1101111) + chr(0b110011) + chr(0b10110 + 0o36) + '\065', 2065 - 2057), nzTpIcepk0o8('\x30' + chr(111) + chr(1353 - 1300) + chr(505 - 451), 35811 - 35803), nzTpIcepk0o8(chr(980 - 932) + chr(111) + chr(0b110010 + 0o1) + chr(51) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(111) + chr(0b1100 + 0o45) + '\067' + chr(0b101011 + 0o10), 0b1000), nzTpIcepk0o8(chr(0b101011 + 0o5) + '\x6f' + '\x31' + chr(687 - 637), 37365 - 37357), nzTpIcepk0o8(chr(605 - 557) + '\157' + chr(0b110010) + chr(0b110101 + 0o1) + chr(0b110011), 15324 - 15316), nzTpIcepk0o8(chr(0b110000) + chr(2285 - 2174) + chr(51) + chr(2294 - 2241) + chr(256 - 208), ord("\x08")), nzTpIcepk0o8(chr(2164 - 2116) + chr(11996 - 11885) + '\x37' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(418 - 370) + '\157' + chr(50) + '\x30' + chr(0b10011 + 0o40), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\063' + chr(0b110001 + 0o5) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(5877 - 5766) + chr(1459 - 1408) + '\063' + chr(53), 0o10), nzTpIcepk0o8(chr(661 - 613) + chr(0b1101111) + chr(0b101001 + 0o10) + '\060' + chr(0b110011 + 0o0), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1110 + 0o141) + chr(0b1010 + 0o50) + '\x34' + chr(0b110011), 0o10), nzTpIcepk0o8(chr(0b0 + 0o60) + '\x6f' + chr(0b10011 + 0o36) + chr(0b110011) + chr(0b110010), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\x32' + '\065', 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b11100 + 0o26) + '\x37' + '\060', ord("\x08")), nzTpIcepk0o8('\x30' + chr(1211 - 1100) + '\062' + chr(0b101111 + 0o3) + chr(1578 - 1523), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(4025 - 3914) + chr(0b1000 + 0o52) + chr(55) + '\062', 0o10), nzTpIcepk0o8(chr(48) + chr(9952 - 9841) + chr(0b110101) + chr(0b1111 + 0o45), ord("\x08")), nzTpIcepk0o8(chr(0b110 + 0o52) + '\x6f' + chr(0b110010) + '\x31' + chr(50), 37533 - 37525), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + '\060' + chr(0b1101 + 0o47), 15559 - 15551), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(111) + '\x33' + '\063' + '\x34', 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\063' + chr(0b11 + 0o56) + '\063', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(2014 - 1965) + '\065' + '\062', 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1515 - 1467) + '\x6f' + '\x35' + '\x30', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'u'), '\x64' + chr(0b10100 + 0o121) + chr(99) + chr(0b110111 + 0o70) + '\144' + chr(0b1100101))(chr(0b10001 + 0o144) + '\x74' + chr(6474 - 6372) + '\055' + chr(0b11111 + 0o31)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def jiluTkdmdA_4(hXMPsSrOQzbh, Tn6rGr7XTM7t): if Tn6rGr7XTM7t is None: roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b',g\xf6\xbd=\xaa\x05\xcf\xa5v'), chr(100) + chr(101) + chr(8484 - 8385) + '\x6f' + '\x64' + '\145')(chr(0b1110101) + '\x74' + '\x66' + '\x2d' + chr(1214 - 1158)))(nzTpIcepk0o8(chr(1889 - 1841) + chr(0b1001000 + 0o47) + '\060', 0b1000)) else: roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b',g\xf6\xbd=\xaa\x11\xd7\xa3L\xf9A\xc4'), chr(0b1001110 + 0o26) + chr(0b101000 + 0o75) + chr(99) + chr(5024 - 4913) + chr(0b100101 + 0o77) + '\x65')('\165' + chr(116) + chr(9003 - 8901) + '\x2d' + chr(512 - 456)))(ftfygxgFas5X(Tn6rGr7XTM7t)) for IZ1I2J8X1CQz in Tn6rGr7XTM7t: roI3spqORKae(IZ1I2J8X1CQz, roI3spqORKae(ES5oEprVxulp(b'\x08p\xed\xa09\x99\x0e\xcc\xb4'), chr(0b110100 + 0o60) + '\145' + chr(3683 - 3584) + chr(0b1101111) + '\x64' + chr(101))(chr(0b1110101) + chr(10627 - 10511) + '\146' + chr(0b101101) + chr(2565 - 2509)))(hXMPsSrOQzbh)
ontio/ontology-python-sdk
ontology/io/binary_writer.py
BinaryWriter.write_hashes
def write_hashes(self, arr): """ Write an array of hashes to the stream. Args: arr (list): a list of 32 byte hashes. """ length = len(arr) self.write_var_int(length) for item in arr: ba = bytearray(binascii.unhexlify(item)) ba.reverse() self.write_bytes(ba)
python
def write_hashes(self, arr): """ Write an array of hashes to the stream. Args: arr (list): a list of 32 byte hashes. """ length = len(arr) self.write_var_int(length) for item in arr: ba = bytearray(binascii.unhexlify(item)) ba.reverse() self.write_bytes(ba)
[ "def", "write_hashes", "(", "self", ",", "arr", ")", ":", "length", "=", "len", "(", "arr", ")", "self", ".", "write_var_int", "(", "length", ")", "for", "item", "in", "arr", ":", "ba", "=", "bytearray", "(", "binascii", ".", "unhexlify", "(", "item", ")", ")", "ba", ".", "reverse", "(", ")", "self", ".", "write_bytes", "(", "ba", ")" ]
Write an array of hashes to the stream. Args: arr (list): a list of 32 byte hashes.
[ "Write", "an", "array", "of", "hashes", "to", "the", "stream", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_writer.py#L370-L382
train
Writes an array of 32 byte hashes to the stream.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO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z86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(0b100001 + 0o116) + chr(49) + '\061' + chr(0b1111 + 0o45), 0b1000), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b1100000 + 0o17) + '\x32' + '\x35', 18972 - 18964), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(111) + chr(2036 - 1986) + '\x32' + '\x30', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(50) + chr(0b101010 + 0o15) + chr(0b10000 + 0o41), 0o10), nzTpIcepk0o8(chr(741 - 693) + chr(0b1000001 + 0o56) + '\062' + '\x33' + chr(2147 - 2092), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b11111 + 0o120) + chr(53 - 2) + '\x36' + chr(154 - 106), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(8514 - 8403) + chr(0b101110 + 0o4) + '\x32' + chr(55), 64053 - 64045), nzTpIcepk0o8(chr(1015 - 967) + chr(4938 - 4827) + chr(0b10 + 0o61) + chr(54) + chr(0b11 + 0o61), 0o10), nzTpIcepk0o8('\060' + '\157' + '\064' + chr(2442 - 2392), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(50) + chr(201 - 153) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(0b11101 + 0o31) + '\064', 14007 - 13999), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + '\x36' + '\067', 0o10), nzTpIcepk0o8(chr(1075 - 1027) + chr(0b1101111) + chr(0b110001) + chr(0b110001) + '\x31', 0b1000), nzTpIcepk0o8(chr(48) + chr(10783 - 10672) + chr(1116 - 1065) + '\067' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(48) + chr(5570 - 5459) + chr(0b101101 + 0o6) + '\x37' + '\066', 0o10), nzTpIcepk0o8(chr(1092 - 1044) + chr(111) + chr(0b110111) + '\x32', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(50) + chr(51) + '\x35', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + chr(0b110000) + chr(0b110100), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(693 - 641) + chr(0b1 + 0o64), 0b1000), nzTpIcepk0o8(chr(0b10010 + 0o36) + '\x6f' + chr(0b110101) + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b10 + 0o155) + '\061' + '\x37' + chr(0b1000 + 0o53), ord("\x08")), nzTpIcepk0o8('\x30' + chr(4571 - 4460) + chr(49) + chr(48) + chr(0b1010 + 0o51), 8702 - 8694), nzTpIcepk0o8(chr(1894 - 1846) + chr(111) + chr(462 - 413) + chr(1496 - 1446) + '\x33', 0o10), nzTpIcepk0o8(chr(0b100100 + 0o14) + '\x6f' + '\x33' + chr(435 - 380) + chr(1787 - 1736), 0o10), nzTpIcepk0o8(chr(1188 - 1140) + '\157' + chr(49) + '\x32' + chr(0b100100 + 0o21), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + chr(0b11001 + 0o35) + chr(49), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1001001 + 0o46) + '\x32' + '\x31' + '\060', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\063' + chr(0b110001) + '\x36', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(50) + chr(50) + chr(49), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b10111 + 0o34) + chr(0b100010 + 0o20) + '\x30', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(799 - 750) + '\062' + chr(175 - 127), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b10110 + 0o34) + chr(0b110110) + chr(1269 - 1216), 53007 - 52999), nzTpIcepk0o8(chr(48) + '\x6f' + chr(200 - 149) + chr(411 - 361) + '\065', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\x32' + chr(0b110110) + '\067', 34162 - 34154), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101001 + 0o6) + chr(0b10 + 0o57) + chr(1903 - 1849) + '\067', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b11101 + 0o24) + chr(55), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b100010 + 0o20) + chr(0b110000) + chr(0b110001), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(769 - 719) + chr(0b10001 + 0o37) + chr(284 - 232), 50967 - 50959), nzTpIcepk0o8(chr(1904 - 1856) + chr(0b1101111) + chr(0b110010) + chr(48) + '\x36', ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110101) + chr(680 - 632), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'b'), chr(8214 - 8114) + chr(101) + chr(99) + chr(111) + chr(0b1100100) + '\145')(chr(4565 - 4448) + chr(0b110111 + 0o75) + chr(0b110101 + 0o61) + chr(0b1111 + 0o36) + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Eh0EkhNqFpDW(hXMPsSrOQzbh, JaZEP80kXwoT): a1RCQZREo3Kd = ftfygxgFas5X(JaZEP80kXwoT) roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b';g\xf9\xcd\xfa\xaf\xe1\x95P\xdc\x1d\x99='), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(2789 - 2678) + chr(100) + chr(7495 - 7394))(chr(0b1010000 + 0o45) + '\164' + chr(102) + chr(0b101101) + chr(0b110110 + 0o2)))(a1RCQZREo3Kd) for IZ1I2J8X1CQz in JaZEP80kXwoT: HwzbbflA3C0J = MdkNqd1bagO6(tVthFMdkjoLb.unhexlify(IZ1I2J8X1CQz)) roI3spqORKae(HwzbbflA3C0J, roI3spqORKae(ES5oEprVxulp(b'+ \xe5\xfe\xf9\xbe\xa6\x9cU\xc0\x02\x94'), '\x64' + chr(0b1010001 + 0o24) + '\x63' + chr(0b11100 + 0o123) + '\144' + chr(5323 - 5222))(chr(0b101100 + 0o111) + '\164' + '\x66' + '\x2d' + '\070'))() roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b';g\xf9\xcd\xfa\xaf\xf5\x8dV\xe6\x07'), chr(0b1110 + 0o126) + chr(4687 - 4586) + '\x63' + chr(111) + chr(4529 - 4429) + '\145')(chr(7640 - 7523) + chr(11676 - 11560) + chr(102) + chr(0b100001 + 0o14) + chr(2440 - 2384)))(HwzbbflA3C0J)
ontio/ontology-python-sdk
ontology/smart_contract/native_contract/asset.py
Asset.get_asset_address
def get_asset_address(self, asset: str) -> bytes: """ This interface is used to get the smart contract address of ONT otr ONG. :param asset: a string which is used to indicate which asset's contract address we want to get. :return: the contract address of asset in the form of bytearray. """ if asset.upper() == 'ONT': return self.__ont_contract elif asset.upper() == 'ONG': return self.__ong_contract else: raise SDKException(ErrorCode.other_error('asset is not equal to ONT or ONG.'))
python
def get_asset_address(self, asset: str) -> bytes: """ This interface is used to get the smart contract address of ONT otr ONG. :param asset: a string which is used to indicate which asset's contract address we want to get. :return: the contract address of asset in the form of bytearray. """ if asset.upper() == 'ONT': return self.__ont_contract elif asset.upper() == 'ONG': return self.__ong_contract else: raise SDKException(ErrorCode.other_error('asset is not equal to ONT or ONG.'))
[ "def", "get_asset_address", "(", "self", ",", "asset", ":", "str", ")", "->", "bytes", ":", "if", "asset", ".", "upper", "(", ")", "==", "'ONT'", ":", "return", "self", ".", "__ont_contract", "elif", "asset", ".", "upper", "(", ")", "==", "'ONG'", ":", "return", "self", ".", "__ong_contract", "else", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'asset is not equal to ONT or ONG.'", ")", ")" ]
This interface is used to get the smart contract address of ONT otr ONG. :param asset: a string which is used to indicate which asset's contract address we want to get. :return: the contract address of asset in the form of bytearray.
[ "This", "interface", "is", "used", "to", "get", "the", "smart", "contract", "address", "of", "ONT", "otr", "ONG", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/asset.py#L22-L34
train
This interface is used to get the smart contract address of an asset.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,U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Error,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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(111) + chr(0b10111 + 0o33) + chr(53) + chr(53), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b10001 + 0o40) + '\x33' + chr(0b101001 + 0o13), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b110010 + 0o75) + chr(49) + chr(55) + '\064', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b111 + 0o55) + chr(901 - 850), 0b1000), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(5179 - 5068) + chr(1148 - 1097) + '\x33' + chr(54), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\062' + '\060' + chr(131 - 79), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b10101 + 0o35) + chr(0b110111) + chr(52), 24266 - 24258), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110011) + chr(0b11011 + 0o32) + '\065', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(54) + chr(2315 - 2264), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110011), 15660 - 15652), nzTpIcepk0o8(chr(359 - 311) + chr(3757 - 3646) + chr(1013 - 962) + chr(0b110101) + chr(48), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\063' + chr(48), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b100101 + 0o15) + chr(0b1000 + 0o53), 35447 - 35439), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(111) + chr(49) + chr(798 - 744) + chr(2384 - 2330), 59680 - 59672), nzTpIcepk0o8(chr(0b110000) + chr(1669 - 1558) + '\061' + chr(624 - 571) + chr(1950 - 1900), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(2517 - 2462) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1011000 + 0o27) + chr(0b101011 + 0o10) + '\x34' + chr(0b1010 + 0o47), 0b1000), nzTpIcepk0o8(chr(0b100110 + 0o12) + '\157' + chr(1086 - 1037) + chr(0b110110) + chr(54), 8), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + chr(0b101100 + 0o6) + chr(53), 38073 - 38065), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1185 - 1131) + chr(55), 32381 - 32373), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(111) + '\062' + chr(0b110100) + '\x33', 0o10), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(5323 - 5212) + '\x32' + chr(50) + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b11 + 0o55) + '\157' + chr(0b0 + 0o61) + '\x31' + '\x32', ord("\x08")), nzTpIcepk0o8(chr(2262 - 2214) + chr(0b1101111) + chr(49) + chr(1892 - 1839) + chr(0b1001 + 0o52), 0o10), nzTpIcepk0o8('\x30' + chr(0b111 + 0o150) + chr(0b110001) + chr(0b0 + 0o62) + '\065', 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(261 - 210) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(933 - 885) + '\157' + chr(0b110011) + '\x34' + chr(2766 - 2712), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110011) + chr(54) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\062' + chr(0b10101 + 0o35) + chr(0b110110), 8), nzTpIcepk0o8('\x30' + '\157' + chr(2210 - 2160) + chr(126 - 76) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b100010 + 0o115) + '\x32' + chr(0b101000 + 0o12), 0b1000), nzTpIcepk0o8('\060' + chr(489 - 378) + chr(0b100000 + 0o20), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\065' + chr(2263 - 2214), 40742 - 40734), nzTpIcepk0o8(chr(710 - 662) + chr(0b1101111) + '\062' + '\x31' + chr(0b111 + 0o52), 23102 - 23094), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49) + chr(54) + chr(334 - 284), ord("\x08")), nzTpIcepk0o8(chr(413 - 365) + chr(0b110011 + 0o74) + '\063' + chr(55) + chr(51), 44370 - 44362), nzTpIcepk0o8(chr(0b110000) + chr(10425 - 10314) + '\062' + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(0b10110 + 0o131) + '\x37' + chr(493 - 442), 14735 - 14727), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\061' + chr(1197 - 1149) + chr(2498 - 2444), ord("\x08")), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(111) + chr(50) + '\x35' + chr(0b110100), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1557 - 1509) + '\x6f' + chr(1289 - 1236) + chr(48), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x83'), chr(100) + chr(101) + chr(0b111000 + 0o53) + chr(7602 - 7491) + '\x64' + chr(0b1000111 + 0o36))(chr(117) + '\164' + chr(102) + '\055' + '\x38') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def YFu_DGSmSLMc(hXMPsSrOQzbh, XwVpcyasdpoL) -> QNQS9e6tJqMV: if roI3spqORKae(XwVpcyasdpoL, roI3spqORKae(ES5oEprVxulp(b'\xc4-MN\x90\xc9\xd9\x8bQ2\xb2|'), chr(1320 - 1220) + '\145' + '\x63' + '\x6f' + '\144' + chr(101))('\x75' + '\164' + chr(0b11110 + 0o110) + chr(0b101101) + chr(0b111000)))() == roI3spqORKae(ES5oEprVxulp(b'\xe2\x12('), chr(0b1100100) + chr(0b1100101) + '\143' + '\x6f' + chr(0b1000010 + 0o42) + chr(101))('\x75' + '\164' + '\x66' + '\x2d' + chr(0b111000)): return roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xf2\x03\x13M\xaa\xdb\xdf\x82]w\x9ayp\x02'), chr(0b1100100) + chr(0b1100101) + chr(99) + '\x6f' + chr(0b111110 + 0o46) + chr(101))(chr(2639 - 2522) + chr(116) + chr(102) + '\055' + chr(0b1110 + 0o52))) elif roI3spqORKae(XwVpcyasdpoL, roI3spqORKae(ES5oEprVxulp(b'\xc4-MN\x90\xc9\xd9\x8bQ2\xb2|'), chr(0b11100 + 0o110) + '\x65' + chr(530 - 431) + '\157' + chr(2845 - 2745) + '\x65')(chr(0b1110101) + '\x74' + chr(102) + '\055' + '\x38'))() == roI3spqORKae(ES5oEprVxulp(b'\xe2\x12;'), chr(100) + '\145' + '\143' + '\157' + chr(0b1100100) + chr(0b101001 + 0o74))(chr(0b1110101) + chr(0b1000001 + 0o63) + chr(4599 - 4497) + chr(1253 - 1208) + chr(0b1101 + 0o53)): return roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xf2\x03\x13M\xb9\xdb\xdf\x82]w\x9ayp\x02'), chr(0b1000000 + 0o44) + chr(0b1100101) + chr(99) + '\x6f' + chr(0b1000110 + 0o36) + '\145')(chr(117) + chr(6636 - 6520) + '\146' + chr(1636 - 1591) + chr(2103 - 2047))) else: raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'\xc2(\x14F\xac\xdb\xd9\x9fAl\x9a'), chr(9927 - 9827) + chr(4249 - 4148) + chr(99) + chr(111) + chr(0b101110 + 0o66) + chr(3194 - 3093))('\x75' + chr(12241 - 12125) + chr(102) + chr(45) + chr(0b101000 + 0o20)))(roI3spqORKae(ES5oEprVxulp(b'\xcc/\x0fF\xaa\xa4\xd5\x9e\x13m\x87l3\x13\x1bH\x80\x1auC\xcc\xb6\x05%\x019\x89\x82\xb6\xdd\\G\x07'), chr(0b1100100) + chr(0b111101 + 0o50) + '\143' + '\x6f' + chr(4778 - 4678) + chr(0b10010 + 0o123))('\x75' + '\164' + chr(914 - 812) + '\x2d' + chr(0b111000))))
ontio/ontology-python-sdk
ontology/smart_contract/native_contract/asset.py
Asset.query_balance
def query_balance(self, asset: str, b58_address: str) -> int: """ This interface is used to query the account's ONT or ONG balance. :param asset: a string which is used to indicate which asset we want to check the balance. :param b58_address: a base58 encode account address. :return: account balance. """ raw_address = Address.b58decode(b58_address).to_bytes() contract_address = self.get_asset_address(asset) invoke_code = build_native_invoke_code(contract_address, b'\x00', "balanceOf", raw_address) tx = Transaction(0, 0xd1, int(time()), 0, 0, None, invoke_code, bytearray(), list()) response = self.__sdk.rpc.send_raw_transaction_pre_exec(tx) try: balance = ContractDataParser.to_int(response['Result']) return balance except SDKException: return 0
python
def query_balance(self, asset: str, b58_address: str) -> int: """ This interface is used to query the account's ONT or ONG balance. :param asset: a string which is used to indicate which asset we want to check the balance. :param b58_address: a base58 encode account address. :return: account balance. """ raw_address = Address.b58decode(b58_address).to_bytes() contract_address = self.get_asset_address(asset) invoke_code = build_native_invoke_code(contract_address, b'\x00', "balanceOf", raw_address) tx = Transaction(0, 0xd1, int(time()), 0, 0, None, invoke_code, bytearray(), list()) response = self.__sdk.rpc.send_raw_transaction_pre_exec(tx) try: balance = ContractDataParser.to_int(response['Result']) return balance except SDKException: return 0
[ "def", "query_balance", "(", "self", ",", "asset", ":", "str", ",", "b58_address", ":", "str", ")", "->", "int", ":", "raw_address", "=", "Address", ".", "b58decode", "(", "b58_address", ")", ".", "to_bytes", "(", ")", "contract_address", "=", "self", ".", "get_asset_address", "(", "asset", ")", "invoke_code", "=", "build_native_invoke_code", "(", "contract_address", ",", "b'\\x00'", ",", "\"balanceOf\"", ",", "raw_address", ")", "tx", "=", "Transaction", "(", "0", ",", "0xd1", ",", "int", "(", "time", "(", ")", ")", ",", "0", ",", "0", ",", "None", ",", "invoke_code", ",", "bytearray", "(", ")", ",", "list", "(", ")", ")", "response", "=", "self", ".", "__sdk", ".", "rpc", ".", "send_raw_transaction_pre_exec", "(", "tx", ")", "try", ":", "balance", "=", "ContractDataParser", ".", "to_int", "(", "response", "[", "'Result'", "]", ")", "return", "balance", "except", "SDKException", ":", "return", "0" ]
This interface is used to query the account's ONT or ONG balance. :param asset: a string which is used to indicate which asset we want to check the balance. :param b58_address: a base58 encode account address. :return: account balance.
[ "This", "interface", "is", "used", "to", "query", "the", "account", "s", "ONT", "or", "ONG", "balance", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/asset.py#L36-L53
train
This interface is used to query the account s balance.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRi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clC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + '\157' + chr(0b1001 + 0o51) + chr(0b110111) + chr(0b100001 + 0o26), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1010110 + 0o31) + chr(1430 - 1380) + '\x31' + '\066', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(677 - 627) + '\065' + '\062', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b100 + 0o55) + chr(333 - 282) + '\x35', 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\x33', ord("\x08")), nzTpIcepk0o8(chr(1135 - 1087) + '\x6f' + chr(0b110101) + chr(1748 - 1695), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b111101 + 0o62) + chr(0b11011 + 0o27) + chr(0b101010 + 0o13), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\062' + chr(1827 - 1776) + chr(53), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011), 8), nzTpIcepk0o8(chr(0b110000) + chr(4535 - 4424) + chr(50) + chr(48), 31351 - 31343), nzTpIcepk0o8(chr(0b101101 + 0o3) + '\x6f' + chr(51) + chr(0b110111) + chr(0b10000 + 0o45), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110010) + chr(0b100111 + 0o17) + chr(1849 - 1797), 11838 - 11830), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31' + '\x32' + chr(53), ord("\x08")), nzTpIcepk0o8('\x30' + chr(8748 - 8637) + '\062' + chr(54) + chr(0b100111 + 0o14), ord("\x08")), nzTpIcepk0o8(chr(0b100101 + 0o13) + '\x6f' + '\x31' + chr(613 - 563), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\062' + chr(53) + chr(0b110010), 8), nzTpIcepk0o8('\060' + '\x6f' + '\x33' + chr(919 - 869) + chr(0b100110 + 0o12), 0o10), nzTpIcepk0o8(chr(259 - 211) + '\x6f' + chr(0b10001 + 0o40) + chr(0b110011) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\063' + chr(0b101100 + 0o7) + chr(54), 0o10), nzTpIcepk0o8('\060' + '\157' + '\061' + chr(1003 - 951) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(2302 - 2249) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b110111) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(0b101001 + 0o106) + chr(0b110010) + '\061' + chr(419 - 370), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1001000 + 0o47) + chr(0b110011) + chr(52) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(7976 - 7865) + '\x33' + chr(710 - 661) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(0b100111 + 0o110) + chr(0b11111 + 0o30) + chr(52), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49) + '\x37' + chr(55), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\063' + chr(50) + chr(49), 63241 - 63233), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(49) + chr(0b110100) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(501 - 453) + '\x6f' + '\x35' + chr(55), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1458 - 1405) + chr(55), 8), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + chr(53) + chr(0b110110), 34419 - 34411), nzTpIcepk0o8('\x30' + chr(0b1000010 + 0o55) + '\062' + '\064' + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\060' + chr(4192 - 4081) + chr(51) + '\066' + chr(49), 0b1000), nzTpIcepk0o8('\x30' + chr(0b101000 + 0o107) + chr(0b1101 + 0o44) + '\063' + '\x34', 8), nzTpIcepk0o8('\x30' + '\157' + chr(50) + '\x36' + '\x33', 8), nzTpIcepk0o8(chr(48) + '\x6f' + '\x35', 32761 - 32753), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x31' + '\x33' + chr(51), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(49) + '\x31' + '\066', 7704 - 7696), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110010) + chr(0b101011 + 0o14) + chr(0b110001), 30910 - 30902)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\065' + '\x30', 52088 - 52080)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x91'), chr(0b101101 + 0o67) + '\145' + chr(8090 - 7991) + '\x6f' + '\144' + chr(1780 - 1679))('\165' + chr(0b101100 + 0o110) + chr(0b1010011 + 0o23) + chr(0b101101) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def xuyQGbC2JHVs(hXMPsSrOQzbh, XwVpcyasdpoL, zB3qJdM7x1vq) -> nzTpIcepk0o8: GSGtFyyI4wa9 = SrMTpcNaNYrr.b58decode(zB3qJdM7x1vq).to_bytes() ottSTmIi6cZv = hXMPsSrOQzbh.get_asset_address(XwVpcyasdpoL) q6rQEi0QQtdg = lvVe_ItRqdAZ(ottSTmIi6cZv, ES5oEprVxulp(b'\xbf'), roI3spqORKae(ES5oEprVxulp(b'\xdd\xef\xc6<mNp\xd2e'), chr(100) + chr(4006 - 3905) + chr(6837 - 6738) + chr(0b1101111) + chr(414 - 314) + chr(0b111100 + 0o51))(chr(0b1110101) + chr(116) + '\x66' + chr(45) + '\070'), GSGtFyyI4wa9) L1XUDGNrDyiW = Qq6Yax3kS4s_(nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b1111 + 0o41), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110011) + chr(511 - 461) + '\x31', 8), nzTpIcepk0o8(oprIvDIRQyCb()), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(175 - 127), 8), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(3088 - 2977) + '\060', 8), None, q6rQEi0QQtdg, MdkNqd1bagO6(), H4NoA26ON7iG()) k2zzaFDtbuhL = hXMPsSrOQzbh.__sdk.rpc.send_raw_transaction_pre_exec(L1XUDGNrDyiW) try: sm007f_5YZh9 = BAEfBfcQan9X.QlK7LYArfJeG(k2zzaFDtbuhL[roI3spqORKae(ES5oEprVxulp(b'\xed\xeb\xd9(oY'), chr(5439 - 5339) + '\x65' + chr(0b11111 + 0o104) + chr(535 - 424) + chr(0b110011 + 0o61) + '\x65')(chr(1054 - 937) + chr(116) + chr(0b11001 + 0o115) + chr(0b10111 + 0o26) + '\070')]) return sm007f_5YZh9 except _QQM7naqUUr0: return nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(74 - 26), 8)
ontio/ontology-python-sdk
ontology/smart_contract/native_contract/asset.py
Asset.query_unbound_ong
def query_unbound_ong(self, base58_address: str) -> int: """ This interface is used to query the amount of account's unbound ong. :param base58_address: a base58 encode address which indicate which account's unbound ong we want to query. :return: the amount of unbound ong in the form of int. """ contract_address = self.get_asset_address('ont') unbound_ong = self.__sdk.rpc.get_allowance("ong", Address(contract_address).b58encode(), base58_address) return int(unbound_ong)
python
def query_unbound_ong(self, base58_address: str) -> int: """ This interface is used to query the amount of account's unbound ong. :param base58_address: a base58 encode address which indicate which account's unbound ong we want to query. :return: the amount of unbound ong in the form of int. """ contract_address = self.get_asset_address('ont') unbound_ong = self.__sdk.rpc.get_allowance("ong", Address(contract_address).b58encode(), base58_address) return int(unbound_ong)
[ "def", "query_unbound_ong", "(", "self", ",", "base58_address", ":", "str", ")", "->", "int", ":", "contract_address", "=", "self", ".", "get_asset_address", "(", "'ont'", ")", "unbound_ong", "=", "self", ".", "__sdk", ".", "rpc", ".", "get_allowance", "(", "\"ong\"", ",", "Address", "(", "contract_address", ")", ".", "b58encode", "(", ")", ",", "base58_address", ")", "return", "int", "(", "unbound_ong", ")" ]
This interface is used to query the amount of account's unbound ong. :param base58_address: a base58 encode address which indicate which account's unbound ong we want to query. :return: the amount of unbound ong in the form of int.
[ "This", "interface", "is", "used", "to", "query", "the", "amount", "of", "account", "s", "unbound", "ong", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/asset.py#L76-L85
train
This interface is used to query the amount of account s unbound ong.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jf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ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(0b1101 + 0o142) + '\062' + chr(0b110011) + chr(2529 - 2477), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b101011 + 0o14) + chr(55), 0o10), nzTpIcepk0o8(chr(48) + chr(8487 - 8376) + '\062' + chr(1313 - 1262) + chr(934 - 884), 24987 - 24979), nzTpIcepk0o8(chr(2291 - 2243) + '\157' + chr(0b110101) + chr(55), 0o10), nzTpIcepk0o8(chr(283 - 235) + chr(0b1101111) + '\x37' + '\x32', 0o10), nzTpIcepk0o8(chr(1232 - 1184) + '\157' + chr(0b11111 + 0o24) + chr(53) + chr(0b110010 + 0o3), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b100 + 0o56) + chr(52) + '\x31', 23085 - 23077), nzTpIcepk0o8(chr(48) + chr(111) + '\x31' + '\x31' + '\x30', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + chr(0b111 + 0o56), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110010) + chr(476 - 428) + chr(0b10111 + 0o32), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110010 + 0o1) + '\x31' + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + chr(0b100001 + 0o23) + chr(2147 - 2092), 0b1000), nzTpIcepk0o8('\060' + chr(6606 - 6495) + chr(50) + chr(0b110100) + chr(1369 - 1320), 8), nzTpIcepk0o8(chr(996 - 948) + chr(0b10001 + 0o136) + chr(0b10000 + 0o43) + chr(49) + '\063', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110010) + chr(50) + chr(0b110011), 50697 - 50689), nzTpIcepk0o8(chr(48) + chr(9294 - 9183) + chr(53) + chr(1265 - 1213), 5333 - 5325), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(2461 - 2409), 0b1000), nzTpIcepk0o8(chr(1928 - 1880) + chr(0b1010010 + 0o35) + chr(0b110001) + '\067' + '\060', ord("\x08")), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b1110 + 0o141) + '\063' + chr(55) + chr(52), 0o10), nzTpIcepk0o8('\060' + chr(0b1100011 + 0o14) + '\x35' + chr(1148 - 1095), 12526 - 12518), nzTpIcepk0o8('\x30' + chr(111) + chr(145 - 96) + '\064' + chr(1769 - 1716), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\062' + chr(926 - 877) + '\x31', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(527 - 477) + chr(678 - 625) + chr(1558 - 1507), 58718 - 58710), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(111) + chr(0b11000 + 0o31) + chr(0b110101) + '\x37', 9805 - 9797), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(0b1101111) + chr(50) + chr(2007 - 1953) + chr(444 - 391), 0o10), nzTpIcepk0o8(chr(2106 - 2058) + chr(0b1101111) + chr(50) + chr(2303 - 2252), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(54) + chr(51), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(2000 - 1949) + '\x34' + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b100100 + 0o17) + '\060' + chr(55), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1000110 + 0o51) + chr(0b110010) + chr(0b101101 + 0o5) + '\x30', 0o10), nzTpIcepk0o8(chr(1524 - 1476) + chr(409 - 298) + chr(0b1111 + 0o42) + chr(0b110000) + '\062', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1161 - 1108) + '\063', ord("\x08")), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(111) + chr(0b1100 + 0o46) + chr(51) + '\x34', 8), nzTpIcepk0o8(chr(0b110000) + chr(9430 - 9319) + '\062' + chr(0b1101 + 0o47) + chr(87 - 32), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110110) + chr(1006 - 958), 0o10), nzTpIcepk0o8(chr(48) + chr(0b11011 + 0o124) + chr(0b110010) + '\067' + chr(0b110110 + 0o1), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b11110 + 0o25) + chr(0b110011) + '\065', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b10100 + 0o133) + '\x33' + chr(0b10101 + 0o42) + chr(475 - 421), 0b1000), nzTpIcepk0o8('\x30' + chr(0b101101 + 0o102) + chr(2194 - 2144) + chr(1467 - 1417) + chr(0b110010), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(50) + '\063' + chr(2913 - 2858), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x35' + '\060', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xb2'), chr(0b1100001 + 0o3) + '\145' + chr(0b1100011) + '\157' + '\x64' + chr(0b110101 + 0o60))('\x75' + chr(11881 - 11765) + '\146' + '\x2d' + chr(0b1101 + 0o53)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Bqd7XU1DpJOl(hXMPsSrOQzbh, XtUHuUkBbB8R) -> nzTpIcepk0o8: ottSTmIi6cZv = hXMPsSrOQzbh.get_asset_address(roI3spqORKae(ES5oEprVxulp(b'\xf3Q\xee'), chr(100) + chr(101) + '\143' + '\157' + chr(3449 - 3349) + '\145')('\x75' + '\164' + chr(7713 - 7611) + chr(1229 - 1184) + chr(0b110010 + 0o6))) lt73AfymhbnG = hXMPsSrOQzbh.__sdk.rpc.get_allowance(roI3spqORKae(ES5oEprVxulp(b'\xf3Q\xfd'), chr(0b1100100) + chr(769 - 668) + '\x63' + chr(10028 - 9917) + chr(6424 - 6324) + '\x65')(chr(0b10001 + 0o144) + '\164' + '\146' + chr(0b101101) + chr(56)), SrMTpcNaNYrr(ottSTmIi6cZv).b58encode(), XtUHuUkBbB8R) return nzTpIcepk0o8(lt73AfymhbnG)
ontio/ontology-python-sdk
ontology/smart_contract/native_contract/asset.py
Asset.query_symbol
def query_symbol(self, asset: str) -> str: """ This interface is used to query the asset's symbol of ONT or ONG. :param asset: a string which is used to indicate which asset's symbol we want to get. :return: asset's symbol in the form of string. """ contract_address = self.get_asset_address(asset) method = 'symbol' invoke_code = build_native_invoke_code(contract_address, b'\x00', method, bytearray()) tx = Transaction(0, 0xd1, int(time()), 0, 0, None, invoke_code, bytearray(), list()) response = self.__sdk.rpc.send_raw_transaction_pre_exec(tx) symbol = ContractDataParser.to_utf8_str(response['Result']) return symbol
python
def query_symbol(self, asset: str) -> str: """ This interface is used to query the asset's symbol of ONT or ONG. :param asset: a string which is used to indicate which asset's symbol we want to get. :return: asset's symbol in the form of string. """ contract_address = self.get_asset_address(asset) method = 'symbol' invoke_code = build_native_invoke_code(contract_address, b'\x00', method, bytearray()) tx = Transaction(0, 0xd1, int(time()), 0, 0, None, invoke_code, bytearray(), list()) response = self.__sdk.rpc.send_raw_transaction_pre_exec(tx) symbol = ContractDataParser.to_utf8_str(response['Result']) return symbol
[ "def", "query_symbol", "(", "self", ",", "asset", ":", "str", ")", "->", "str", ":", "contract_address", "=", "self", ".", "get_asset_address", "(", "asset", ")", "method", "=", "'symbol'", "invoke_code", "=", "build_native_invoke_code", "(", "contract_address", ",", "b'\\x00'", ",", "method", ",", "bytearray", "(", ")", ")", "tx", "=", "Transaction", "(", "0", ",", "0xd1", ",", "int", "(", "time", "(", ")", ")", ",", "0", ",", "0", ",", "None", ",", "invoke_code", ",", "bytearray", "(", ")", ",", "list", "(", ")", ")", "response", "=", "self", ".", "__sdk", ".", "rpc", ".", "send_raw_transaction_pre_exec", "(", "tx", ")", "symbol", "=", "ContractDataParser", ".", "to_utf8_str", "(", "response", "[", "'Result'", "]", ")", "return", "symbol" ]
This interface is used to query the asset's symbol of ONT or ONG. :param asset: a string which is used to indicate which asset's symbol we want to get. :return: asset's symbol in the form of string.
[ "This", "interface", "is", "used", "to", "query", "the", "asset", "s", "symbol", "of", "ONT", "or", "ONG", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/asset.py#L103-L116
train
This interface is used to query the asset s symbol of ONT or ONG.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,Vw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5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(0b100000 + 0o24) + chr(2043 - 1989), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(50) + '\x32' + chr(0b1001 + 0o50), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(1468 - 1417) + chr(0b100110 + 0o17), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + chr(2103 - 2049) + chr(2207 - 2154), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b100011 + 0o114) + chr(0b110 + 0o53) + chr(0b110001) + '\x33', 34527 - 34519), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110111) + '\067', 0o10), nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(0b1101111) + '\x33' + '\066' + chr(2286 - 2236), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(1754 - 1704) + chr(0b11101 + 0o23) + '\x32', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110010) + '\064' + '\x34', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(50) + '\063' + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + chr(0b110100) + chr(434 - 379), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(50) + chr(252 - 200) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(539 - 490) + chr(855 - 805) + '\065', ord("\x08")), nzTpIcepk0o8(chr(283 - 235) + chr(1180 - 1069) + chr(0b100100 + 0o17) + '\063' + '\064', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x31' + '\064' + chr(2272 - 2218), 0b1000), nzTpIcepk0o8(chr(48) + chr(5031 - 4920) + '\x33' + chr(1465 - 1410) + chr(2242 - 2192), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(2782 - 2671) + '\x35' + chr(1949 - 1896), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(307 - 258) + '\061' + '\062', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\062' + '\062', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x33' + chr(54) + chr(0b1 + 0o66), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b111111 + 0o60) + chr(49) + chr(52) + '\x35', 0b1000), nzTpIcepk0o8(chr(120 - 72) + chr(0b1101111) + '\x33' + '\061' + chr(2030 - 1981), 0b1000), nzTpIcepk0o8(chr(2019 - 1971) + chr(111) + chr(0b110010) + chr(0b110100) + chr(0b1101 + 0o43), 15815 - 15807), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(51) + chr(991 - 937), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + chr(0b10110 + 0o34) + '\062', 0o10), nzTpIcepk0o8(chr(48) + chr(9470 - 9359) + '\x33' + chr(0b11 + 0o55) + chr(0b110001), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(0b10101 + 0o34) + '\063', 8), nzTpIcepk0o8('\060' + chr(0b101111 + 0o100) + chr(1151 - 1101) + '\066' + '\x37', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + chr(0b100 + 0o54), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\062' + '\x32' + '\064', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1011000 + 0o27) + '\x33' + chr(52) + chr(0b110001 + 0o0), 0o10), nzTpIcepk0o8('\060' + chr(0b1011100 + 0o23) + chr(55) + chr(0b110101), 4078 - 4070), nzTpIcepk0o8(chr(48) + chr(9325 - 9214) + '\x32' + '\x32' + chr(1321 - 1268), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\062' + chr(0b110010) + chr(415 - 360), ord("\x08")), nzTpIcepk0o8('\060' + chr(10932 - 10821) + chr(1071 - 1021) + '\060' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1111 - 1060) + chr(546 - 491) + chr(0b10100 + 0o41), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b10001 + 0o136) + chr(54) + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(4315 - 4204) + chr(53), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(2036 - 1986) + chr(1751 - 1702) + chr(2080 - 2032), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b101001 + 0o7) + '\x6f' + chr(0b110101) + chr(858 - 810), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x88'), chr(5704 - 5604) + '\145' + chr(0b1111 + 0o124) + chr(0b101100 + 0o103) + chr(7744 - 7644) + chr(0b100000 + 0o105))(chr(0b1011010 + 0o33) + chr(0b1110100) + chr(0b1100110 + 0o0) + '\055' + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def e4kSwXAsKuwi(hXMPsSrOQzbh, XwVpcyasdpoL) -> N9zlRy29S1SS: ottSTmIi6cZv = hXMPsSrOQzbh.get_asset_address(XwVpcyasdpoL) e5rcHW8hR5dL = roI3spqORKae(ES5oEprVxulp(b'\xd5\xe8p\x17$S'), chr(0b1100100) + chr(0b10001 + 0o124) + chr(7322 - 7223) + chr(0b1101111) + chr(4896 - 4796) + chr(0b0 + 0o145))(chr(6466 - 6349) + chr(116) + chr(0b10111 + 0o117) + chr(1788 - 1743) + chr(0b111000)) q6rQEi0QQtdg = lvVe_ItRqdAZ(ottSTmIi6cZv, ES5oEprVxulp(b'\xa6'), e5rcHW8hR5dL, MdkNqd1bagO6()) L1XUDGNrDyiW = Qq6Yax3kS4s_(nzTpIcepk0o8('\060' + '\157' + chr(0b110000), 8), nzTpIcepk0o8(chr(0b100011 + 0o15) + '\x6f' + chr(0b110011) + '\x32' + chr(0b101101 + 0o4), 24892 - 24884), nzTpIcepk0o8(oprIvDIRQyCb()), nzTpIcepk0o8('\x30' + chr(111) + chr(951 - 903), 8), nzTpIcepk0o8(chr(1510 - 1462) + '\157' + chr(0b10110 + 0o32), 8), None, q6rQEi0QQtdg, MdkNqd1bagO6(), H4NoA26ON7iG()) k2zzaFDtbuhL = hXMPsSrOQzbh.__sdk.rpc.send_raw_transaction_pre_exec(L1XUDGNrDyiW) hQqiJQuqI0BH = BAEfBfcQan9X.to_utf8_str(k2zzaFDtbuhL[roI3spqORKae(ES5oEprVxulp(b"\xf4\xf4n\x00'K"), chr(0b1100100) + '\145' + chr(0b1100011) + chr(111) + '\x64' + chr(0b1100101))(chr(2898 - 2781) + chr(0b101001 + 0o113) + '\146' + chr(45) + '\x38')]) return hQqiJQuqI0BH
ontio/ontology-python-sdk
ontology/smart_contract/native_contract/asset.py
Asset.query_decimals
def query_decimals(self, asset: str) -> int: """ This interface is used to query the asset's decimals of ONT or ONG. :param asset: a string which is used to indicate which asset's decimals we want to get :return: asset's decimals in the form of int """ contract_address = self.get_asset_address(asset) invoke_code = build_native_invoke_code(contract_address, b'\x00', 'decimals', bytearray()) tx = Transaction(0, 0xd1, int(time()), 0, 0, None, invoke_code, bytearray(), list()) response = self.__sdk.rpc.send_raw_transaction_pre_exec(tx) try: decimal = ContractDataParser.to_int(response['Result']) return decimal except SDKException: return 0
python
def query_decimals(self, asset: str) -> int: """ This interface is used to query the asset's decimals of ONT or ONG. :param asset: a string which is used to indicate which asset's decimals we want to get :return: asset's decimals in the form of int """ contract_address = self.get_asset_address(asset) invoke_code = build_native_invoke_code(contract_address, b'\x00', 'decimals', bytearray()) tx = Transaction(0, 0xd1, int(time()), 0, 0, None, invoke_code, bytearray(), list()) response = self.__sdk.rpc.send_raw_transaction_pre_exec(tx) try: decimal = ContractDataParser.to_int(response['Result']) return decimal except SDKException: return 0
[ "def", "query_decimals", "(", "self", ",", "asset", ":", "str", ")", "->", "int", ":", "contract_address", "=", "self", ".", "get_asset_address", "(", "asset", ")", "invoke_code", "=", "build_native_invoke_code", "(", "contract_address", ",", "b'\\x00'", ",", "'decimals'", ",", "bytearray", "(", ")", ")", "tx", "=", "Transaction", "(", "0", ",", "0xd1", ",", "int", "(", "time", "(", ")", ")", ",", "0", ",", "0", ",", "None", ",", "invoke_code", ",", "bytearray", "(", ")", ",", "list", "(", ")", ")", "response", "=", "self", ".", "__sdk", ".", "rpc", ".", "send_raw_transaction_pre_exec", "(", "tx", ")", "try", ":", "decimal", "=", "ContractDataParser", ".", "to_int", "(", "response", "[", "'Result'", "]", ")", "return", "decimal", "except", "SDKException", ":", "return", "0" ]
This interface is used to query the asset's decimals of ONT or ONG. :param asset: a string which is used to indicate which asset's decimals we want to get :return: asset's decimals in the form of int
[ "This", "interface", "is", "used", "to", "query", "the", "asset", "s", "decimals", "of", "ONT", "or", "ONG", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/asset.py#L118-L133
train
This interface is used to query the decimals of an asset.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h6aCn31dg,oxjHmqoBrCHG,GA4ANb_Tki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6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(815 - 767) + chr(0b111101 + 0o62) + chr(0b10100 + 0o36) + chr(1445 - 1394) + chr(0b110010), 0o10), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(0b1010010 + 0o35) + chr(0b10011 + 0o40) + chr(49) + '\x32', 15870 - 15862), nzTpIcepk0o8(chr(48) + chr(1597 - 1486) + chr(49) + '\x30' + chr(51), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(6181 - 6070) + '\x31' + '\x33' + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1001000 + 0o47) + chr(0b110011) + chr(0b1000 + 0o50) + chr(0b100100 + 0o20), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b11000 + 0o34) + chr(0b110100), 6184 - 6176), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + '\064' + '\x37', 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(927 - 877) + chr(0b110101) + chr(52), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b11101 + 0o25) + chr(0b10010 + 0o42) + '\x33', 6806 - 6798), nzTpIcepk0o8(chr(360 - 312) + chr(0b11011 + 0o124) + chr(2234 - 2185) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x31' + chr(52) + '\067', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(51) + chr(997 - 946) + chr(0b110010), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110011) + chr(0b110001) + '\x34', 57073 - 57065), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(0b111 + 0o55) + chr(0b110111), 8), nzTpIcepk0o8(chr(48) + '\157' + chr(2314 - 2260) + chr(0b100001 + 0o20), 0o10), nzTpIcepk0o8(chr(1304 - 1256) + chr(0b1101111) + chr(49) + '\063', 0b1000), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b1101111) + '\062' + chr(54) + '\062', 42784 - 42776), nzTpIcepk0o8(chr(0b110 + 0o52) + chr(8874 - 8763) + chr(0b110011) + chr(51) + chr(2209 - 2155), 47728 - 47720), nzTpIcepk0o8('\x30' + chr(111) + chr(0b10000 + 0o43) + chr(0b110101) + chr(54), 0o10), nzTpIcepk0o8(chr(762 - 714) + chr(0b1010011 + 0o34) + chr(49) + chr(53) + '\062', 16277 - 16269), nzTpIcepk0o8(chr(525 - 477) + chr(111) + '\062' + '\x31' + '\x33', 2554 - 2546), nzTpIcepk0o8(chr(362 - 314) + chr(0b11 + 0o154) + chr(0b110111) + chr(50), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + chr(0b110011 + 0o0) + '\062', 8), nzTpIcepk0o8(chr(0b110000) + chr(8089 - 7978) + chr(0b101011 + 0o13) + '\x33', 0b1000), nzTpIcepk0o8('\060' + chr(6050 - 5939) + '\061' + chr(0b110000) + '\063', 8), nzTpIcepk0o8('\x30' + '\157' + '\061' + chr(0b110111) + chr(1566 - 1514), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b11001 + 0o32) + chr(534 - 481) + '\067', 16 - 8), nzTpIcepk0o8('\060' + chr(111) + chr(50) + chr(53) + chr(53), 0b1000), nzTpIcepk0o8(chr(0b11000 + 0o30) + '\157' + chr(50) + chr(52) + '\067', 8), nzTpIcepk0o8(chr(584 - 536) + chr(111) + chr(2493 - 2443) + '\x32' + '\x37', 0b1000), nzTpIcepk0o8(chr(424 - 376) + chr(111) + chr(0b110010) + chr(0b1100 + 0o50) + chr(52), 8), nzTpIcepk0o8('\060' + '\157' + chr(0b101110 + 0o3) + '\067' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(9397 - 9286) + '\062' + chr(53) + chr(907 - 859), 64690 - 64682), nzTpIcepk0o8(chr(48) + '\157' + '\066' + chr(0b11101 + 0o31), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1100110 + 0o11) + '\x33' + chr(0b1101 + 0o52), 41465 - 41457), nzTpIcepk0o8('\x30' + chr(7566 - 7455) + chr(0b111 + 0o60) + '\x35', 18242 - 18234), nzTpIcepk0o8('\060' + chr(0b1100110 + 0o11) + chr(50) + chr(1747 - 1696) + chr(0b110101), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(448 - 397) + '\x37' + chr(2537 - 2482), 56256 - 56248), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + '\x36' + chr(53), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x32' + chr(0b110100) + '\066', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\157' + chr(53) + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xb4'), chr(100) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(4654 - 4553))(chr(10524 - 10407) + chr(0b0 + 0o164) + chr(0b101000 + 0o76) + chr(0b101101) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def xcngliNpGXGt(hXMPsSrOQzbh, XwVpcyasdpoL) -> nzTpIcepk0o8: ottSTmIi6cZv = hXMPsSrOQzbh.get_asset_address(XwVpcyasdpoL) q6rQEi0QQtdg = lvVe_ItRqdAZ(ottSTmIi6cZv, ES5oEprVxulp(b'\x9a'), roI3spqORKae(ES5oEprVxulp(b'\xfe\xaf 4\xa9\xc5\xcb\xdf'), chr(9453 - 9353) + chr(101) + chr(695 - 596) + '\157' + '\144' + chr(101))(chr(0b1110101) + '\164' + '\x66' + chr(45) + '\x38'), MdkNqd1bagO6()) L1XUDGNrDyiW = Qq6Yax3kS4s_(nzTpIcepk0o8('\060' + '\157' + chr(0b1110 + 0o42), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(2338 - 2288) + '\x31', 0o10), nzTpIcepk0o8(oprIvDIRQyCb()), nzTpIcepk0o8(chr(1974 - 1926) + '\x6f' + chr(48), 8), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x30', 8), None, q6rQEi0QQtdg, MdkNqd1bagO6(), H4NoA26ON7iG()) k2zzaFDtbuhL = hXMPsSrOQzbh.__sdk.rpc.send_raw_transaction_pre_exec(L1XUDGNrDyiW) try: W04jQKOxNnhJ = BAEfBfcQan9X.QlK7LYArfJeG(k2zzaFDtbuhL[roI3spqORKae(ES5oEprVxulp(b'\xc8\xaf0(\xa8\xd0'), chr(0b100011 + 0o101) + chr(101) + chr(5058 - 4959) + '\x6f' + '\x64' + '\x65')('\x75' + chr(11228 - 11112) + chr(102) + chr(449 - 404) + '\070')]) return W04jQKOxNnhJ except _QQM7naqUUr0: return nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110000), 8)
ontio/ontology-python-sdk
ontology/smart_contract/native_contract/asset.py
Asset.new_transfer_transaction
def new_transfer_transaction(self, asset: str, b58_from_address: str, b58_to_address: str, amount: int, b58_payer_address: str, gas_limit: int, gas_price: int) -> Transaction: """ This interface is used to generate a Transaction object for transfer. :param asset: a string which is used to indicate which asset we want to transfer. :param b58_from_address: a base58 encode address which indicate where the asset from. :param b58_to_address: a base58 encode address which indicate where the asset to. :param amount: the amount of asset that will be transferred. :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: a Transaction object which can be used for transfer. """ if not isinstance(b58_from_address, str) or not isinstance(b58_to_address, str) or not isinstance( b58_payer_address, str): raise SDKException(ErrorCode.param_err('the data type of base58 encode address should be the string.')) if len(b58_from_address) != 34 or len(b58_to_address) != 34 or len(b58_payer_address) != 34: raise SDKException(ErrorCode.param_err('the length of base58 encode address should be 34 bytes.')) if amount <= 0: raise SDKException(ErrorCode.other_error('the amount should be greater than than zero.')) if gas_price < 0: raise SDKException(ErrorCode.other_error('the gas price should be equal or greater than zero.')) if gas_limit < 0: raise SDKException(ErrorCode.other_error('the gas limit should be equal or greater than zero.')) contract_address = self.get_asset_address(asset) raw_from = Address.b58decode(b58_from_address).to_bytes() raw_to = Address.b58decode(b58_to_address).to_bytes() raw_payer = Address.b58decode(b58_payer_address).to_bytes() state = [{"from": raw_from, "to": raw_to, "amount": amount}] invoke_code = build_native_invoke_code(contract_address, b'\x00', "transfer", state) return Transaction(0, 0xd1, int(time()), gas_price, gas_limit, raw_payer, invoke_code, bytearray(), list())
python
def new_transfer_transaction(self, asset: str, b58_from_address: str, b58_to_address: str, amount: int, b58_payer_address: str, gas_limit: int, gas_price: int) -> Transaction: """ This interface is used to generate a Transaction object for transfer. :param asset: a string which is used to indicate which asset we want to transfer. :param b58_from_address: a base58 encode address which indicate where the asset from. :param b58_to_address: a base58 encode address which indicate where the asset to. :param amount: the amount of asset that will be transferred. :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: a Transaction object which can be used for transfer. """ if not isinstance(b58_from_address, str) or not isinstance(b58_to_address, str) or not isinstance( b58_payer_address, str): raise SDKException(ErrorCode.param_err('the data type of base58 encode address should be the string.')) if len(b58_from_address) != 34 or len(b58_to_address) != 34 or len(b58_payer_address) != 34: raise SDKException(ErrorCode.param_err('the length of base58 encode address should be 34 bytes.')) if amount <= 0: raise SDKException(ErrorCode.other_error('the amount should be greater than than zero.')) if gas_price < 0: raise SDKException(ErrorCode.other_error('the gas price should be equal or greater than zero.')) if gas_limit < 0: raise SDKException(ErrorCode.other_error('the gas limit should be equal or greater than zero.')) contract_address = self.get_asset_address(asset) raw_from = Address.b58decode(b58_from_address).to_bytes() raw_to = Address.b58decode(b58_to_address).to_bytes() raw_payer = Address.b58decode(b58_payer_address).to_bytes() state = [{"from": raw_from, "to": raw_to, "amount": amount}] invoke_code = build_native_invoke_code(contract_address, b'\x00', "transfer", state) return Transaction(0, 0xd1, int(time()), gas_price, gas_limit, raw_payer, invoke_code, bytearray(), list())
[ "def", "new_transfer_transaction", "(", "self", ",", "asset", ":", "str", ",", "b58_from_address", ":", "str", ",", "b58_to_address", ":", "str", ",", "amount", ":", "int", ",", "b58_payer_address", ":", "str", ",", "gas_limit", ":", "int", ",", "gas_price", ":", "int", ")", "->", "Transaction", ":", "if", "not", "isinstance", "(", "b58_from_address", ",", "str", ")", "or", "not", "isinstance", "(", "b58_to_address", ",", "str", ")", "or", "not", "isinstance", "(", "b58_payer_address", ",", "str", ")", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_err", "(", "'the data type of base58 encode address should be the string.'", ")", ")", "if", "len", "(", "b58_from_address", ")", "!=", "34", "or", "len", "(", "b58_to_address", ")", "!=", "34", "or", "len", "(", "b58_payer_address", ")", "!=", "34", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_err", "(", "'the length of base58 encode address should be 34 bytes.'", ")", ")", "if", "amount", "<=", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the amount should be greater than than zero.'", ")", ")", "if", "gas_price", "<", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the gas price should be equal or greater than zero.'", ")", ")", "if", "gas_limit", "<", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the gas limit should be equal or greater than zero.'", ")", ")", "contract_address", "=", "self", ".", "get_asset_address", "(", "asset", ")", "raw_from", "=", "Address", ".", "b58decode", "(", "b58_from_address", ")", ".", "to_bytes", "(", ")", "raw_to", "=", "Address", ".", "b58decode", "(", "b58_to_address", ")", ".", "to_bytes", "(", ")", "raw_payer", "=", "Address", ".", "b58decode", "(", "b58_payer_address", ")", ".", "to_bytes", "(", ")", "state", "=", "[", "{", "\"from\"", ":", "raw_from", ",", "\"to\"", ":", "raw_to", ",", "\"amount\"", ":", "amount", "}", "]", "invoke_code", "=", "build_native_invoke_code", "(", "contract_address", ",", "b'\\x00'", ",", "\"transfer\"", ",", "state", ")", "return", "Transaction", "(", "0", ",", "0xd1", ",", "int", "(", "time", "(", ")", ")", ",", "gas_price", ",", "gas_limit", ",", "raw_payer", ",", "invoke_code", ",", "bytearray", "(", ")", ",", "list", "(", ")", ")" ]
This interface is used to generate a Transaction object for transfer. :param asset: a string which is used to indicate which asset we want to transfer. :param b58_from_address: a base58 encode address which indicate where the asset from. :param b58_to_address: a base58 encode address which indicate where the asset to. :param amount: the amount of asset that will be transferred. :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: a Transaction object which can be used for transfer.
[ "This", "interface", "is", "used", "to", "generate", "a", "Transaction", "object", "for", "transfer", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/asset.py#L135-L166
train
This interface is used to generate a Transaction object which can be used to transfer an asset from one address to another.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ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CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(2216 - 2168) + chr(0b110001 + 0o76) + chr(0b110001) + '\064', 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + chr(0b11111 + 0o25) + chr(1734 - 1685), 38354 - 38346), nzTpIcepk0o8('\x30' + chr(0b1011100 + 0o23) + chr(54) + chr(48), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\061' + chr(0b110101) + '\062', 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + '\063' + '\064', 0b1000), nzTpIcepk0o8(chr(889 - 841) + chr(0b1101111) + '\x34' + '\x37', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1100 + 0o143) + '\063' + chr(1907 - 1858) + chr(54), 4755 - 4747), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(0b1101111) + chr(775 - 726) + chr(1150 - 1095) + '\064', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b111011 + 0o64) + chr(50) + chr(53) + '\064', 0b1000), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(0b1100110 + 0o11) + '\x32' + chr(48) + chr(48), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31' + chr(0b110110) + chr(0b100100 + 0o17), 0o10), nzTpIcepk0o8('\060' + chr(0b1010011 + 0o34) + chr(318 - 268) + chr(0b110111) + chr(50), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + '\x33' + chr(51), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(497 - 448) + chr(49) + chr(152 - 101), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1000111 + 0o50) + '\063' + chr(0b110011), 11858 - 11850), nzTpIcepk0o8(chr(48) + '\157' + chr(51) + chr(748 - 699) + chr(0b110 + 0o57), 0o10), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b1101 + 0o142) + '\x32' + chr(54) + '\064', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b110100 + 0o73) + '\062' + chr(0b110111) + '\x31', 0o10), nzTpIcepk0o8(chr(0b11100 + 0o24) + '\157' + chr(0b110010) + chr(678 - 629) + chr(783 - 734), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x35' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1455 - 1406) + '\x32' + '\x35', 0o10), nzTpIcepk0o8(chr(1048 - 1000) + '\157' + '\x33' + chr(48) + chr(0b101110 + 0o11), ord("\x08")), nzTpIcepk0o8(chr(245 - 197) + chr(111) + chr(0b110001) + '\065' + '\x36', 30245 - 30237), nzTpIcepk0o8('\x30' + chr(1883 - 1772) + chr(1699 - 1650) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b0 + 0o157) + chr(1279 - 1230) + chr(0b110001) + '\x33', 8), nzTpIcepk0o8(chr(48) + chr(0b1010001 + 0o36) + '\065', ord("\x08")), nzTpIcepk0o8(chr(857 - 809) + '\157' + '\x31' + chr(1089 - 1036) + chr(0b110010), 8), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b100 + 0o63) + chr(0b10010 + 0o43), ord("\x08")), nzTpIcepk0o8('\x30' + chr(6844 - 6733) + chr(50) + chr(0b110101) + chr(0b100011 + 0o16), 0o10), nzTpIcepk0o8('\x30' + '\157' + '\x33' + '\063' + '\060', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101001 + 0o6) + '\062' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001 + 0o0) + '\061' + chr(0b101001 + 0o13), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(2562 - 2511) + '\x32' + '\x34', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b100100 + 0o17) + chr(0b110101) + '\x35', 37524 - 37516), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001) + chr(52) + '\061', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b1101 + 0o45) + chr(0b110101) + chr(0b110 + 0o56), 8), nzTpIcepk0o8(chr(1535 - 1487) + chr(11834 - 11723) + chr(1121 - 1071) + '\064' + '\x30', 6808 - 6800), nzTpIcepk0o8('\x30' + chr(8367 - 8256) + chr(2242 - 2192) + chr(54) + chr(54), 0b1000), nzTpIcepk0o8(chr(0b10010 + 0o36) + '\157' + chr(0b100110 + 0o15) + chr(1995 - 1944) + '\064', 9309 - 9301), nzTpIcepk0o8('\x30' + chr(0b11001 + 0o126) + chr(0b101110 + 0o11) + '\x34', 60303 - 60295)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110101) + chr(0b110000), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'"'), chr(100) + '\145' + chr(0b101111 + 0o64) + '\x6f' + chr(0b1011100 + 0o10) + chr(0b1001011 + 0o32))('\165' + chr(12991 - 12875) + chr(0b1001100 + 0o32) + chr(0b10101 + 0o30) + chr(312 - 256)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Twv1eLBfdNtH(hXMPsSrOQzbh, XwVpcyasdpoL, t2wxUk3dlUBZ, wnGtNiITIJnM, WwJhdr7TpaLo, WQwHjkQ5zluT, kkj6Kplau3cQ, Xu2pA_hYO4Yk) -> Qq6Yax3kS4s_: if not suIjIS24Zkqw(t2wxUk3dlUBZ, N9zlRy29S1SS) or not suIjIS24Zkqw(wnGtNiITIJnM, N9zlRy29S1SS) or (not suIjIS24Zkqw(WQwHjkQ5zluT, N9zlRy29S1SS)): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'|\x80B\x0b\xf1x\xab\x0e\xde'), '\144' + chr(0b1100101) + '\x63' + '\x6f' + '\x64' + '\x65')(chr(7898 - 7781) + chr(0b1110100) + chr(8995 - 8893) + chr(0b101101) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'x\x89UJ\xf8F\xba\x1d\x8c\xf4\n\xca>kt\xab\x94\xdb\xe8[0\xf2V).k\tR\xcd\xbd2-\xb0\x89\x13\xc9\xd3\xc5\xfcOd\x8eE\x06\xf8\x07\xac\x19\x8c\xf4\x1b\xdf{8o\xbf\xdd\xd7\xee\x06'), chr(100) + chr(7510 - 7409) + chr(99) + chr(0b1101111) + chr(2756 - 2656) + chr(1149 - 1048))(chr(0b1110101) + chr(1834 - 1718) + '\146' + chr(1336 - 1291) + '\x38'))) if ftfygxgFas5X(t2wxUk3dlUBZ) != nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(0b1101111 + 0o0) + chr(0b1110 + 0o46) + chr(1620 - 1570), 58799 - 58791) or ftfygxgFas5X(wnGtNiITIJnM) != nzTpIcepk0o8('\060' + chr(0b110010 + 0o75) + '\064' + chr(259 - 209), 8) or ftfygxgFas5X(WQwHjkQ5zluT) != nzTpIcepk0o8('\060' + '\x6f' + '\x34' + chr(489 - 439), 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'|\x80B\x0b\xf1x\xab\x0e\xde'), '\x64' + chr(6787 - 6686) + chr(8467 - 8368) + '\x6f' + chr(0b1100010 + 0o2) + '\145')(chr(117) + '\x74' + chr(3868 - 3766) + '\x2d' + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'x\x89UJ\xf0B\xa0\x1b\xd8\xe8S\xd5=ky\xac\xc7\xdc\xbc\x10u\xa2\x00j$a\x0f\x1d\xc8\xbcv>\xb1\x9e\x12\x8c\xd3\xde\xb3I`\x85\x10\x08\xf9\x07\xfdH\x8c\xe2\n\xce>85'), chr(0b100111 + 0o75) + chr(0b100100 + 0o101) + chr(0b1100011) + '\x6f' + '\144' + chr(101))('\x75' + chr(0b1011101 + 0o27) + chr(102) + '\055' + chr(814 - 758)))) if WwJhdr7TpaLo <= nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b11101 + 0o23), ord("\x08")): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'c\x95X\x0f\xeex\xab\x0e\xde\xef\x01'), chr(6119 - 6019) + '\145' + '\x63' + chr(5282 - 5171) + chr(6672 - 6572) + '\145')(chr(117) + chr(116) + chr(0b1011111 + 0o7) + chr(0b100 + 0o51) + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'x\x89UJ\xfdJ\xa1\t\xc2\xf4S\xc93$n\xa1\xd0\x99\xebMu\xa0\x1cl*q\x0fO\x89\xacz-\xba\xcd\x15\xc4\xc1\xd8\xfcFi\x93_D'), '\144' + '\145' + chr(0b1001000 + 0o33) + chr(0b1101111) + chr(100) + '\145')(chr(0b1101000 + 0o15) + chr(0b1110100) + '\x66' + '\x2d' + '\x38'))) if Xu2pA_hYO4Yk < nzTpIcepk0o8(chr(0b110000) + chr(10058 - 9947) + chr(0b110000), 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'c\x95X\x0f\xeex\xab\x0e\xde\xef\x01'), chr(100) + chr(101) + chr(99) + '\157' + chr(100) + chr(8222 - 8121))(chr(117) + chr(0b1110100) + chr(2730 - 2628) + chr(0b101101) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'x\x89UJ\xfbF\xbd\\\xdc\xf2\x1a\xd9>kh\xa5\xdb\xcc\xe5Lu\xa5\x0b).t\x1f\\\xc5\xf8}>\xf4\x8a\x13\xc9\xc1\xc2\xb9N,\x95X\x0b\xf2\x07\xb4\x19\xde\xef]'), chr(3267 - 3167) + chr(101) + '\x63' + chr(9585 - 9474) + '\x64' + chr(0b1100100 + 0o1))(chr(117) + chr(0b1110100) + '\x66' + '\x2d' + chr(0b11000 + 0o40)))) if kkj6Kplau3cQ < nzTpIcepk0o8(chr(0b11111 + 0o21) + '\x6f' + chr(2231 - 2183), 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'c\x95X\x0f\xeex\xab\x0e\xde\xef\x01'), chr(0b110 + 0o136) + chr(0b1100101) + chr(1686 - 1587) + '\x6f' + '\144' + '\145')(chr(0b1001 + 0o154) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + '\070'))(roI3spqORKae(ES5oEprVxulp(b'x\x89UJ\xfbF\xbd\\\xc0\xe9\x1e\xd3/kh\xa5\xdb\xcc\xe5Lu\xa5\x0b).t\x1f\\\xc5\xf8}>\xf4\x8a\x13\xc9\xc1\xc2\xb9N,\x95X\x0b\xf2\x07\xb4\x19\xde\xef]'), chr(0b1001110 + 0o26) + '\x65' + chr(99) + '\157' + chr(9176 - 9076) + chr(0b1100 + 0o131))(chr(7190 - 7073) + chr(10845 - 10729) + chr(102) + chr(45) + '\x38'))) ottSTmIi6cZv = hXMPsSrOQzbh.get_asset_address(XwVpcyasdpoL) xFvvTXkV19m1 = SrMTpcNaNYrr.b58decode(t2wxUk3dlUBZ).to_bytes() mvg4mknDLPWg = SrMTpcNaNYrr.b58decode(wnGtNiITIJnM).to_bytes() iiL4QjBJewVQ = SrMTpcNaNYrr.b58decode(WQwHjkQ5zluT).to_bytes() VMBC47Reoq4Q = [{roI3spqORKae(ES5oEprVxulp(b'j\x93_\x07'), chr(0b1100100) + '\x65' + '\x63' + chr(7526 - 7415) + '\x64' + chr(4816 - 4715))(chr(117) + chr(0b100010 + 0o122) + chr(5849 - 5747) + '\x2d' + '\x38'): xFvvTXkV19m1, roI3spqORKae(ES5oEprVxulp(b'x\x8e'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(0b1010111 + 0o30) + chr(7878 - 7778) + '\x65')('\165' + '\x74' + chr(8423 - 8321) + '\x2d' + '\x38'): mvg4mknDLPWg, roI3spqORKae(ES5oEprVxulp(b'm\x8c_\x1f\xf2S'), chr(0b1100100) + chr(101) + chr(99) + '\x6f' + chr(0b1100100) + chr(0b110101 + 0o60))(chr(0b101100 + 0o111) + chr(0b1100101 + 0o17) + chr(0b1100110) + '\055' + '\070'): WwJhdr7TpaLo}] q6rQEi0QQtdg = lvVe_ItRqdAZ(ottSTmIi6cZv, ES5oEprVxulp(b'\x0c'), roI3spqORKae(ES5oEprVxulp(b'x\x93Q\x04\xefA\xab\x0e'), '\x64' + chr(101) + chr(0b1100011) + chr(0b1010111 + 0o30) + chr(0b1011 + 0o131) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(3573 - 3471) + chr(726 - 681) + chr(56)), VMBC47Reoq4Q) return Qq6Yax3kS4s_(nzTpIcepk0o8(chr(885 - 837) + '\x6f' + chr(48), 8), nzTpIcepk0o8(chr(48) + chr(0b1100011 + 0o14) + '\063' + chr(0b100101 + 0o15) + chr(49), ord("\x08")), nzTpIcepk0o8(oprIvDIRQyCb()), Xu2pA_hYO4Yk, kkj6Kplau3cQ, iiL4QjBJewVQ, q6rQEi0QQtdg, MdkNqd1bagO6(), H4NoA26ON7iG())
ontio/ontology-python-sdk
ontology/smart_contract/native_contract/asset.py
Asset.new_approve_transaction
def new_approve_transaction(self, asset: str, b58_send_address: str, b58_recv_address: str, amount: int, b58_payer_address: str, gas_limit: int, gas_price: int) -> Transaction: """ This interface is used to generate a Transaction object for approve. :param asset: a string which is used to indicate which asset we want to approve. :param b58_send_address: a base58 encode address which indicate where the approve from. :param b58_recv_address: a base58 encode address which indicate where the approve to. :param amount: the amount of asset that will be approved. :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: a Transaction object which can be used for approve. """ if not isinstance(b58_send_address, str) or not isinstance(b58_recv_address, str): raise SDKException(ErrorCode.param_err('the data type of base58 encode address should be the string.')) if len(b58_send_address) != 34 or len(b58_recv_address) != 34: raise SDKException(ErrorCode.param_err('the length of base58 encode address should be 34 bytes.')) if amount <= 0: raise SDKException(ErrorCode.other_error('the amount should be greater than than zero.')) if gas_price < 0: raise SDKException(ErrorCode.other_error('the gas price should be equal or greater than zero.')) if gas_limit < 0: raise SDKException(ErrorCode.other_error('the gas limit should be equal or greater than zero.')) contract_address = self.get_asset_address(asset) raw_send = Address.b58decode(b58_send_address).to_bytes() raw_recv = Address.b58decode(b58_recv_address).to_bytes() raw_payer = Address.b58decode(b58_payer_address).to_bytes() args = {"from": raw_send, "to": raw_recv, "amount": amount} invoke_code = build_native_invoke_code(contract_address, b'\x00', 'approve', args) return Transaction(0, 0xd1, int(time()), gas_price, gas_limit, raw_payer, invoke_code, bytearray(), list())
python
def new_approve_transaction(self, asset: str, b58_send_address: str, b58_recv_address: str, amount: int, b58_payer_address: str, gas_limit: int, gas_price: int) -> Transaction: """ This interface is used to generate a Transaction object for approve. :param asset: a string which is used to indicate which asset we want to approve. :param b58_send_address: a base58 encode address which indicate where the approve from. :param b58_recv_address: a base58 encode address which indicate where the approve to. :param amount: the amount of asset that will be approved. :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: a Transaction object which can be used for approve. """ if not isinstance(b58_send_address, str) or not isinstance(b58_recv_address, str): raise SDKException(ErrorCode.param_err('the data type of base58 encode address should be the string.')) if len(b58_send_address) != 34 or len(b58_recv_address) != 34: raise SDKException(ErrorCode.param_err('the length of base58 encode address should be 34 bytes.')) if amount <= 0: raise SDKException(ErrorCode.other_error('the amount should be greater than than zero.')) if gas_price < 0: raise SDKException(ErrorCode.other_error('the gas price should be equal or greater than zero.')) if gas_limit < 0: raise SDKException(ErrorCode.other_error('the gas limit should be equal or greater than zero.')) contract_address = self.get_asset_address(asset) raw_send = Address.b58decode(b58_send_address).to_bytes() raw_recv = Address.b58decode(b58_recv_address).to_bytes() raw_payer = Address.b58decode(b58_payer_address).to_bytes() args = {"from": raw_send, "to": raw_recv, "amount": amount} invoke_code = build_native_invoke_code(contract_address, b'\x00', 'approve', args) return Transaction(0, 0xd1, int(time()), gas_price, gas_limit, raw_payer, invoke_code, bytearray(), list())
[ "def", "new_approve_transaction", "(", "self", ",", "asset", ":", "str", ",", "b58_send_address", ":", "str", ",", "b58_recv_address", ":", "str", ",", "amount", ":", "int", ",", "b58_payer_address", ":", "str", ",", "gas_limit", ":", "int", ",", "gas_price", ":", "int", ")", "->", "Transaction", ":", "if", "not", "isinstance", "(", "b58_send_address", ",", "str", ")", "or", "not", "isinstance", "(", "b58_recv_address", ",", "str", ")", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_err", "(", "'the data type of base58 encode address should be the string.'", ")", ")", "if", "len", "(", "b58_send_address", ")", "!=", "34", "or", "len", "(", "b58_recv_address", ")", "!=", "34", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_err", "(", "'the length of base58 encode address should be 34 bytes.'", ")", ")", "if", "amount", "<=", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the amount should be greater than than zero.'", ")", ")", "if", "gas_price", "<", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the gas price should be equal or greater than zero.'", ")", ")", "if", "gas_limit", "<", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the gas limit should be equal or greater than zero.'", ")", ")", "contract_address", "=", "self", ".", "get_asset_address", "(", "asset", ")", "raw_send", "=", "Address", ".", "b58decode", "(", "b58_send_address", ")", ".", "to_bytes", "(", ")", "raw_recv", "=", "Address", ".", "b58decode", "(", "b58_recv_address", ")", ".", "to_bytes", "(", ")", "raw_payer", "=", "Address", ".", "b58decode", "(", "b58_payer_address", ")", ".", "to_bytes", "(", ")", "args", "=", "{", "\"from\"", ":", "raw_send", ",", "\"to\"", ":", "raw_recv", ",", "\"amount\"", ":", "amount", "}", "invoke_code", "=", "build_native_invoke_code", "(", "contract_address", ",", "b'\\x00'", ",", "'approve'", ",", "args", ")", "return", "Transaction", "(", "0", ",", "0xd1", ",", "int", "(", "time", "(", ")", ")", ",", "gas_price", ",", "gas_limit", ",", "raw_payer", ",", "invoke_code", ",", "bytearray", "(", ")", ",", "list", "(", ")", ")" ]
This interface is used to generate a Transaction object for approve. :param asset: a string which is used to indicate which asset we want to approve. :param b58_send_address: a base58 encode address which indicate where the approve from. :param b58_recv_address: a base58 encode address which indicate where the approve to. :param amount: the amount of asset that will be approved. :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: a Transaction object which can be used for approve.
[ "This", "interface", "is", "used", "to", "generate", "a", "Transaction", "object", "for", "approve", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/asset.py#L168-L198
train
This interface is used to generate a Transaction object which can be used to approve an asset.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZ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MV,typojWN5Phrq,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1848 - 1800) + '\157' + '\061' + chr(0b100100 + 0o16) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(1500 - 1452) + chr(4078 - 3967) + '\062' + chr(0b10100 + 0o35) + chr(52), 50221 - 50213), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\065' + chr(1840 - 1790), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110010) + '\066' + chr(49), 0b1000), nzTpIcepk0o8(chr(1446 - 1398) + chr(0b1101111) + chr(50) + '\x32' + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(1853 - 1805) + chr(7790 - 7679) + chr(1794 - 1739), ord("\x08")), nzTpIcepk0o8(chr(0b101 + 0o53) + '\x6f' + chr(0b1101 + 0o52) + chr(48), 0o10), nzTpIcepk0o8(chr(1670 - 1622) + '\x6f' + chr(0b10110 + 0o35) + chr(0b110010) + chr(1010 - 955), 0b1000), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(111) + '\x32' + chr(49) + '\x35', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + chr(393 - 340) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(2726 - 2615) + '\x32' + '\064' + chr(0b101101 + 0o10), 0o10), nzTpIcepk0o8(chr(84 - 36) + chr(0b1101111) + chr(213 - 163) + chr(271 - 218) + chr(0b110100), 8), nzTpIcepk0o8('\060' + chr(111) + '\061' + chr(0b110011), 2657 - 2649), nzTpIcepk0o8(chr(48) + chr(111) + chr(51) + chr(55) + '\066', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b111100 + 0o63) + '\x33' + chr(0b101 + 0o60), 0o10), nzTpIcepk0o8('\x30' + chr(9047 - 8936) + chr(50) + '\067' + '\064', 0b1000), nzTpIcepk0o8(chr(709 - 661) + '\x6f' + chr(1798 - 1748) + chr(0b100101 + 0o22) + chr(0b110100), 8), nzTpIcepk0o8(chr(356 - 308) + chr(11516 - 11405) + chr(0b110010) + '\x32' + chr(0b100100 + 0o14), 21352 - 21344), nzTpIcepk0o8(chr(48) + '\157' + chr(0b10000 + 0o41) + chr(48), 37878 - 37870), nzTpIcepk0o8(chr(0b110000) + chr(0b11010 + 0o125) + chr(0b110011) + chr(0b110001) + '\067', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(5213 - 5102) + '\063' + chr(0b110010) + chr(52), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b100101 + 0o112) + chr(0b1010 + 0o51) + chr(0b101101 + 0o5) + '\062', 144 - 136), nzTpIcepk0o8(chr(0b1 + 0o57) + '\157' + '\x31' + '\061' + chr(50), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + '\x36' + chr(0b11001 + 0o33), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(484 - 435) + '\065' + chr(48), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b100001 + 0o21) + chr(0b10000 + 0o40) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(51) + chr(50) + chr(51), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110010) + chr(0b110010) + chr(0b10110 + 0o40), 8), nzTpIcepk0o8(chr(0b100101 + 0o13) + '\157' + '\x33' + chr(65 - 13) + '\x35', 10640 - 10632), nzTpIcepk0o8(chr(0b11001 + 0o27) + '\157' + '\062' + chr(2468 - 2416) + chr(0b11100 + 0o32), 29935 - 29927), nzTpIcepk0o8(chr(1774 - 1726) + chr(8772 - 8661) + chr(0b100110 + 0o13) + chr(466 - 411) + chr(53), 0b1000), nzTpIcepk0o8(chr(1084 - 1036) + chr(111) + '\x33' + '\067' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(1292 - 1244) + '\x6f' + chr(0b110001) + '\x35' + '\065', 24557 - 24549), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + '\x31' + chr(1728 - 1675) + chr(0b101010 + 0o6), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b101 + 0o55) + chr(52) + '\x37', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b10000 + 0o43) + chr(0b110111) + chr(0b100111 + 0o14), 0b1000), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(5373 - 5262) + chr(1414 - 1365) + chr(55) + '\x30', 0b1000), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(0b1101111) + chr(2348 - 2293) + '\x37', 0b1000), nzTpIcepk0o8(chr(2189 - 2141) + chr(0b1000100 + 0o53) + chr(55) + chr(0b110000), 8), nzTpIcepk0o8(chr(0b101111 + 0o1) + '\x6f' + chr(1413 - 1364) + chr(1651 - 1596) + chr(51), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(111) + chr(490 - 437) + chr(0b10000 + 0o40), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'y'), '\144' + chr(9630 - 9529) + chr(0b1001011 + 0o30) + '\x6f' + chr(0b1100100) + chr(0b1011001 + 0o14))(chr(117) + chr(8606 - 8490) + '\x66' + '\055' + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def PghGvY9hPJOR(hXMPsSrOQzbh, XwVpcyasdpoL, DBXcaAgY1jpq, TBJsVZFaNaUJ, WwJhdr7TpaLo, WQwHjkQ5zluT, kkj6Kplau3cQ, Xu2pA_hYO4Yk) -> Qq6Yax3kS4s_: if not suIjIS24Zkqw(DBXcaAgY1jpq, N9zlRy29S1SS) or not suIjIS24Zkqw(TBJsVZFaNaUJ, N9zlRy29S1SS): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b"'\xedX\xd0\xfbX]\xa5\xff"), chr(100) + '\145' + chr(9409 - 9310) + chr(0b1101001 + 0o6) + chr(7151 - 7051) + '\x65')(chr(4496 - 4379) + chr(0b1110100) + chr(6576 - 6474) + '\x2d' + chr(56)))(roI3spqORKae(ES5oEprVxulp(b"#\xe4O\x91\xf2fL\xb6\xad\xd8\xdc\xdcn\xder\xda\x9c\xf2i\xbc\xb1\xe7rT\r\xe9\xb0\xf9\x81\xc3]\x98\t\x0c\xd5\x9e\x0bL\x18\x08?\xe3_\xdd\xf2'Z\xb2\xad\xd8\xcd\xc9+\x8di\xce\xd5\xfeo\xe1"), chr(100) + '\x65' + '\x63' + chr(1710 - 1599) + chr(0b1100100) + '\145')('\165' + '\164' + chr(9028 - 8926) + chr(0b10000 + 0o35) + chr(373 - 317)))) if ftfygxgFas5X(DBXcaAgY1jpq) != nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110100) + chr(50), 0o10) or ftfygxgFas5X(TBJsVZFaNaUJ) != nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110100) + chr(2208 - 2158), 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b"'\xedX\xd0\xfbX]\xa5\xff"), chr(7411 - 7311) + chr(0b111000 + 0o55) + '\143' + chr(0b1100110 + 0o11) + chr(9550 - 9450) + chr(0b1100101))(chr(0b1100011 + 0o22) + chr(116) + chr(0b1100110) + '\055' + '\070'))(roI3spqORKae(ES5oEprVxulp(b"#\xe4O\x91\xfabV\xb0\xf9\xc4\x85\xc3m\xde\x7f\xdd\xcf\xf5=\xf7\xf4\xb7$\x17\x07\xe3\xb6\xb6\x84\xc2\x19\x8b\x08\x1b\xd4\xdb\x0bWW\x0e;\xe8\n\xd3\xf3'\x0b\xe3\xad\xce\xdc\xd8n\x8d3"), chr(100) + '\x65' + chr(0b1100011) + '\157' + chr(0b111000 + 0o54) + '\145')(chr(0b10001 + 0o144) + '\164' + chr(0b1100110) + '\x2d' + chr(2369 - 2313)))) if WwJhdr7TpaLo <= nzTpIcepk0o8('\060' + chr(111) + '\x30', ord("\x08")): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'8\xf8B\xd4\xe4X]\xa5\xff\xc3\xd7'), chr(9028 - 8928) + chr(0b1100101) + '\x63' + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(0b110010 + 0o103) + '\164' + chr(102) + chr(1517 - 1472) + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'#\xe4O\x91\xf7jW\xa2\xe3\xd8\x85\xdfc\x91h\xd0\xd8\xb0j\xaa\xf4\xb58\x11\t\xf3\xb6\xe4\xc5\xd2\x15\x98\x03H\xd3\x93\x19Q\x18\x012\xfeE\x9f'), '\x64' + chr(101) + chr(4582 - 4483) + chr(0b1000010 + 0o55) + chr(100) + chr(5710 - 5609))('\165' + chr(0b1110100) + '\x66' + chr(91 - 46) + chr(0b100011 + 0o25)))) if Xu2pA_hYO4Yk < nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x30', 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'8\xf8B\xd4\xe4X]\xa5\xff\xc3\xd7'), chr(0b1100100) + chr(7031 - 6930) + '\x63' + chr(111) + '\x64' + chr(1542 - 1441))(chr(0b11111 + 0o126) + chr(0b1110100) + chr(0b101000 + 0o76) + chr(0b110 + 0o47) + '\070'))(roI3spqORKae(ES5oEprVxulp(b"#\xe4O\x91\xf1fK\xf7\xfd\xde\xcc\xcfn\xden\xd4\xd3\xe5d\xab\xf4\xb0/T\r\xf6\xa6\xf7\x89\x86\x12\x8bM\x0f\xd5\x9e\x19K]\tw\xf8B\xd0\xf8'B\xb2\xff\xc3\x8b"), '\x64' + chr(0b1100 + 0o131) + chr(99) + chr(0b101101 + 0o102) + '\144' + chr(0b1110 + 0o127))(chr(0b1110101) + chr(0b1101001 + 0o13) + chr(102) + '\055' + chr(0b100100 + 0o24)))) if kkj6Kplau3cQ < nzTpIcepk0o8(chr(0b101 + 0o53) + chr(0b1101100 + 0o3) + chr(0b101111 + 0o1), 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'8\xf8B\xd4\xe4X]\xa5\xff\xc3\xd7'), '\x64' + chr(6370 - 6269) + '\143' + chr(111) + '\144' + chr(2662 - 2561))(chr(117) + chr(116) + chr(102) + chr(263 - 218) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b"#\xe4O\x91\xf1fK\xf7\xe1\xc5\xc8\xc5\x7f\xden\xd4\xd3\xe5d\xab\xf4\xb0/T\r\xf6\xa6\xf7\x89\x86\x12\x8bM\x0f\xd5\x9e\x19K]\tw\xf8B\xd0\xf8'B\xb2\xff\xc3\x8b"), '\144' + '\145' + '\x63' + chr(0b10001 + 0o136) + chr(0b1100100) + '\x65')(chr(13386 - 13269) + chr(4783 - 4667) + chr(8636 - 8534) + chr(0b10 + 0o53) + chr(56)))) ottSTmIi6cZv = hXMPsSrOQzbh.get_asset_address(XwVpcyasdpoL) EVKTGVTjvtmE = SrMTpcNaNYrr.b58decode(DBXcaAgY1jpq).to_bytes() MaoPF5uQRgxy = SrMTpcNaNYrr.b58decode(TBJsVZFaNaUJ).to_bytes() iiL4QjBJewVQ = SrMTpcNaNYrr.b58decode(WQwHjkQ5zluT).to_bytes() eemPYp2vtTSr = {roI3spqORKae(ES5oEprVxulp(b'1\xfeE\xdc'), chr(0b110 + 0o136) + '\145' + chr(99) + chr(11879 - 11768) + chr(100) + '\x65')('\x75' + chr(116) + '\x66' + '\x2d' + chr(0b111000)): EVKTGVTjvtmE, roI3spqORKae(ES5oEprVxulp(b'#\xe3'), chr(0b110 + 0o136) + '\x65' + chr(0b1100011) + '\x6f' + '\144' + '\x65')(chr(117) + '\164' + chr(102) + chr(0b101101) + chr(2509 - 2453)): MaoPF5uQRgxy, roI3spqORKae(ES5oEprVxulp(b'6\xe1E\xc4\xf8s'), '\144' + chr(0b11100 + 0o111) + '\143' + chr(115 - 4) + '\144' + '\145')(chr(0b11010 + 0o133) + chr(0b1110100) + '\146' + '\x2d' + '\070'): WwJhdr7TpaLo} q6rQEi0QQtdg = lvVe_ItRqdAZ(ottSTmIi6cZv, ES5oEprVxulp(b'W'), roI3spqORKae(ES5oEprVxulp(b'6\xfcZ\xc3\xf9q]'), chr(0b1001001 + 0o33) + '\x65' + '\143' + '\x6f' + chr(0b1100100) + '\145')(chr(0b1110101) + chr(0b11101 + 0o127) + '\146' + '\055' + '\x38'), eemPYp2vtTSr) return Qq6Yax3kS4s_(nzTpIcepk0o8(chr(1697 - 1649) + chr(0b1000110 + 0o51) + chr(1757 - 1709), 8), nzTpIcepk0o8(chr(2011 - 1963) + chr(2952 - 2841) + chr(51) + chr(0b110010) + chr(0b110001), 0o10), nzTpIcepk0o8(oprIvDIRQyCb()), Xu2pA_hYO4Yk, kkj6Kplau3cQ, iiL4QjBJewVQ, q6rQEi0QQtdg, MdkNqd1bagO6(), H4NoA26ON7iG())
ontio/ontology-python-sdk
ontology/smart_contract/native_contract/asset.py
Asset.new_transfer_from_transaction
def new_transfer_from_transaction(self, asset: str, b58_send_address: str, b58_from_address: str, b58_recv_address: str, amount: int, b58_payer_address: str, gas_limit: int, gas_price: int) -> Transaction: """ This interface is used to generate a Transaction object that allow one account to transfer a amount of ONT or ONG Asset to another account, in the condition of the first account had been approved. :param asset: a string which is used to indicate which asset we want to transfer. :param b58_send_address: a base58 encode address which indicate where the asset from. :param b58_from_address: a base58 encode address which indicate where the asset from. :param b58_recv_address: a base58 encode address which indicate where the asset to. :param amount: the amount of asset that will be transferred. :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: a Transaction object which allow one account to transfer a amount of asset to another account. """ raw_sender = Address.b58decode(b58_send_address).to_bytes() raw_from = Address.b58decode(b58_from_address).to_bytes() raw_to = Address.b58decode(b58_recv_address).to_bytes() raw_payer = Address.b58decode(b58_payer_address).to_bytes() contract_address = self.get_asset_address(asset) args = {"sender": raw_sender, "from": raw_from, "to": raw_to, "amount": amount} invoke_code = build_native_invoke_code(contract_address, b'\x00', "transferFrom", args) return Transaction(0, 0xd1, int(time()), gas_price, gas_limit, raw_payer, invoke_code, bytearray(), list())
python
def new_transfer_from_transaction(self, asset: str, b58_send_address: str, b58_from_address: str, b58_recv_address: str, amount: int, b58_payer_address: str, gas_limit: int, gas_price: int) -> Transaction: """ This interface is used to generate a Transaction object that allow one account to transfer a amount of ONT or ONG Asset to another account, in the condition of the first account had been approved. :param asset: a string which is used to indicate which asset we want to transfer. :param b58_send_address: a base58 encode address which indicate where the asset from. :param b58_from_address: a base58 encode address which indicate where the asset from. :param b58_recv_address: a base58 encode address which indicate where the asset to. :param amount: the amount of asset that will be transferred. :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: a Transaction object which allow one account to transfer a amount of asset to another account. """ raw_sender = Address.b58decode(b58_send_address).to_bytes() raw_from = Address.b58decode(b58_from_address).to_bytes() raw_to = Address.b58decode(b58_recv_address).to_bytes() raw_payer = Address.b58decode(b58_payer_address).to_bytes() contract_address = self.get_asset_address(asset) args = {"sender": raw_sender, "from": raw_from, "to": raw_to, "amount": amount} invoke_code = build_native_invoke_code(contract_address, b'\x00', "transferFrom", args) return Transaction(0, 0xd1, int(time()), gas_price, gas_limit, raw_payer, invoke_code, bytearray(), list())
[ "def", "new_transfer_from_transaction", "(", "self", ",", "asset", ":", "str", ",", "b58_send_address", ":", "str", ",", "b58_from_address", ":", "str", ",", "b58_recv_address", ":", "str", ",", "amount", ":", "int", ",", "b58_payer_address", ":", "str", ",", "gas_limit", ":", "int", ",", "gas_price", ":", "int", ")", "->", "Transaction", ":", "raw_sender", "=", "Address", ".", "b58decode", "(", "b58_send_address", ")", ".", "to_bytes", "(", ")", "raw_from", "=", "Address", ".", "b58decode", "(", "b58_from_address", ")", ".", "to_bytes", "(", ")", "raw_to", "=", "Address", ".", "b58decode", "(", "b58_recv_address", ")", ".", "to_bytes", "(", ")", "raw_payer", "=", "Address", ".", "b58decode", "(", "b58_payer_address", ")", ".", "to_bytes", "(", ")", "contract_address", "=", "self", ".", "get_asset_address", "(", "asset", ")", "args", "=", "{", "\"sender\"", ":", "raw_sender", ",", "\"from\"", ":", "raw_from", ",", "\"to\"", ":", "raw_to", ",", "\"amount\"", ":", "amount", "}", "invoke_code", "=", "build_native_invoke_code", "(", "contract_address", ",", "b'\\x00'", ",", "\"transferFrom\"", ",", "args", ")", "return", "Transaction", "(", "0", ",", "0xd1", ",", "int", "(", "time", "(", ")", ")", ",", "gas_price", ",", "gas_limit", ",", "raw_payer", ",", "invoke_code", ",", "bytearray", "(", ")", ",", "list", "(", ")", ")" ]
This interface is used to generate a Transaction object that allow one account to transfer a amount of ONT or ONG Asset to another account, in the condition of the first account had been approved. :param asset: a string which is used to indicate which asset we want to transfer. :param b58_send_address: a base58 encode address which indicate where the asset from. :param b58_from_address: a base58 encode address which indicate where the asset from. :param b58_recv_address: a base58 encode address which indicate where the asset to. :param amount: the amount of asset that will be transferred. :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: a Transaction object which allow one account to transfer a amount of asset to another account.
[ "This", "interface", "is", "used", "to", "generate", "a", "Transaction", "object", "that", "allow", "one", "account", "to", "transfer", "a", "amount", "of", "ONT", "or", "ONG", "Asset", "to", "another", "account", "in", "the", "condition", "of", "the", "first", "account", "had", "been", "approved", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/asset.py#L200-L224
train
This interface is used to generate a Transaction object which allows one account to transfer a amount of ONT or ONG Asset to another account.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nA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q33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\157' + chr(0b10001 + 0o43), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1000010 + 0o55) + chr(1923 - 1868) + chr(0b110110), 26436 - 26428), nzTpIcepk0o8(chr(621 - 573) + '\x6f' + chr(793 - 742) + chr(50) + '\x30', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\062' + '\x31' + '\062', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1001111 + 0o40) + chr(0b110100) + chr(1722 - 1673), 55924 - 55916), nzTpIcepk0o8('\060' + chr(111) + chr(721 - 670) + chr(51) + chr(55), ord("\x08")), nzTpIcepk0o8('\x30' + chr(4480 - 4369) + chr(51) + '\060' + chr(0b11 + 0o62), 20208 - 20200), nzTpIcepk0o8('\060' + '\157' + chr(0b110001) + chr(52) + chr(0b110010), 37822 - 37814), nzTpIcepk0o8(chr(48) + chr(0b11110 + 0o121) + '\063' + '\x33' + '\061', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(9975 - 9864) + chr(0b101010 + 0o10) + '\x31' + '\x33', 0b1000), nzTpIcepk0o8(chr(2034 - 1986) + '\x6f' + chr(51) + chr(0b110110) + chr(49), 54893 - 54885), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\067' + chr(0b100110 + 0o13), 17758 - 17750), nzTpIcepk0o8(chr(0b110000) + chr(11409 - 11298) + chr(0b11010 + 0o31) + chr(0b110011) + '\x31', 8), nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(0b11 + 0o154) + '\x33' + chr(0b100000 + 0o25) + chr(0b100011 + 0o23), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(9258 - 9147) + chr(0b101101 + 0o7) + '\x35', 34111 - 34103), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + chr(0b11011 + 0o31), 0b1000), nzTpIcepk0o8(chr(48) + chr(2819 - 2708) + '\061' + '\x31' + chr(48), 59272 - 59264), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b11000 + 0o32) + chr(0b1010 + 0o54) + chr(1417 - 1364), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\061' + '\x30' + chr(460 - 407), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b100010 + 0o20) + '\067' + '\062', ord("\x08")), nzTpIcepk0o8(chr(522 - 474) + '\157' + chr(0b10100 + 0o37) + chr(422 - 369) + chr(49), 61816 - 61808), nzTpIcepk0o8('\060' + '\157' + '\x31' + '\063' + chr(53), 0o10), nzTpIcepk0o8(chr(1545 - 1497) + chr(0b111001 + 0o66) + chr(1008 - 957) + chr(51) + '\062', 12256 - 12248), nzTpIcepk0o8(chr(0b110000) + chr(0b1010000 + 0o37) + chr(0b11011 + 0o30) + chr(0b100000 + 0o21) + chr(0b110010 + 0o5), 0b1000), nzTpIcepk0o8(chr(0b100010 + 0o16) + '\x6f' + chr(0b101110 + 0o4) + '\065' + chr(0b10000 + 0o45), ord("\x08")), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b1101111) + '\x33' + '\064' + '\064', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + '\066' + '\062', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(50) + '\065' + chr(752 - 700), 9729 - 9721), nzTpIcepk0o8(chr(234 - 186) + chr(10080 - 9969) + chr(127 - 78) + chr(1333 - 1283) + chr(52), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b1010 + 0o50) + '\064' + chr(720 - 671), 0o10), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(0b1101111) + '\066', 0o10), nzTpIcepk0o8(chr(1487 - 1439) + '\157' + '\063' + chr(1022 - 967) + chr(50), 42534 - 42526), nzTpIcepk0o8('\060' + chr(0b1000011 + 0o54) + '\x31' + '\x37' + '\x32', 60963 - 60955), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + '\067' + '\x30', 22050 - 22042), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110000 + 0o2) + chr(1811 - 1759) + '\067', ord("\x08")), nzTpIcepk0o8('\x30' + chr(10251 - 10140) + '\x32' + chr(0b110100) + chr(0b110100), 9415 - 9407), nzTpIcepk0o8(chr(48) + '\157' + chr(0b101111 + 0o2) + '\064' + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(111) + '\x33' + '\x31' + chr(2415 - 2363), ord("\x08")), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(8665 - 8554) + '\062' + '\064' + chr(1600 - 1549), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1936 - 1888) + '\x6f' + '\065' + '\060', ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'*'), '\144' + '\145' + chr(0b1100011) + chr(0b111101 + 0o62) + '\144' + chr(5661 - 5560))(chr(0b1110101) + chr(1264 - 1148) + '\146' + '\055' + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def MCAP5bYhGmio(hXMPsSrOQzbh, XwVpcyasdpoL, DBXcaAgY1jpq, t2wxUk3dlUBZ, TBJsVZFaNaUJ, WwJhdr7TpaLo, WQwHjkQ5zluT, kkj6Kplau3cQ, Xu2pA_hYO4Yk) -> Qq6Yax3kS4s_: EcaRbKoxm4oX = SrMTpcNaNYrr.b58decode(DBXcaAgY1jpq).to_bytes() xFvvTXkV19m1 = SrMTpcNaNYrr.b58decode(t2wxUk3dlUBZ).to_bytes() mvg4mknDLPWg = SrMTpcNaNYrr.b58decode(TBJsVZFaNaUJ).to_bytes() iiL4QjBJewVQ = SrMTpcNaNYrr.b58decode(WQwHjkQ5zluT).to_bytes() ottSTmIi6cZv = hXMPsSrOQzbh.get_asset_address(XwVpcyasdpoL) eemPYp2vtTSr = {roI3spqORKae(ES5oEprVxulp(b'w[\xbe\xeeD\xad'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(111) + chr(0b1100100) + chr(4131 - 4030))(chr(0b1110101) + '\164' + chr(4948 - 4846) + chr(0b101101) + chr(2761 - 2705)): EcaRbKoxm4oX, roI3spqORKae(ES5oEprVxulp(b'bL\xbf\xe7'), chr(5147 - 5047) + chr(0b1001011 + 0o32) + chr(0b1100011) + chr(0b1000100 + 0o53) + chr(0b10000 + 0o124) + chr(0b1000001 + 0o44))(chr(117) + chr(116) + chr(0b1011101 + 0o11) + '\055' + chr(0b111000)): xFvvTXkV19m1, roI3spqORKae(ES5oEprVxulp(b'pQ'), chr(0b1001010 + 0o32) + chr(101) + chr(1118 - 1019) + chr(0b1101111) + chr(5404 - 5304) + chr(101))(chr(3818 - 3701) + chr(12103 - 11987) + chr(0b1100110) + chr(0b101101) + '\x38'): mvg4mknDLPWg, roI3spqORKae(ES5oEprVxulp(b'eS\xbf\xffO\xab'), chr(0b1001100 + 0o30) + chr(648 - 547) + chr(2209 - 2110) + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(117) + chr(116) + chr(5247 - 5145) + '\x2d' + chr(0b110001 + 0o7)): WwJhdr7TpaLo} q6rQEi0QQtdg = lvVe_ItRqdAZ(ottSTmIi6cZv, ES5oEprVxulp(b'\x04'), roI3spqORKae(ES5oEprVxulp(b'pL\xb1\xe4R\xb9\xa0\x10\x9f\xf9\x9eT'), '\144' + '\x65' + '\x63' + '\x6f' + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(102) + chr(45) + chr(954 - 898)), eemPYp2vtTSr) return Qq6Yax3kS4s_(nzTpIcepk0o8(chr(48) + chr(0b110010 + 0o75) + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\x33' + chr(1426 - 1376) + chr(569 - 520), 0b1000), nzTpIcepk0o8(oprIvDIRQyCb()), Xu2pA_hYO4Yk, kkj6Kplau3cQ, iiL4QjBJewVQ, q6rQEi0QQtdg, MdkNqd1bagO6(), H4NoA26ON7iG())
ontio/ontology-python-sdk
ontology/smart_contract/native_contract/asset.py
Asset.new_withdraw_ong_transaction
def new_withdraw_ong_transaction(self, b58_claimer_address: str, b58_recv_address: str, amount: int, b58_payer_address: str, gas_limit: int, gas_price: int) -> Transaction: """ This interface is used to generate a Transaction object that allow one account to withdraw an amount of ong and transfer them to receive address. :param b58_claimer_address: a base58 encode address which is used to indicate who is the claimer. :param b58_recv_address: a base58 encode address which is used to indicate who receive the claimed ong. :param amount: the amount of asset that will be claimed. :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: a Transaction object which can be used for withdraw ong. """ if not isinstance(b58_claimer_address, str) or not isinstance(b58_recv_address, str) or not isinstance( b58_payer_address, str): raise SDKException(ErrorCode.param_err('the data type of base58 encode address should be the string.')) if len(b58_claimer_address) != 34 or len(b58_recv_address) != 34 or len(b58_payer_address) != 34: raise SDKException(ErrorCode.param_err('the length of base58 encode address should be 34 bytes.')) if amount <= 0: raise SDKException(ErrorCode.other_error('the amount should be greater than than zero.')) if gas_price < 0: raise SDKException(ErrorCode.other_error('the gas price should be equal or greater than zero.')) if gas_limit < 0: raise SDKException(ErrorCode.other_error('the gas limit should be equal or greater than zero.')) ont_contract_address = self.get_asset_address('ont') ong_contract_address = self.get_asset_address("ong") args = {"sender": Address.b58decode(b58_claimer_address).to_bytes(), "from": ont_contract_address, "to": Address.b58decode(b58_recv_address).to_bytes(), "value": amount} invoke_code = build_native_invoke_code(ong_contract_address, b'\x00', "transferFrom", args) payer_array = Address.b58decode(b58_payer_address).to_bytes() return Transaction(0, 0xd1, int(time()), gas_price, gas_limit, payer_array, invoke_code, bytearray(), list())
python
def new_withdraw_ong_transaction(self, b58_claimer_address: str, b58_recv_address: str, amount: int, b58_payer_address: str, gas_limit: int, gas_price: int) -> Transaction: """ This interface is used to generate a Transaction object that allow one account to withdraw an amount of ong and transfer them to receive address. :param b58_claimer_address: a base58 encode address which is used to indicate who is the claimer. :param b58_recv_address: a base58 encode address which is used to indicate who receive the claimed ong. :param amount: the amount of asset that will be claimed. :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: a Transaction object which can be used for withdraw ong. """ if not isinstance(b58_claimer_address, str) or not isinstance(b58_recv_address, str) or not isinstance( b58_payer_address, str): raise SDKException(ErrorCode.param_err('the data type of base58 encode address should be the string.')) if len(b58_claimer_address) != 34 or len(b58_recv_address) != 34 or len(b58_payer_address) != 34: raise SDKException(ErrorCode.param_err('the length of base58 encode address should be 34 bytes.')) if amount <= 0: raise SDKException(ErrorCode.other_error('the amount should be greater than than zero.')) if gas_price < 0: raise SDKException(ErrorCode.other_error('the gas price should be equal or greater than zero.')) if gas_limit < 0: raise SDKException(ErrorCode.other_error('the gas limit should be equal or greater than zero.')) ont_contract_address = self.get_asset_address('ont') ong_contract_address = self.get_asset_address("ong") args = {"sender": Address.b58decode(b58_claimer_address).to_bytes(), "from": ont_contract_address, "to": Address.b58decode(b58_recv_address).to_bytes(), "value": amount} invoke_code = build_native_invoke_code(ong_contract_address, b'\x00', "transferFrom", args) payer_array = Address.b58decode(b58_payer_address).to_bytes() return Transaction(0, 0xd1, int(time()), gas_price, gas_limit, payer_array, invoke_code, bytearray(), list())
[ "def", "new_withdraw_ong_transaction", "(", "self", ",", "b58_claimer_address", ":", "str", ",", "b58_recv_address", ":", "str", ",", "amount", ":", "int", ",", "b58_payer_address", ":", "str", ",", "gas_limit", ":", "int", ",", "gas_price", ":", "int", ")", "->", "Transaction", ":", "if", "not", "isinstance", "(", "b58_claimer_address", ",", "str", ")", "or", "not", "isinstance", "(", "b58_recv_address", ",", "str", ")", "or", "not", "isinstance", "(", "b58_payer_address", ",", "str", ")", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_err", "(", "'the data type of base58 encode address should be the string.'", ")", ")", "if", "len", "(", "b58_claimer_address", ")", "!=", "34", "or", "len", "(", "b58_recv_address", ")", "!=", "34", "or", "len", "(", "b58_payer_address", ")", "!=", "34", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_err", "(", "'the length of base58 encode address should be 34 bytes.'", ")", ")", "if", "amount", "<=", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the amount should be greater than than zero.'", ")", ")", "if", "gas_price", "<", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the gas price should be equal or greater than zero.'", ")", ")", "if", "gas_limit", "<", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the gas limit should be equal or greater than zero.'", ")", ")", "ont_contract_address", "=", "self", ".", "get_asset_address", "(", "'ont'", ")", "ong_contract_address", "=", "self", ".", "get_asset_address", "(", "\"ong\"", ")", "args", "=", "{", "\"sender\"", ":", "Address", ".", "b58decode", "(", "b58_claimer_address", ")", ".", "to_bytes", "(", ")", ",", "\"from\"", ":", "ont_contract_address", ",", "\"to\"", ":", "Address", ".", "b58decode", "(", "b58_recv_address", ")", ".", "to_bytes", "(", ")", ",", "\"value\"", ":", "amount", "}", "invoke_code", "=", "build_native_invoke_code", "(", "ong_contract_address", ",", "b'\\x00'", ",", "\"transferFrom\"", ",", "args", ")", "payer_array", "=", "Address", ".", "b58decode", "(", "b58_payer_address", ")", ".", "to_bytes", "(", ")", "return", "Transaction", "(", "0", ",", "0xd1", ",", "int", "(", "time", "(", ")", ")", ",", "gas_price", ",", "gas_limit", ",", "payer_array", ",", "invoke_code", ",", "bytearray", "(", ")", ",", "list", "(", ")", ")" ]
This interface is used to generate a Transaction object that allow one account to withdraw an amount of ong and transfer them to receive address. :param b58_claimer_address: a base58 encode address which is used to indicate who is the claimer. :param b58_recv_address: a base58 encode address which is used to indicate who receive the claimed ong. :param amount: the amount of asset that will be claimed. :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: a Transaction object which can be used for withdraw ong.
[ "This", "interface", "is", "used", "to", "generate", "a", "Transaction", "object", "that", "allow", "one", "account", "to", "withdraw", "an", "amount", "of", "ong", "and", "transfer", "them", "to", "receive", "address", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/asset.py#L226-L257
train
This interface is used to generate a Transaction object which can be used to withdraw an amount of ong and transfer them to receive address.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJh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ssertionError,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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(243 - 195) + '\157' + chr(0b10011 + 0o40) + chr(93 - 38), 21959 - 21951), nzTpIcepk0o8(chr(48) + chr(0b111101 + 0o62) + chr(0b100011 + 0o17) + chr(291 - 243) + chr(0b110000), 63813 - 63805), nzTpIcepk0o8('\x30' + chr(928 - 817) + chr(50) + '\063' + '\x33', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b11011 + 0o30) + chr(916 - 868) + chr(0b100 + 0o55), 0b1000), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(11968 - 11857) + chr(0b11001 + 0o32) + chr(55) + chr(0b110100), 992 - 984), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x31' + chr(1651 - 1596) + chr(49), 34041 - 34033), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110011) + chr(53) + chr(0b11 + 0o60), 0b1000), nzTpIcepk0o8('\060' + chr(0b100001 + 0o116) + chr(0b110011) + chr(0b100010 + 0o23) + '\066', ord("\x08")), nzTpIcepk0o8(chr(466 - 418) + chr(2588 - 2477) + chr(0b11000 + 0o33) + chr(54) + '\x35', 9473 - 9465), nzTpIcepk0o8('\060' + '\157' + chr(509 - 459) + chr(0b100011 + 0o20), 16604 - 16596), nzTpIcepk0o8(chr(788 - 740) + '\x6f' + chr(51) + chr(55) + '\067', 25648 - 25640), nzTpIcepk0o8(chr(2237 - 2189) + '\157' + '\066' + chr(0b100111 + 0o15), 0o10), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b1101111 + 0o0) + chr(1022 - 967) + '\x36', 0b1000), nzTpIcepk0o8('\060' + chr(0b1000110 + 0o51) + chr(0b1100 + 0o46) + chr(148 - 96) + '\065', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b101001 + 0o12) + '\060' + chr(1379 - 1324), ord("\x08")), nzTpIcepk0o8(chr(2077 - 2029) + chr(0b1101111) + chr(0b101100 + 0o5) + chr(0b101101 + 0o11) + chr(0b101111 + 0o5), 4897 - 4889), nzTpIcepk0o8(chr(0b110000) + chr(1257 - 1146) + chr(0b110011) + chr(0b110011) + chr(1137 - 1087), 0o10), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b100 + 0o153) + chr(49) + chr(0b11001 + 0o27) + '\064', 0o10), nzTpIcepk0o8(chr(471 - 423) + chr(0b1101111) + '\x33' + '\066' + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1482 - 1431) + chr(0b100 + 0o54) + chr(52), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(2181 - 2131) + '\x30' + '\x34', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1010 + 0o145) + '\x32' + chr(0b110010) + '\061', 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\x33' + chr(0b100101 + 0o21) + chr(945 - 895), 0o10), nzTpIcepk0o8(chr(48) + chr(10402 - 10291) + '\063' + chr(54) + chr(257 - 206), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(51) + '\x35' + chr(0b101111 + 0o4), 8), nzTpIcepk0o8('\060' + chr(6043 - 5932) + '\061' + '\061' + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + '\x32' + chr(1200 - 1150), ord("\x08")), nzTpIcepk0o8('\x30' + chr(10880 - 10769) + chr(50) + '\063' + '\x31', ord("\x08")), nzTpIcepk0o8(chr(1691 - 1643) + chr(111) + chr(1109 - 1061), 43795 - 43787), nzTpIcepk0o8(chr(48) + chr(111) + chr(1192 - 1142) + chr(0b11110 + 0o30) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(1286 - 1238) + chr(4906 - 4795) + '\x33' + chr(1772 - 1722) + '\x33', 0o10), nzTpIcepk0o8(chr(1692 - 1644) + chr(3327 - 3216) + chr(0b110001) + chr(0b110011) + chr(820 - 770), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110010) + chr(1024 - 972) + '\067', 932 - 924), nzTpIcepk0o8(chr(0b110000) + chr(0b1011010 + 0o25) + chr(49) + chr(49) + chr(54), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\063', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(1874 - 1823) + '\060' + chr(52), 8), nzTpIcepk0o8('\x30' + '\157' + chr(0b101101 + 0o5) + chr(0b101010 + 0o7) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(4547 - 4436) + chr(55), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b10 + 0o63), 38732 - 38724), nzTpIcepk0o8(chr(242 - 194) + chr(0b1000101 + 0o52) + '\x33' + chr(51) + chr(2105 - 2056), 3758 - 3750)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b10 + 0o155) + chr(0b110101) + chr(1724 - 1676), 25771 - 25763)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'1'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(8222 - 8111) + chr(100) + chr(0b0 + 0o145))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(418 - 373) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def nWdKF5jFqoU7(hXMPsSrOQzbh, yEXp7Iboo2um, TBJsVZFaNaUJ, WwJhdr7TpaLo, WQwHjkQ5zluT, kkj6Kplau3cQ, Xu2pA_hYO4Yk) -> Qq6Yax3kS4s_: if not suIjIS24Zkqw(yEXp7Iboo2um, N9zlRy29S1SS) or not suIjIS24Zkqw(TBJsVZFaNaUJ, N9zlRy29S1SS) or (not suIjIS24Zkqw(WQwHjkQ5zluT, N9zlRy29S1SS)): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'o\xe1\xe9\xa0\x91&\x8e\x9c\x87'), chr(1636 - 1536) + '\x65' + chr(99) + '\x6f' + chr(770 - 670) + '\145')('\x75' + chr(7060 - 6944) + '\146' + chr(0b11111 + 0o16) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'k\xe8\xfe\xe1\x98\x18\x9f\x8f\xd5g\x86D[\x85\xa8\x12\xfa&\x91\xb7\xe1\xa4\xca\xd3\x8e&q\xf6d\xd3\xf3;\xc3*q\xa1\xfet%\xaaw\xef\xee\xad\x98Y\x89\x8b\xd5g\x97Q\x1e\xd6\xb3\x06\xb3*\x97\xea'), chr(0b1100100) + '\x65' + chr(0b1000011 + 0o40) + '\x6f' + chr(3394 - 3294) + chr(0b1100101))(chr(117) + chr(9998 - 9882) + chr(102) + chr(681 - 636) + chr(0b111000)))) if ftfygxgFas5X(yEXp7Iboo2um) != nzTpIcepk0o8('\x30' + chr(9500 - 9389) + '\x34' + '\062', 0b1000) or ftfygxgFas5X(TBJsVZFaNaUJ) != nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\064' + chr(0b110010), 8) or ftfygxgFas5X(WQwHjkQ5zluT) != nzTpIcepk0o8(chr(487 - 439) + chr(10378 - 10267) + chr(52) + chr(2356 - 2306), 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'o\xe1\xe9\xa0\x91&\x8e\x9c\x87'), chr(100) + chr(0b1100101) + chr(0b111000 + 0o53) + '\x6f' + '\x64' + chr(8747 - 8646))(chr(117) + '\x74' + chr(0b1000001 + 0o45) + '\x2d' + '\070'))(roI3spqORKae(ES5oEprVxulp(b'k\xe8\xfe\xe1\x90\x1c\x85\x89\x81{\xdf[X\x85\xa5\x15\xa9!\xc5\xfc\xa4\xf4\x9c\x90\x84,w\xb9a\xd2\xb7(\xc2=p\xe4\xfeoj\xacs\xe4\xbb\xa3\x99Y\xd8\xda\xd5q\x86@[\xd6\xe9'), '\x64' + chr(0b101111 + 0o66) + chr(0b1100011) + chr(111) + '\144' + chr(0b1110 + 0o127))(chr(0b1110101) + chr(0b10100 + 0o140) + '\146' + '\055' + chr(758 - 702)))) if WwJhdr7TpaLo <= nzTpIcepk0o8(chr(48) + chr(111) + chr(48), 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'p\xf4\xf3\xa4\x8e&\x8e\x9c\x87|\x8d'), chr(100) + chr(101) + '\143' + chr(10092 - 9981) + chr(414 - 314) + '\145')(chr(117) + '\164' + chr(102) + chr(67 - 22) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'k\xe8\xfe\xe1\x9d\x14\x84\x9b\x9bg\xdfGV\xca\xb2\x18\xbed\x92\xa1\xa4\xf6\x80\x96\x8a<w\xeb \xc2\xbb;\xc9nw\xac\xeci%\xa3z\xf2\xf4\xef'), chr(100) + '\x65' + '\x63' + '\157' + chr(0b1100100) + chr(0b11011 + 0o112))(chr(0b1110101) + chr(596 - 480) + chr(0b1100110) + '\x2d' + chr(0b111000)))) if Xu2pA_hYO4Yk < nzTpIcepk0o8(chr(0b101111 + 0o1) + '\x6f' + '\x30', 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'p\xf4\xf3\xa4\x8e&\x8e\x9c\x87|\x8d'), '\144' + chr(7528 - 7427) + chr(99) + '\x6f' + '\x64' + '\x65')('\x75' + '\164' + '\146' + '\x2d' + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'k\xe8\xfe\xe1\x9b\x18\x98\xce\x85a\x96W[\x85\xb4\x1c\xb51\x9c\xa0\xa4\xf3\x97\xd3\x8e9g\xf8l\x96\xbc(\x87)q\xa1\xecs`\xab?\xf4\xf3\xa0\x92Y\x91\x8b\x87|\xd1'), '\144' + chr(0b1100101) + chr(0b1100011) + '\157' + chr(4839 - 4739) + chr(101))('\165' + chr(8838 - 8722) + chr(102) + '\055' + chr(0b1010 + 0o56)))) if kkj6Kplau3cQ < nzTpIcepk0o8(chr(1813 - 1765) + chr(111) + '\060', 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'p\xf4\xf3\xa4\x8e&\x8e\x9c\x87|\x8d'), chr(100) + '\145' + chr(99) + '\x6f' + '\144' + chr(9138 - 9037))('\165' + '\x74' + chr(0b1100011 + 0o3) + chr(45) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'k\xe8\xfe\xe1\x9b\x18\x98\xce\x99z\x92]J\x85\xb4\x1c\xb51\x9c\xa0\xa4\xf3\x97\xd3\x8e9g\xf8l\x96\xbc(\x87)q\xa1\xecs`\xab?\xf4\xf3\xa0\x92Y\x91\x8b\x87|\xd1'), chr(100) + '\x65' + chr(6243 - 6144) + chr(0b1101111) + chr(0b1100100) + '\145')('\165' + '\164' + chr(10003 - 9901) + chr(45) + chr(0b111000)))) RH6PILRrcTdW = hXMPsSrOQzbh.get_asset_address(roI3spqORKae(ES5oEprVxulp(b'p\xee\xef'), chr(100) + '\x65' + '\143' + chr(0b1101111) + '\x64' + chr(0b1001101 + 0o30))('\165' + '\164' + '\x66' + '\x2d' + '\070')) VXyqZFZzVsT5 = hXMPsSrOQzbh.get_asset_address(roI3spqORKae(ES5oEprVxulp(b'p\xee\xfc'), chr(9151 - 9051) + chr(1856 - 1755) + '\x63' + '\157' + chr(6346 - 6246) + '\x65')(chr(0b1000000 + 0o65) + '\x74' + '\146' + chr(456 - 411) + chr(0b111000))) eemPYp2vtTSr = {roI3spqORKae(ES5oEprVxulp(b'l\xe5\xf5\xa5\x99\x0b'), chr(0b1100100) + '\x65' + chr(99) + chr(0b100001 + 0o116) + chr(0b1100100) + chr(101))(chr(117) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(2034 - 1978)): SrMTpcNaNYrr.b58decode(yEXp7Iboo2um).to_bytes(), roI3spqORKae(ES5oEprVxulp(b'y\xf2\xf4\xac'), chr(100) + '\145' + chr(0b1011010 + 0o11) + chr(0b10101 + 0o132) + chr(100) + '\x65')('\165' + chr(0b1001001 + 0o53) + chr(0b1100110) + '\x2d' + chr(0b110100 + 0o4)): RH6PILRrcTdW, roI3spqORKae(ES5oEprVxulp(b'k\xef'), chr(0b1010011 + 0o21) + chr(0b1100101) + chr(99) + chr(0b1100100 + 0o13) + '\144' + chr(101))(chr(0b1110101) + chr(0b100101 + 0o117) + '\146' + chr(45) + chr(2562 - 2506)): SrMTpcNaNYrr.b58decode(TBJsVZFaNaUJ).to_bytes(), roI3spqORKae(ES5oEprVxulp(b'i\xe1\xf7\xb4\x99'), chr(100) + chr(8672 - 8571) + chr(0b1100011) + '\157' + chr(100) + chr(9772 - 9671))('\165' + chr(116) + chr(0b1001 + 0o135) + chr(1820 - 1775) + chr(56)): WwJhdr7TpaLo} q6rQEi0QQtdg = lvVe_ItRqdAZ(VXyqZFZzVsT5, ES5oEprVxulp(b'\x1f'), roI3spqORKae(ES5oEprVxulp(b'k\xf2\xfa\xaf\x8f\x1f\x8e\x9c\xb3a\x90Y'), chr(100) + '\145' + chr(99) + chr(10663 - 10552) + chr(0b1100 + 0o130) + '\145')(chr(3785 - 3668) + '\x74' + '\146' + chr(45) + chr(56)), eemPYp2vtTSr) qZb61AdYCEyv = SrMTpcNaNYrr.b58decode(WQwHjkQ5zluT).to_bytes() return Qq6Yax3kS4s_(nzTpIcepk0o8('\x30' + chr(6709 - 6598) + chr(48), 8), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + chr(0b1000 + 0o52) + '\061', 1393 - 1385), nzTpIcepk0o8(oprIvDIRQyCb()), Xu2pA_hYO4Yk, kkj6Kplau3cQ, qZb61AdYCEyv, q6rQEi0QQtdg, MdkNqd1bagO6(), H4NoA26ON7iG())
ontio/ontology-python-sdk
ontology/smart_contract/native_contract/asset.py
Asset.transfer
def transfer(self, asset: str, from_acct: Account, b58_to_address: str, amount: int, payer: Account, gas_limit: int, gas_price: int): """ This interface is used to send a transfer transaction that only for ONT or ONG. :param asset: a string which is used to indicate which asset we want to transfer. :param from_acct: a Account object which indicate where the asset from. :param b58_to_address: a base58 encode address which indicate where the asset to. :param amount: the amount of asset that will be transferred. :param payer: a Account object which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: hexadecimal transaction hash value. """ tx = self.new_transfer_transaction(asset, from_acct.get_address_base58(), b58_to_address, amount, payer.get_address_base58(), gas_limit, gas_price) tx.sign_transaction(from_acct) if from_acct.get_address_base58() != payer.get_address_base58(): tx.add_sign_transaction(payer) return self.__sdk.get_network().send_raw_transaction(tx)
python
def transfer(self, asset: str, from_acct: Account, b58_to_address: str, amount: int, payer: Account, gas_limit: int, gas_price: int): """ This interface is used to send a transfer transaction that only for ONT or ONG. :param asset: a string which is used to indicate which asset we want to transfer. :param from_acct: a Account object which indicate where the asset from. :param b58_to_address: a base58 encode address which indicate where the asset to. :param amount: the amount of asset that will be transferred. :param payer: a Account object which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: hexadecimal transaction hash value. """ tx = self.new_transfer_transaction(asset, from_acct.get_address_base58(), b58_to_address, amount, payer.get_address_base58(), gas_limit, gas_price) tx.sign_transaction(from_acct) if from_acct.get_address_base58() != payer.get_address_base58(): tx.add_sign_transaction(payer) return self.__sdk.get_network().send_raw_transaction(tx)
[ "def", "transfer", "(", "self", ",", "asset", ":", "str", ",", "from_acct", ":", "Account", ",", "b58_to_address", ":", "str", ",", "amount", ":", "int", ",", "payer", ":", "Account", ",", "gas_limit", ":", "int", ",", "gas_price", ":", "int", ")", ":", "tx", "=", "self", ".", "new_transfer_transaction", "(", "asset", ",", "from_acct", ".", "get_address_base58", "(", ")", ",", "b58_to_address", ",", "amount", ",", "payer", ".", "get_address_base58", "(", ")", ",", "gas_limit", ",", "gas_price", ")", "tx", ".", "sign_transaction", "(", "from_acct", ")", "if", "from_acct", ".", "get_address_base58", "(", ")", "!=", "payer", ".", "get_address_base58", "(", ")", ":", "tx", ".", "add_sign_transaction", "(", "payer", ")", "return", "self", ".", "__sdk", ".", "get_network", "(", ")", ".", "send_raw_transaction", "(", "tx", ")" ]
This interface is used to send a transfer transaction that only for ONT or ONG. :param asset: a string which is used to indicate which asset we want to transfer. :param from_acct: a Account object which indicate where the asset from. :param b58_to_address: a base58 encode address which indicate where the asset to. :param amount: the amount of asset that will be transferred. :param payer: a Account object which indicate who will pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: hexadecimal transaction hash value.
[ "This", "interface", "is", "used", "to", "send", "a", "transfer", "transaction", "that", "only", "for", "ONT", "or", "ONG", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/asset.py#L259-L278
train
This interface is used to send a transfer transaction that only for ONT or ONG.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,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XV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1101111) + chr(862 - 811) + '\064' + chr(53), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(1094 - 1043) + chr(0b1001 + 0o52), 53323 - 53315), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\062' + chr(0b10111 + 0o34) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b10000 + 0o40) + '\x6f' + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(48) + chr(5530 - 5419) + '\x37' + chr(111 - 63), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(9049 - 8938) + chr(55) + '\061', 0o10), nzTpIcepk0o8('\x30' + chr(754 - 643) + '\066' + '\064', 0o10), nzTpIcepk0o8(chr(2278 - 2230) + '\x6f' + chr(0b100011 + 0o21) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(1984 - 1936) + chr(0b1101111) + chr(0b1101 + 0o44) + chr(0b101111 + 0o5) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x33' + chr(0b110101) + chr(0b110011), 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\x33' + chr(0b1100 + 0o46) + chr(51), 47541 - 47533), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(0b101011 + 0o104) + chr(49) + chr(0b1000 + 0o57) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(0b1100001 + 0o16) + '\063' + '\066', 40172 - 40164), nzTpIcepk0o8('\x30' + '\x6f' + chr(54) + '\061', ord("\x08")), nzTpIcepk0o8(chr(822 - 774) + chr(0b1101111) + chr(0b110001) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(111) + chr(0b101 + 0o56) + '\067' + '\063', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(49) + '\064' + chr(53), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(545 - 496) + '\060', 8), nzTpIcepk0o8(chr(0b11000 + 0o30) + '\157' + chr(54), 0o10), nzTpIcepk0o8('\x30' + chr(7944 - 7833) + '\062' + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(3841 - 3730) + '\062' + '\066' + chr(0b110001), 13606 - 13598), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110100) + chr(0b110110), 8), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b10110 + 0o33) + '\x37' + chr(54), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110010) + chr(55) + '\x33', 7003 - 6995), nzTpIcepk0o8(chr(0b110000) + '\157' + '\062' + chr(916 - 867) + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110000), 8), nzTpIcepk0o8(chr(48) + chr(0b1101111 + 0o0) + '\061' + '\x37' + '\060', 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(48) + chr(0b10100 + 0o43), 0b1000), nzTpIcepk0o8(chr(1360 - 1312) + '\x6f' + chr(2392 - 2342) + chr(0b11001 + 0o31) + '\x34', 0b1000), nzTpIcepk0o8('\060' + chr(4007 - 3896) + chr(0b11 + 0o64) + chr(0b110001), 8), nzTpIcepk0o8('\060' + chr(0b1101011 + 0o4) + chr(51) + chr(0b110100) + chr(0b10001 + 0o46), 23960 - 23952), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(49) + '\064' + chr(1167 - 1115), 17796 - 17788), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x31' + chr(1188 - 1138) + chr(198 - 149), 10632 - 10624), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b11010 + 0o33) + '\064', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(2043 - 1932) + chr(0b101000 + 0o13) + chr(50) + '\066', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b101010 + 0o10) + chr(50) + chr(1210 - 1158), 8), nzTpIcepk0o8('\x30' + '\x6f' + chr(2542 - 2491) + '\067' + chr(50), ord("\x08")), nzTpIcepk0o8(chr(2054 - 2006) + '\x6f' + '\062' + chr(2110 - 2056) + chr(319 - 266), 3059 - 3051), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b1100100 + 0o13) + '\061' + chr(0b1011 + 0o46) + '\x32', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + chr(54) + '\x35', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(2226 - 2178) + chr(5524 - 5413) + '\x35' + chr(1481 - 1433), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xcb'), '\144' + '\x65' + chr(0b1010111 + 0o14) + '\x6f' + chr(0b110001 + 0o63) + chr(0b100100 + 0o101))(chr(0b1010011 + 0o42) + '\x74' + chr(102) + chr(0b101101) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def GRDjmliFo5bk(hXMPsSrOQzbh, XwVpcyasdpoL, tz4ruHjxQKrJ, wnGtNiITIJnM, WwJhdr7TpaLo, IEsBXGuAZ6Df, kkj6Kplau3cQ, Xu2pA_hYO4Yk): L1XUDGNrDyiW = hXMPsSrOQzbh.new_transfer_transaction(XwVpcyasdpoL, tz4ruHjxQKrJ.get_address_base58(), wnGtNiITIJnM, WwJhdr7TpaLo, IEsBXGuAZ6Df.get_address_base58(), kkj6Kplau3cQ, Xu2pA_hYO4Yk) roI3spqORKae(L1XUDGNrDyiW, roI3spqORKae(ES5oEprVxulp(b'\x96\xf2\xffngMFG\x0b\x98\xb2\x1bjXg\x95'), '\144' + '\145' + chr(99) + chr(111) + chr(0b1100100) + chr(0b1100101))('\x75' + '\x74' + chr(1298 - 1196) + chr(632 - 587) + '\x38'))(tz4ruHjxQKrJ) if roI3spqORKae(tz4ruHjxQKrJ, roI3spqORKae(ES5oEprVxulp(b"\x82\xfe\xec_Y]PT\x00\x98\xa0'|P{\x9eP0"), chr(5149 - 5049) + chr(520 - 419) + chr(6149 - 6050) + chr(9237 - 9126) + '\x64' + chr(101))(chr(117) + chr(0b1110100) + chr(102) + chr(0b100000 + 0o15) + '\070'))() != roI3spqORKae(IEsBXGuAZ6Df, roI3spqORKae(ES5oEprVxulp(b"\x82\xfe\xec_Y]PT\x00\x98\xa0'|P{\x9eP0"), chr(9466 - 9366) + chr(101) + chr(8303 - 8204) + chr(0b1100000 + 0o17) + '\144' + chr(0b1100101))('\165' + chr(0b11 + 0o161) + '\146' + chr(45) + chr(0b1 + 0o67)))(): roI3spqORKae(L1XUDGNrDyiW, roI3spqORKae(ES5oEprVxulp(b'\x84\xff\xfc_KPSH:\x9f\xa1\x19pBi\x98\x11ai{'), '\144' + chr(5725 - 5624) + chr(99) + '\157' + chr(100) + '\145')('\x75' + chr(2586 - 2470) + chr(0b111001 + 0o55) + chr(1132 - 1087) + chr(0b111000)))(IEsBXGuAZ6Df) return roI3spqORKae(hXMPsSrOQzbh.__sdk.get_network(), roI3spqORKae(ES5oEprVxulp(b'\x96\xfe\xf6dgKUQ:\x9f\xa1\x19pBi\x98\x11ai{'), chr(7362 - 7262) + chr(0b11100 + 0o111) + chr(0b1100 + 0o127) + '\x6f' + '\x64' + chr(101))(chr(1215 - 1098) + '\164' + '\146' + chr(0b11110 + 0o17) + chr(0b1 + 0o67)))(L1XUDGNrDyiW)
ontio/ontology-python-sdk
ontology/smart_contract/native_contract/asset.py
Asset.withdraw_ong
def withdraw_ong(self, claimer: Account, b58_recv_address: str, amount: int, payer: Account, gas_limit: int, gas_price: int) -> str: """ This interface is used to withdraw a amount of ong and transfer them to receive address. :param claimer: the owner of ong that remained to claim. :param b58_recv_address: the address that received the ong. :param amount: the amount of ong want to claim. :param payer: an Account class that used to pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: hexadecimal transaction hash value. """ if claimer is None: raise SDKException(ErrorCode.param_err('the claimer should not be None.')) if payer is None: raise SDKException(ErrorCode.param_err('the payer should not be None.')) if amount <= 0: raise SDKException(ErrorCode.other_error('the amount should be greater than than zero.')) if gas_price < 0: raise SDKException(ErrorCode.other_error('the gas price should be equal or greater than zero.')) if gas_limit < 0: raise SDKException(ErrorCode.other_error('the gas limit should be equal or greater than zero.')) b58_claimer = claimer.get_address_base58() b58_payer = payer.get_address_base58() tx = self.new_withdraw_ong_transaction(b58_claimer, b58_recv_address, amount, b58_payer, gas_limit, gas_price) tx.sign_transaction(claimer) if claimer.get_address_base58() != payer.get_address_base58(): tx.add_sign_transaction(payer) return self.__sdk.get_network().send_raw_transaction(tx)
python
def withdraw_ong(self, claimer: Account, b58_recv_address: str, amount: int, payer: Account, gas_limit: int, gas_price: int) -> str: """ This interface is used to withdraw a amount of ong and transfer them to receive address. :param claimer: the owner of ong that remained to claim. :param b58_recv_address: the address that received the ong. :param amount: the amount of ong want to claim. :param payer: an Account class that used to pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: hexadecimal transaction hash value. """ if claimer is None: raise SDKException(ErrorCode.param_err('the claimer should not be None.')) if payer is None: raise SDKException(ErrorCode.param_err('the payer should not be None.')) if amount <= 0: raise SDKException(ErrorCode.other_error('the amount should be greater than than zero.')) if gas_price < 0: raise SDKException(ErrorCode.other_error('the gas price should be equal or greater than zero.')) if gas_limit < 0: raise SDKException(ErrorCode.other_error('the gas limit should be equal or greater than zero.')) b58_claimer = claimer.get_address_base58() b58_payer = payer.get_address_base58() tx = self.new_withdraw_ong_transaction(b58_claimer, b58_recv_address, amount, b58_payer, gas_limit, gas_price) tx.sign_transaction(claimer) if claimer.get_address_base58() != payer.get_address_base58(): tx.add_sign_transaction(payer) return self.__sdk.get_network().send_raw_transaction(tx)
[ "def", "withdraw_ong", "(", "self", ",", "claimer", ":", "Account", ",", "b58_recv_address", ":", "str", ",", "amount", ":", "int", ",", "payer", ":", "Account", ",", "gas_limit", ":", "int", ",", "gas_price", ":", "int", ")", "->", "str", ":", "if", "claimer", "is", "None", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_err", "(", "'the claimer should not be None.'", ")", ")", "if", "payer", "is", "None", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_err", "(", "'the payer should not be None.'", ")", ")", "if", "amount", "<=", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the amount should be greater than than zero.'", ")", ")", "if", "gas_price", "<", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the gas price should be equal or greater than zero.'", ")", ")", "if", "gas_limit", "<", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the gas limit should be equal or greater than zero.'", ")", ")", "b58_claimer", "=", "claimer", ".", "get_address_base58", "(", ")", "b58_payer", "=", "payer", ".", "get_address_base58", "(", ")", "tx", "=", "self", ".", "new_withdraw_ong_transaction", "(", "b58_claimer", ",", "b58_recv_address", ",", "amount", ",", "b58_payer", ",", "gas_limit", ",", "gas_price", ")", "tx", ".", "sign_transaction", "(", "claimer", ")", "if", "claimer", ".", "get_address_base58", "(", ")", "!=", "payer", ".", "get_address_base58", "(", ")", ":", "tx", ".", "add_sign_transaction", "(", "payer", ")", "return", "self", ".", "__sdk", ".", "get_network", "(", ")", ".", "send_raw_transaction", "(", "tx", ")" ]
This interface is used to withdraw a amount of ong and transfer them to receive address. :param claimer: the owner of ong that remained to claim. :param b58_recv_address: the address that received the ong. :param amount: the amount of ong want to claim. :param payer: an Account class that used to pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: hexadecimal transaction hash value.
[ "This", "interface", "is", "used", "to", "withdraw", "a", "amount", "of", "ong", "and", "transfer", "them", "to", "receive", "address", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/asset.py#L280-L309
train
This interface is used to withdraw a amount of ong and transfer them to receive address.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIu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SAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + '\157' + chr(0b101111 + 0o2) + chr(0b101 + 0o62) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1010011 + 0o34) + '\062' + '\x37' + chr(53), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(49) + chr(0b110000) + chr(297 - 247), 54260 - 54252), nzTpIcepk0o8(chr(0b10010 + 0o36) + '\157' + chr(55), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b10000 + 0o43) + chr(55) + '\x35', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\063' + chr(2529 - 2475), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\062' + '\064' + chr(2288 - 2239), 4167 - 4159), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b1101111) + chr(0b110011) + '\063' + '\061', 59600 - 59592), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + chr(53) + chr(1583 - 1532), 55883 - 55875), nzTpIcepk0o8('\060' + chr(0b1001110 + 0o41) + chr(2644 - 2589) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(0b1101111) + chr(50) + chr(0b110100) + '\061', 8), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(325 - 271) + '\066', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b10101 + 0o132) + '\x33' + '\x34' + chr(0b110 + 0o52), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1010100 + 0o33) + chr(50) + chr(0b10000 + 0o42) + '\060', 0o10), nzTpIcepk0o8(chr(48) + chr(0b0 + 0o157) + '\x32' + chr(0b110100) + chr(1735 - 1681), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(341 - 291) + chr(0b10100 + 0o36) + chr(0b10110 + 0o41), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110010) + '\x31', 0o10), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(111) + '\067' + chr(0b110000), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + chr(0b110011 + 0o1) + '\065', 0o10), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(0b100100 + 0o113) + chr(0b110010) + chr(48) + chr(0b100001 + 0o23), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x33' + '\063' + chr(0b10000 + 0o43), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1011100 + 0o23) + chr(49) + chr(0b11000 + 0o30) + '\060', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\060', 19459 - 19451), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(111) + chr(131 - 81) + '\060', ord("\x08")), nzTpIcepk0o8('\060' + chr(5942 - 5831) + '\061' + '\x33' + chr(2191 - 2136), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1464 - 1415) + '\x33' + chr(0b110100 + 0o0), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(51) + '\x37' + '\x31', ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(49) + chr(54) + chr(2242 - 2192), 0o10), nzTpIcepk0o8(chr(0b110 + 0o52) + chr(111) + chr(1577 - 1528) + chr(54) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(0b110000 + 0o0) + '\157' + '\063' + chr(0b110010) + chr(0b100011 + 0o20), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\061' + chr(52) + '\x37', 0b1000), nzTpIcepk0o8(chr(263 - 215) + '\x6f' + chr(0b111 + 0o53) + '\064' + chr(55), 0o10), nzTpIcepk0o8('\060' + chr(111) + '\x33' + chr(0b110110) + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1011011 + 0o24) + chr(50) + chr(532 - 481) + '\x32', 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(0b100101 + 0o14) + chr(0b110001) + '\063', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b100011 + 0o17) + chr(51) + '\067', 0o10), nzTpIcepk0o8(chr(48) + chr(0b10011 + 0o134) + '\063' + '\064' + chr(0b110101), 8), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(111) + chr(0b101011 + 0o7) + '\x31', 8), nzTpIcepk0o8(chr(479 - 431) + chr(0b1101111) + '\x32' + chr(0b10110 + 0o34) + chr(0b110010), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\x6f' + chr(0b110101) + chr(0b110000), 46583 - 46575)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'W'), '\144' + chr(101) + chr(0b1100011) + '\x6f' + chr(8831 - 8731) + chr(101))(chr(3037 - 2920) + chr(0b1110100) + chr(0b1101 + 0o131) + chr(0b100011 + 0o12) + chr(2088 - 2032)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def uQNfOHFz5mAP(hXMPsSrOQzbh, mckyucl3B4Xk, TBJsVZFaNaUJ, WwJhdr7TpaLo, IEsBXGuAZ6Df, kkj6Kplau3cQ, Xu2pA_hYO4Yk) -> N9zlRy29S1SS: if mckyucl3B4Xk is None: raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'\t\xdc0f\x90A\xc4\xab\x19'), chr(5607 - 5507) + '\x65' + chr(0b1100011) + chr(111) + chr(100) + '\x65')(chr(0b10001 + 0o144) + chr(0b1001100 + 0o50) + chr(102) + chr(45) + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b"\r\xd5''\x9er\xc0\xb0\x06Y\xd3V\x93\xf8\xc9\xe2}\\\xc5\xea\xb44 r:|\xb7\x1d\x1e\xb6I"), chr(100) + chr(101) + chr(99) + chr(0b1101110 + 0o1) + '\144' + chr(101))('\165' + chr(116) + '\146' + chr(45) + chr(0b111000)))) if IEsBXGuAZ6Df is None: raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'\t\xdc0f\x90A\xc4\xab\x19'), chr(0b11011 + 0o111) + chr(101) + chr(7343 - 7244) + chr(2704 - 2593) + '\x64' + '\x65')(chr(0b100111 + 0o116) + '\164' + chr(0b1100110) + chr(0b101101) + chr(2873 - 2817)))(roI3spqORKae(ES5oEprVxulp(b'\r\xd5\'\'\x8d\x7f\xd8\xbc\x19\x1c\xd2\x1e\x8f\xe5\xca\xf31V\x8a\xf0\xfb"e0\x113\x97\x17^'), chr(100) + chr(0b11010 + 0o113) + chr(799 - 700) + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(0b1110 + 0o147) + chr(0b1100100 + 0o20) + chr(0b111111 + 0o47) + '\055' + '\070'))) if WwJhdr7TpaLo <= nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b100101 + 0o13), 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'\x16\xc9*b\x8fA\xc4\xab\x19S\xd3'), chr(0b1100100) + chr(101) + chr(99) + '\x6f' + '\x64' + '\145')('\165' + chr(0b1110100) + chr(0b1100110) + chr(963 - 918) + chr(2182 - 2126)))(roI3spqORKae(ES5oEprVxulp(b"\r\xd5''\x9cs\xce\xac\x05H\x81\x05\x88\xff\xd3\xfbu\x18\x87\xe1\xfb'ru>(\x9c\x00P\xa7\x0f\xc6\x99\xba?j\xfe\x8b1\xe8\x1c\xcf-)"), '\144' + chr(101) + '\143' + '\157' + chr(0b111001 + 0o53) + chr(0b111 + 0o136))('\165' + chr(116) + chr(102) + chr(0b101101) + '\070'))) if Xu2pA_hYO4Yk < nzTpIcepk0o8(chr(48) + '\157' + chr(48), 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'\x16\xc9*b\x8fA\xc4\xab\x19S\xd3'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + chr(0b10110 + 0o131) + chr(5936 - 5836) + chr(2206 - 2105))(chr(10373 - 10256) + chr(0b10010 + 0o142) + '\x66' + '\x2d' + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'\r\xd5\'\'\x9a\x7f\xd2\xf9\x1bN\xc8\x15\x85\xb0\xd5\xff~M\x89\xe0\xfb"e0:-\x8c\x13\x1c\xf3\x08\xd5\xd7\xfd9g\xfe\x91t\xe0Y\xc9*f\x93>\xdb\xbc\x19S\x8f'), chr(0b100100 + 0o100) + chr(0b1000001 + 0o44) + chr(6085 - 5986) + '\157' + '\144' + chr(0b1100101))(chr(0b1100110 + 0o17) + chr(0b1110100) + '\146' + '\x2d' + '\070'))) if kkj6Kplau3cQ < nzTpIcepk0o8(chr(48) + chr(0b1100 + 0o143) + chr(624 - 576), 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'\x16\xc9*b\x8fA\xc4\xab\x19S\xd3'), '\144' + chr(0b1100001 + 0o4) + chr(0b1100011) + '\x6f' + chr(100) + chr(101))(chr(0b11011 + 0o132) + '\164' + '\146' + chr(0b101101) + chr(0b1110 + 0o52)))(roI3spqORKae(ES5oEprVxulp(b'\r\xd5\'\'\x9a\x7f\xd2\xf9\x07U\xcc\x1f\x94\xb0\xd5\xff~M\x89\xe0\xfb"e0:-\x8c\x13\x1c\xf3\x08\xd5\xd7\xfd9g\xfe\x91t\xe0Y\xc9*f\x93>\xdb\xbc\x19S\x8f'), chr(8832 - 8732) + '\145' + '\x63' + chr(9762 - 9651) + chr(0b1100001 + 0o3) + '\x65')(chr(117) + chr(116) + chr(9657 - 9555) + chr(0b101101) + chr(0b111000)))) H1Fmp2LBUHMz = mckyucl3B4Xk.get_address_base58() XzUDqcu9YN_m = IEsBXGuAZ6Df.get_address_base58() L1XUDGNrDyiW = hXMPsSrOQzbh.new_withdraw_ong_transaction(H1Fmp2LBUHMz, TBJsVZFaNaUJ, WwJhdr7TpaLo, XzUDqcu9YN_m, kkj6Kplau3cQ, Xu2pA_hYO4Yk) roI3spqORKae(L1XUDGNrDyiW, roI3spqORKae(ES5oEprVxulp(b'\n\xd4%i\xa2j\xd3\xb8\x05O\xc0\x15\x94\xf9\xc9\xf9'), '\x64' + chr(101) + chr(0b1100011) + chr(111) + '\144' + chr(0b111100 + 0o51))('\x75' + chr(116) + chr(102) + '\x2d' + chr(56)))(mckyucl3B4Xk) if roI3spqORKae(mckyucl3B4Xk, roI3spqORKae(ES5oEprVxulp(b'\x1e\xd86X\x9cz\xc5\xab\x0eO\xd2)\x82\xf1\xd5\xf2$\x00'), chr(0b1010111 + 0o15) + chr(0b11111 + 0o106) + chr(99) + chr(111) + chr(100) + chr(0b101101 + 0o70))('\x75' + chr(0b1110100) + chr(0b1100011 + 0o3) + '\055' + chr(1749 - 1693)))() != roI3spqORKae(IEsBXGuAZ6Df, roI3spqORKae(ES5oEprVxulp(b'\x1e\xd86X\x9cz\xc5\xab\x0eO\xd2)\x82\xf1\xd5\xf2$\x00'), chr(100) + '\x65' + chr(0b100100 + 0o77) + chr(0b1000101 + 0o52) + chr(0b1100100) + chr(0b1011001 + 0o14))('\165' + chr(116) + chr(8857 - 8755) + '\055' + chr(0b111000)))(): roI3spqORKae(L1XUDGNrDyiW, roI3spqORKae(ES5oEprVxulp(b'\x18\xd9&X\x8ew\xc6\xb74H\xd3\x17\x8e\xe3\xc7\xf4eQ\x8a\xea'), chr(0b1100100) + '\x65' + chr(8034 - 7935) + '\x6f' + chr(100) + '\145')(chr(117) + chr(0b1110100) + '\146' + chr(0b101101) + chr(56)))(IEsBXGuAZ6Df) return roI3spqORKae(hXMPsSrOQzbh.__sdk.get_network(), roI3spqORKae(ES5oEprVxulp(b'\n\xd8,c\xa2l\xc0\xae4H\xd3\x17\x8e\xe3\xc7\xf4eQ\x8a\xea'), chr(0b1100100) + chr(101) + chr(0b1001001 + 0o32) + chr(111) + '\x64' + '\145')(chr(0b1110101) + chr(116) + chr(102) + chr(0b101101) + chr(0b1011 + 0o55)))(L1XUDGNrDyiW)
ontio/ontology-python-sdk
ontology/smart_contract/native_contract/asset.py
Asset.approve
def approve(self, asset, sender: Account, b58_recv_address: str, amount: int, payer: Account, gas_limit: int, gas_price: int) -> str: """ This is an interface used to send an approve transaction which allow receiver to spend a amount of ONT or ONG asset in sender's account. :param asset: a string which is used to indicate what asset we want to approve. :param sender: an Account class that send the approve transaction. :param b58_recv_address: a base58 encode address which indicate where the approve to. :param amount: the amount of asset want to approve. :param payer: an Account class that used to pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: hexadecimal transaction hash value. """ if sender is None: raise SDKException(ErrorCode.param_err('the sender should not be None.')) if payer is None: raise SDKException(ErrorCode.param_err('the payer should not be None.')) if amount <= 0: raise SDKException(ErrorCode.other_error('the amount should be greater than than zero.')) if gas_price < 0: raise SDKException(ErrorCode.other_error('the gas price should be equal or greater than zero.')) if gas_limit < 0: raise SDKException(ErrorCode.other_error('the gas limit should be equal or greater than zero.')) b58_sender_address = sender.get_address_base58() b58_payer_address = payer.get_address_base58() tx = self.new_approve_transaction(asset, b58_sender_address, b58_recv_address, amount, b58_payer_address, gas_limit, gas_price) tx.sign_transaction(sender) if sender.get_address_base58() != payer.get_address_base58(): tx.add_sign_transaction(payer) return self.__sdk.get_network().send_raw_transaction(tx)
python
def approve(self, asset, sender: Account, b58_recv_address: str, amount: int, payer: Account, gas_limit: int, gas_price: int) -> str: """ This is an interface used to send an approve transaction which allow receiver to spend a amount of ONT or ONG asset in sender's account. :param asset: a string which is used to indicate what asset we want to approve. :param sender: an Account class that send the approve transaction. :param b58_recv_address: a base58 encode address which indicate where the approve to. :param amount: the amount of asset want to approve. :param payer: an Account class that used to pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: hexadecimal transaction hash value. """ if sender is None: raise SDKException(ErrorCode.param_err('the sender should not be None.')) if payer is None: raise SDKException(ErrorCode.param_err('the payer should not be None.')) if amount <= 0: raise SDKException(ErrorCode.other_error('the amount should be greater than than zero.')) if gas_price < 0: raise SDKException(ErrorCode.other_error('the gas price should be equal or greater than zero.')) if gas_limit < 0: raise SDKException(ErrorCode.other_error('the gas limit should be equal or greater than zero.')) b58_sender_address = sender.get_address_base58() b58_payer_address = payer.get_address_base58() tx = self.new_approve_transaction(asset, b58_sender_address, b58_recv_address, amount, b58_payer_address, gas_limit, gas_price) tx.sign_transaction(sender) if sender.get_address_base58() != payer.get_address_base58(): tx.add_sign_transaction(payer) return self.__sdk.get_network().send_raw_transaction(tx)
[ "def", "approve", "(", "self", ",", "asset", ",", "sender", ":", "Account", ",", "b58_recv_address", ":", "str", ",", "amount", ":", "int", ",", "payer", ":", "Account", ",", "gas_limit", ":", "int", ",", "gas_price", ":", "int", ")", "->", "str", ":", "if", "sender", "is", "None", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_err", "(", "'the sender should not be None.'", ")", ")", "if", "payer", "is", "None", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_err", "(", "'the payer should not be None.'", ")", ")", "if", "amount", "<=", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the amount should be greater than than zero.'", ")", ")", "if", "gas_price", "<", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the gas price should be equal or greater than zero.'", ")", ")", "if", "gas_limit", "<", "0", ":", "raise", "SDKException", "(", "ErrorCode", ".", "other_error", "(", "'the gas limit should be equal or greater than zero.'", ")", ")", "b58_sender_address", "=", "sender", ".", "get_address_base58", "(", ")", "b58_payer_address", "=", "payer", ".", "get_address_base58", "(", ")", "tx", "=", "self", ".", "new_approve_transaction", "(", "asset", ",", "b58_sender_address", ",", "b58_recv_address", ",", "amount", ",", "b58_payer_address", ",", "gas_limit", ",", "gas_price", ")", "tx", ".", "sign_transaction", "(", "sender", ")", "if", "sender", ".", "get_address_base58", "(", ")", "!=", "payer", ".", "get_address_base58", "(", ")", ":", "tx", ".", "add_sign_transaction", "(", "payer", ")", "return", "self", ".", "__sdk", ".", "get_network", "(", ")", ".", "send_raw_transaction", "(", "tx", ")" ]
This is an interface used to send an approve transaction which allow receiver to spend a amount of ONT or ONG asset in sender's account. :param asset: a string which is used to indicate what asset we want to approve. :param sender: an Account class that send the approve transaction. :param b58_recv_address: a base58 encode address which indicate where the approve to. :param amount: the amount of asset want to approve. :param payer: an Account class that used to pay for the transaction. :param gas_limit: an int value that indicate the gas limit. :param gas_price: an int value that indicate the gas price. :return: hexadecimal transaction hash value.
[ "This", "is", "an", "interface", "used", "to", "send", "an", "approve", "transaction", "which", "allow", "receiver", "to", "spend", "a", "amount", "of", "ONT", "or", "ONG", "asset", "in", "sender", "s", "account", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/asset.py#L311-L343
train
This interface is used to send an approve transaction to the receiver.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zf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Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\x6f' + '\062' + '\x31', 37276 - 37268), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + '\x33' + '\060', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(361 - 311) + '\067' + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b10111 + 0o32) + chr(234 - 185) + chr(0b100100 + 0o16), 3766 - 3758), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + chr(622 - 574) + '\x31', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(711 - 600) + chr(0b110001) + chr(179 - 131) + chr(0b110001), 0o10), nzTpIcepk0o8(chr(822 - 774) + chr(0b1011 + 0o144) + chr(0b100010 + 0o17) + chr(0b110011) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(1513 - 1465) + chr(0b1101111) + '\x33' + '\x32' + '\x32', 26401 - 26393), nzTpIcepk0o8(chr(2069 - 2021) + chr(0b1101111) + chr(50) + '\062' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(741 - 693) + chr(111) + '\x31' + '\062' + '\x31', 0b1000), nzTpIcepk0o8('\060' + chr(0b10110 + 0o131) + chr(0b110010) + '\065' + chr(0b11010 + 0o34), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\x32' + '\066' + chr(1465 - 1412), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\062' + chr(0b110000) + chr(2271 - 2222), 8), nzTpIcepk0o8(chr(48) + chr(0b101111 + 0o100) + '\x31' + '\x35' + '\x35', 0b1000), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(0b1101111) + '\x33' + chr(0b100111 + 0o13) + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(0b11 + 0o55) + '\x6f' + chr(1737 - 1687) + chr(747 - 696) + '\x37', 16434 - 16426), nzTpIcepk0o8(chr(0b110000) + chr(0b1100011 + 0o14) + chr(0b0 + 0o61) + chr(647 - 598) + '\x30', 0o10), nzTpIcepk0o8(chr(0b10101 + 0o33) + '\x6f' + chr(0b100111 + 0o20), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\066' + '\065', 0o10), nzTpIcepk0o8(chr(900 - 852) + chr(0b1101111) + chr(645 - 593) + '\x30', 34098 - 34090), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x34' + chr(52), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(605 - 554) + chr(51) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(0b1101111) + chr(0b100111 + 0o11), 41867 - 41859), nzTpIcepk0o8(chr(897 - 849) + '\x6f' + chr(0b110001) + chr(0b11100 + 0o26) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\061' + '\065' + '\062', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(2091 - 1980) + chr(0b101001 + 0o11) + chr(0b110000) + chr(0b100011 + 0o16), 8), nzTpIcepk0o8(chr(48) + chr(0b1000110 + 0o51) + chr(2320 - 2271) + '\066' + '\x33', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1000010 + 0o55) + '\061' + '\064' + chr(2079 - 2024), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1000001 + 0o56) + chr(0b110101) + chr(512 - 458), 56197 - 56189), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(2738 - 2627) + chr(0b100101 + 0o16) + chr(0b100001 + 0o26) + chr(2473 - 2420), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(54) + chr(2206 - 2157), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\063' + '\066' + chr(1324 - 1272), 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\x33' + '\x37' + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b1100 + 0o44) + '\x6f' + '\062' + chr(2925 - 2870) + chr(49), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(8357 - 8246) + chr(0b1100 + 0o46) + '\064' + '\063', 0b1000), nzTpIcepk0o8('\x30' + chr(0b111110 + 0o61) + chr(0b110 + 0o54) + chr(0b110000 + 0o7), 4604 - 4596), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b1011 + 0o46) + chr(53) + chr(1167 - 1116), 53375 - 53367), nzTpIcepk0o8(chr(356 - 308) + chr(4729 - 4618) + chr(2796 - 2742), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b110101 + 0o72) + chr(51) + chr(945 - 894) + '\x33', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(52), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(7888 - 7777) + '\065' + chr(592 - 544), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'?'), chr(0b101000 + 0o74) + chr(0b100011 + 0o102) + '\x63' + chr(10253 - 10142) + chr(9691 - 9591) + '\x65')(chr(0b1 + 0o164) + '\164' + chr(0b1111 + 0o127) + chr(0b11101 + 0o20) + '\x38') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def udAEzBUPPFs6(hXMPsSrOQzbh, XwVpcyasdpoL, CS8uC65S3o3d, TBJsVZFaNaUJ, WwJhdr7TpaLo, IEsBXGuAZ6Df, kkj6Kplau3cQ, Xu2pA_hYO4Yk) -> N9zlRy29S1SS: if CS8uC65S3o3d is None: raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'a9\xca+\xec\x1e8\xa0\xe0'), '\144' + '\145' + chr(99) + chr(4946 - 4835) + '\144' + chr(101))(chr(0b1110101) + '\164' + '\x66' + chr(45) + chr(0b101001 + 0o17)))(roI3spqORKae(ES5oEprVxulp(b"e0\xddj\xf2$3\xb6\xf7#\x8e\xc6\xe9\x02\xa2\xf3,'[OP\xfcb2J\xcf\x1c\tK\xd3"), chr(100) + '\145' + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b1011111 + 0o6))(chr(0b1110101) + '\164' + '\146' + chr(45) + chr(56)))) if IEsBXGuAZ6Df is None: raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'a9\xca+\xec\x1e8\xa0\xe0'), chr(0b111000 + 0o54) + '\145' + chr(99) + '\157' + chr(100) + '\x65')(chr(117) + chr(0b1101 + 0o147) + '\x66' + chr(869 - 824) + chr(1070 - 1014)))(roI3spqORKae(ES5oEprVxulp(b'e0\xddj\xf1 $\xb7\xe0q\xdd\xdd\xee\x18\xbb\xfbhiZT\x04\xbeew$\xee\x1d\x02\x00'), chr(100) + chr(0b1010111 + 0o16) + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(0b1100000 + 0o5))(chr(0b11110 + 0o127) + chr(0b1000111 + 0o55) + '\x66' + chr(0b11100 + 0o21) + chr(0b10000 + 0o50)))) if WwJhdr7TpaLo <= nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\060', 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'~,\xd0/\xf3\x1e8\xa0\xe0>\xdc'), chr(0b1100100) + chr(101) + '\x63' + '\157' + chr(100) + chr(101))(chr(0b111001 + 0o74) + '\164' + chr(0b1010001 + 0o25) + chr(45) + chr(1313 - 1257)))(roI3spqORKae(ES5oEprVxulp(b"e0\xddj\xe0,2\xa7\xfc%\x8e\xc6\xe9\x02\xa2\xf3,'WE\x04\xbbr2\x0b\xf5\x16\x15\x0e\x89\xd9\x95\x95\x99\xd7\x7f\nh\xfb~t*\xd7d"), chr(0b1000000 + 0o44) + chr(8992 - 8891) + chr(908 - 809) + chr(0b100100 + 0o113) + chr(0b110111 + 0o55) + chr(3886 - 3785))(chr(117) + chr(0b10000 + 0o144) + chr(0b1000011 + 0o43) + '\x2d' + '\x38'))) if Xu2pA_hYO4Yk < nzTpIcepk0o8('\060' + chr(0b1101111) + chr(48), 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'~,\xd0/\xf3\x1e8\xa0\xe0>\xdc'), chr(0b10101 + 0o117) + chr(101) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(0b100100 + 0o101))('\x75' + chr(0b1110100) + chr(102) + chr(1794 - 1749) + chr(1461 - 1405)))(roI3spqORKae(ES5oEprVxulp(b"e0\xddj\xe6 .\xf2\xe2#\xc7\xd6\xe4M\xa4\xf7'rYD\x04\xbeew\x0f\xf0\x06\x06B\xdd\xde\x86\xdb\xde\xd1r\nr\xbev1,\xd0+\xefa'\xb7\xe0>\x80"), '\144' + '\x65' + '\143' + chr(0b1101111) + '\x64' + chr(0b111 + 0o136))(chr(117) + chr(116) + chr(102) + chr(0b101101) + chr(0b11000 + 0o40)))) if kkj6Kplau3cQ < nzTpIcepk0o8(chr(1829 - 1781) + chr(0b1101111) + chr(0b110000), 8): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'~,\xd0/\xf3\x1e8\xa0\xe0>\xdc'), '\144' + chr(0b1100101) + chr(99) + chr(111) + '\x64' + chr(0b1110 + 0o127))(chr(0b1110101) + '\164' + chr(102) + '\x2d' + '\070'))(roI3spqORKae(ES5oEprVxulp(b"e0\xddj\xe6 .\xf2\xfe8\xc3\xdc\xf5M\xa4\xf7'rYD\x04\xbeew\x0f\xf0\x06\x06B\xdd\xde\x86\xdb\xde\xd1r\nr\xbev1,\xd0+\xefa'\xb7\xe0>\x80"), chr(0b1001110 + 0o26) + '\145' + chr(0b11 + 0o140) + chr(0b1101111) + chr(1884 - 1784) + chr(101))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(56)))) HGLWVisiZ95z = CS8uC65S3o3d.get_address_base58() WQwHjkQ5zluT = IEsBXGuAZ6Df.get_address_base58() L1XUDGNrDyiW = hXMPsSrOQzbh.new_approve_transaction(XwVpcyasdpoL, HGLWVisiZ95z, TBJsVZFaNaUJ, WwJhdr7TpaLo, WQwHjkQ5zluT, kkj6Kplau3cQ, Xu2pA_hYO4Yk) roI3spqORKae(L1XUDGNrDyiW, roI3spqORKae(ES5oEprVxulp(b'b1\xdf$\xde5/\xb3\xfc"\xcf\xd6\xf5\x04\xb8\xf1'), chr(0b1100100) + '\145' + '\143' + chr(0b1101111) + chr(0b1100100) + chr(101))('\x75' + chr(0b1110100) + chr(102) + '\055' + chr(56)))(CS8uC65S3o3d) if roI3spqORKae(CS8uC65S3o3d, roI3spqORKae(ES5oEprVxulp(b'v=\xcc\x15\xe0%9\xa0\xf7"\xdd\xea\xe3\x0c\xa4\xfa}?'), '\x64' + chr(9914 - 9813) + chr(0b1100011) + chr(5175 - 5064) + chr(0b0 + 0o144) + chr(0b10111 + 0o116))(chr(0b1110101) + chr(116) + chr(102) + chr(1664 - 1619) + chr(0b101010 + 0o16)))() != roI3spqORKae(IEsBXGuAZ6Df, roI3spqORKae(ES5oEprVxulp(b'v=\xcc\x15\xe0%9\xa0\xf7"\xdd\xea\xe3\x0c\xa4\xfa}?'), chr(1187 - 1087) + chr(0b1100101) + '\x63' + '\157' + chr(100) + chr(0b1010011 + 0o22))('\165' + chr(2261 - 2145) + chr(0b11101 + 0o111) + chr(0b101101) + '\x38'))(): roI3spqORKae(L1XUDGNrDyiW, roI3spqORKae(ES5oEprVxulp(b'p<\xdc\x15\xf2(:\xbc\xcd%\xdc\xd4\xef\x1e\xb6\xfc<nZN'), chr(6461 - 6361) + chr(0b1000101 + 0o40) + chr(0b11110 + 0o105) + chr(111) + '\144' + chr(101))(chr(117) + '\x74' + chr(0b1100110) + chr(0b11110 + 0o17) + '\070'))(IEsBXGuAZ6Df) return roI3spqORKae(hXMPsSrOQzbh.__sdk.get_network(), roI3spqORKae(ES5oEprVxulp(b'b=\xd6.\xde3<\xa5\xcd%\xdc\xd4\xef\x1e\xb6\xfc<nZN'), chr(1499 - 1399) + '\x65' + chr(7900 - 7801) + '\157' + chr(0b1100100) + chr(101))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(1746 - 1690)))(L1XUDGNrDyiW)
ontio/ontology-python-sdk
ontology/wallet/wallet.py
WalletData.remove_account
def remove_account(self, address: str): """ This interface is used to remove account from WalletData. :param address: a string address. """ account = self.get_account_by_b58_address(address) if account is None: raise SDKException(ErrorCode.get_account_by_address_err) self.accounts.remove(account)
python
def remove_account(self, address: str): """ This interface is used to remove account from WalletData. :param address: a string address. """ account = self.get_account_by_b58_address(address) if account is None: raise SDKException(ErrorCode.get_account_by_address_err) self.accounts.remove(account)
[ "def", "remove_account", "(", "self", ",", "address", ":", "str", ")", ":", "account", "=", "self", ".", "get_account_by_b58_address", "(", "address", ")", "if", "account", "is", "None", ":", "raise", "SDKException", "(", "ErrorCode", ".", "get_account_by_address_err", ")", "self", ".", "accounts", ".", "remove", "(", "account", ")" ]
This interface is used to remove account from WalletData. :param address: a string address.
[ "This", "interface", "is", "used", "to", "remove", "account", "from", "WalletData", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/wallet/wallet.py#L101-L110
train
This interface is used to remove account from WalletData.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gK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xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(0b1101111) + '\061' + chr(538 - 485) + chr(0b11000 + 0o30), 34842 - 34834), nzTpIcepk0o8(chr(0b110000) + chr(0b100010 + 0o115) + chr(2129 - 2079) + chr(48) + '\062', 0b1000), nzTpIcepk0o8(chr(0b1100 + 0o44) + '\x6f' + chr(0b110110) + '\x37', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x31' + chr(586 - 535) + chr(927 - 876), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(0b0 + 0o66) + chr(0b110011 + 0o0), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + chr(0b110010) + '\x36', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(383 - 332) + chr(0b11010 + 0o26) + chr(2269 - 2214), 46613 - 46605), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + chr(52) + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x32' + chr(0b11100 + 0o30) + chr(0b1001 + 0o51), 0o10), nzTpIcepk0o8(chr(1873 - 1825) + '\157' + chr(230 - 181) + chr(53) + chr(2062 - 2007), 0b1000), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(8106 - 7995) + '\x32' + chr(0b1101 + 0o43) + '\066', 6980 - 6972), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(55) + chr(0b110010), 0b1000), nzTpIcepk0o8('\x30' + chr(0b100110 + 0o111) + '\x32' + chr(0b110010) + '\x37', 0o10), nzTpIcepk0o8(chr(0b101 + 0o53) + '\157' + '\x33' + chr(0b100000 + 0o24) + chr(0b110001 + 0o3), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\x33' + chr(1187 - 1136) + '\x35', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110101 + 0o1) + '\x32', 3336 - 3328), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b100101 + 0o21) + chr(0b11100 + 0o25), 0b1000), nzTpIcepk0o8(chr(574 - 526) + '\x6f' + chr(0b100100 + 0o17) + chr(0b101010 + 0o14) + chr(55), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b100100 + 0o113) + chr(0b10000 + 0o43) + chr(0b10101 + 0o36) + chr(0b0 + 0o61), 3285 - 3277), nzTpIcepk0o8(chr(0b1001 + 0o47) + '\x6f' + chr(649 - 599) + chr(51) + '\064', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(10388 - 10277) + chr(0b110010) + chr(53) + '\x31', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1011111 + 0o20) + chr(1031 - 982) + '\x31' + chr(0b11 + 0o61), 52246 - 52238), nzTpIcepk0o8('\x30' + chr(12319 - 12208) + '\061' + chr(55) + chr(1766 - 1718), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\x33' + chr(52) + chr(0b110101), 17773 - 17765), nzTpIcepk0o8(chr(800 - 752) + chr(0b1101111) + '\063' + chr(0b100010 + 0o17) + chr(0b110011 + 0o2), 35996 - 35988), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110010) + chr(0b100001 + 0o26), 27625 - 27617), nzTpIcepk0o8(chr(218 - 170) + '\157' + chr(0b110011) + '\x33' + chr(55), 15707 - 15699), nzTpIcepk0o8(chr(0b1110 + 0o42) + '\157' + chr(1910 - 1856) + chr(0b110011), 0b1000), nzTpIcepk0o8('\060' + chr(4784 - 4673) + chr(0b110101 + 0o0) + chr(0b11011 + 0o25), 0o10), nzTpIcepk0o8('\060' + chr(0b1010 + 0o145) + '\064' + '\064', 0b1000), nzTpIcepk0o8(chr(887 - 839) + '\x6f' + chr(0b100010 + 0o21) + chr(0b110001) + chr(251 - 199), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\061' + chr(921 - 870) + chr(54), 0o10), nzTpIcepk0o8(chr(1306 - 1258) + chr(111) + chr(690 - 639) + '\066' + chr(0b101100 + 0o4), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(1277 - 1227) + '\060', 7290 - 7282), nzTpIcepk0o8('\060' + chr(111) + chr(51) + chr(49) + chr(0b1110 + 0o44), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\x33' + chr(0b110001) + chr(0b110100), 8), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(111) + chr(50) + '\x35' + chr(868 - 819), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110010) + '\x36', 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(49) + chr(49) + chr(0b110110), 0o10), nzTpIcepk0o8('\x30' + chr(9118 - 9007) + chr(0b110010) + chr(0b110111) + chr(0b1 + 0o60), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(2200 - 2152) + chr(0b1100010 + 0o15) + chr(541 - 488) + '\060', 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'F'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(0b1001000 + 0o47) + chr(0b10100 + 0o120) + '\145')(chr(117) + chr(7350 - 7234) + chr(0b1100110) + chr(1060 - 1015) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def RYCNvHBk9C6U(hXMPsSrOQzbh, en8jF5h3sD4W): a9n0DG9OW7xl = hXMPsSrOQzbh.get_account_by_b58_address(en8jF5h3sD4W) if a9n0DG9OW7xl is None: raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b"\x0f\xe7C\x04\x92\xb5\xa4\t\xd7\x01\xf2e\xf5\x9d\x82S\xd5\x93\xab\xf9\xda?'\x80\xbfe"), '\x64' + chr(0b1100101) + chr(6845 - 6746) + chr(111) + chr(4079 - 3979) + chr(0b1100101))(chr(0b1110101) + chr(0b1011 + 0o151) + '\x66' + '\055' + chr(56)))) roI3spqORKae(hXMPsSrOQzbh.accounts, roI3spqORKae(ES5oEprVxulp(b'\x18\xcf[\x0e\x9b\xb2\xf5,\xcf$\xc7\x7f'), chr(0b1100100) + chr(0b1100101) + chr(4474 - 4375) + chr(0b111100 + 0o63) + chr(0b1100100) + chr(101))(chr(0b10000 + 0o145) + '\x74' + '\146' + chr(45) + chr(0b111000 + 0o0)))(a9n0DG9OW7xl)
ontio/ontology-python-sdk
ontology/wallet/wallet.py
WalletData.set_default_account_by_index
def set_default_account_by_index(self, index: int): """ This interface is used to set default account by given index. :param index: an int value that indicate the account object in account list. """ if index >= len(self.accounts): raise SDKException(ErrorCode.param_error) for acct in self.accounts: acct.is_default = False self.accounts[index].is_default = True self.default_account_address = self.accounts[index].b58_address
python
def set_default_account_by_index(self, index: int): """ This interface is used to set default account by given index. :param index: an int value that indicate the account object in account list. """ if index >= len(self.accounts): raise SDKException(ErrorCode.param_error) for acct in self.accounts: acct.is_default = False self.accounts[index].is_default = True self.default_account_address = self.accounts[index].b58_address
[ "def", "set_default_account_by_index", "(", "self", ",", "index", ":", "int", ")", ":", "if", "index", ">=", "len", "(", "self", ".", "accounts", ")", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_error", ")", "for", "acct", "in", "self", ".", "accounts", ":", "acct", ".", "is_default", "=", "False", "self", ".", "accounts", "[", "index", "]", ".", "is_default", "=", "True", "self", ".", "default_account_address", "=", "self", ".", "accounts", "[", "index", "]", ".", "b58_address" ]
This interface is used to set default account by given index. :param index: an int value that indicate the account object in account list.
[ "This", "interface", "is", "used", "to", "set", "default", "account", "by", "given", "index", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/wallet/wallet.py#L120-L131
train
This interface is used to set default account by given index.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFAN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Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b11 + 0o154) + '\x31' + '\x37' + chr(0b110101), 0o10), nzTpIcepk0o8(chr(525 - 477) + '\157' + '\x31' + chr(0b101101 + 0o5) + chr(55), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\063' + '\x33' + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(12208 - 12097) + chr(0b110010) + chr(0b1 + 0o57) + chr(0b110101), 6005 - 5997), nzTpIcepk0o8(chr(0b110000) + chr(0b101000 + 0o107) + '\x31' + '\x32' + chr(50), 58361 - 58353), nzTpIcepk0o8(chr(1709 - 1661) + '\157' + chr(0b11110 + 0o24) + chr(2331 - 2276) + chr(0b110110), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b11101 + 0o24) + chr(53) + chr(55), 0b1000), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(111) + '\x31' + chr(0b110100) + '\x32', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1000110 + 0o51) + '\x32' + '\x36' + chr(51), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b1000 + 0o53) + chr(0b110001) + '\x36', 0b1000), nzTpIcepk0o8(chr(2064 - 2016) + chr(111) + chr(1953 - 1903) + chr(0b110101) + '\065', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\063' + chr(0b11011 + 0o25), ord("\x08")), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(3707 - 3596) + chr(2328 - 2279) + '\060' + chr(1526 - 1474), 0b1000), nzTpIcepk0o8('\060' + chr(0b101000 + 0o107) + '\062' + '\x34' + chr(0b101101 + 0o11), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b1100 + 0o46) + chr(0b100101 + 0o15) + chr(0b1001 + 0o51), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b0 + 0o61) + '\063' + chr(0b110001), 0o10), nzTpIcepk0o8(chr(0b1100 + 0o44) + '\157' + '\x32' + chr(49) + '\062', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1312 - 1259) + chr(0b10110 + 0o35), ord("\x08")), nzTpIcepk0o8(chr(575 - 527) + '\157' + chr(50) + chr(1501 - 1453) + '\062', ord("\x08")), nzTpIcepk0o8('\x30' + chr(4535 - 4424) + chr(60 - 10) + chr(1174 - 1120) + '\x30', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(340 - 289) + '\065' + chr(0b1110 + 0o42), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(357 - 306) + chr(55), 20570 - 20562), nzTpIcepk0o8('\x30' + chr(3917 - 3806) + chr(51) + '\065' + chr(2700 - 2647), 0o10), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(651 - 540) + '\061' + chr(419 - 365), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b1 + 0o60) + chr(0b110101) + '\x31', 0b1000), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(111) + '\x33' + chr(0b1 + 0o61) + chr(508 - 459), 20935 - 20927), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(2386 - 2337) + chr(53) + chr(1493 - 1443), 0b1000), nzTpIcepk0o8(chr(1006 - 958) + chr(2111 - 2000) + '\061' + '\060' + chr(0b100110 + 0o20), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b11100 + 0o123) + chr(0b110100) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b100111 + 0o14) + chr(0b110000) + chr(0b110111), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b100100 + 0o16) + chr(0b1010 + 0o50) + chr(158 - 105), 0b1000), nzTpIcepk0o8(chr(2109 - 2061) + chr(8844 - 8733) + chr(0b110010) + chr(1842 - 1790) + '\x32', 0b1000), nzTpIcepk0o8(chr(1376 - 1328) + chr(111) + '\063' + '\x37' + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(6325 - 6214) + chr(0b110011) + '\064' + '\x36', ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(49) + chr(54) + chr(813 - 758), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110 + 0o60) + '\062', 47757 - 47749), nzTpIcepk0o8('\060' + chr(0b1011100 + 0o23) + chr(0b110001) + chr(0b100 + 0o54) + '\063', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(215 - 164) + chr(0b11010 + 0o34) + chr(0b101011 + 0o12), ord("\x08")), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(111) + '\x33' + '\x35' + chr(48), 8), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + chr(53) + chr(54), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + '\157' + '\x35' + chr(1193 - 1145), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'S'), chr(0b1100100) + chr(0b1000010 + 0o43) + '\143' + chr(111) + chr(4284 - 4184) + chr(115 - 14))('\165' + chr(0b101110 + 0o106) + chr(102) + chr(45) + chr(102 - 46)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Jp3xLnFHtcIi(hXMPsSrOQzbh, ZpfN5tSLaZze): if ZpfN5tSLaZze >= ftfygxgFas5X(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x050\x84\xe4k\xc4\\2\xe9\xf6\xefS'), chr(1758 - 1658) + chr(0b111101 + 0o50) + chr(0b1001001 + 0o32) + chr(111) + chr(0b1100100) + chr(6839 - 6738))('\x75' + chr(10644 - 10528) + '\x66' + chr(0b101101) + chr(560 - 504)))): raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'\r6\xa9\xe4?\xe1\n\x10\xc1\xa1\xdf'), chr(0b1100100) + '\145' + chr(0b1100011) + '\157' + chr(0b1100100) + '\x65')('\x75' + chr(0b11001 + 0o133) + chr(0b1100110) + chr(0b101101) + chr(0b100011 + 0o25)))) for CVWQQXFFjEGO in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x050\x84\xe4k\xc4\\2\xe9\xf6\xefS'), chr(9827 - 9727) + chr(101) + chr(6358 - 6259) + '\157' + '\x64' + '\x65')(chr(0b100100 + 0o121) + '\x74' + '\146' + chr(1803 - 1758) + '\x38')): CVWQQXFFjEGO.W3F0PBwetpp1 = nzTpIcepk0o8(chr(48) + '\x6f' + chr(48), 0o10) hXMPsSrOQzbh.accounts[ZpfN5tSLaZze].W3F0PBwetpp1 = nzTpIcepk0o8(chr(0b1101 + 0o43) + '\157' + chr(49), 0o10) hXMPsSrOQzbh.szt6tE3Em_Ae = hXMPsSrOQzbh.accounts[ZpfN5tSLaZze].b58_address
ontio/ontology-python-sdk
ontology/wallet/wallet.py
WalletData.set_default_account_by_address
def set_default_account_by_address(self, b58_address: str): """ This interface is used to set default account by given base58 encode address. :param b58_address: a base58 encode address. """ flag = True index = -1 for acct in self.accounts: index += 1 if acct.b58_address == b58_address: flag = False break if flag: raise SDKException(ErrorCode.get_account_by_address_err) for i in range(len(self.accounts)): self.accounts[i].is_default = False self.accounts[index].is_default = True self.default_account_address = b58_address
python
def set_default_account_by_address(self, b58_address: str): """ This interface is used to set default account by given base58 encode address. :param b58_address: a base58 encode address. """ flag = True index = -1 for acct in self.accounts: index += 1 if acct.b58_address == b58_address: flag = False break if flag: raise SDKException(ErrorCode.get_account_by_address_err) for i in range(len(self.accounts)): self.accounts[i].is_default = False self.accounts[index].is_default = True self.default_account_address = b58_address
[ "def", "set_default_account_by_address", "(", "self", ",", "b58_address", ":", "str", ")", ":", "flag", "=", "True", "index", "=", "-", "1", "for", "acct", "in", "self", ".", "accounts", ":", "index", "+=", "1", "if", "acct", ".", "b58_address", "==", "b58_address", ":", "flag", "=", "False", "break", "if", "flag", ":", "raise", "SDKException", "(", "ErrorCode", ".", "get_account_by_address_err", ")", "for", "i", "in", "range", "(", "len", "(", "self", ".", "accounts", ")", ")", ":", "self", ".", "accounts", "[", "i", "]", ".", "is_default", "=", "False", "self", ".", "accounts", "[", "index", "]", ".", "is_default", "=", "True", "self", ".", "default_account_address", "=", "b58_address" ]
This interface is used to set default account by given base58 encode address. :param b58_address: a base58 encode address.
[ "This", "interface", "is", "used", "to", "set", "default", "account", "by", "given", "base58", "encode", "address", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/wallet/wallet.py#L133-L151
train
This interface is used to set default account by given base58 encode address.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJ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Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(550 - 502) + chr(0b11101 + 0o122) + chr(0b100000 + 0o27) + '\x37', 12403 - 12395), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(0b0 + 0o157) + '\064' + '\x31', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1010010 + 0o35) + chr(2044 - 1995) + chr(1228 - 1176) + chr(1605 - 1550), 0o10), nzTpIcepk0o8(chr(48) + chr(2688 - 2577) + chr(0b110001) + '\x30' + chr(800 - 747), 34493 - 34485), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(49) + chr(0b10000 + 0o47), 42915 - 42907), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(0b110111) + '\x33', ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(1982 - 1929) + chr(0b10111 + 0o40), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1011111 + 0o20) + chr(55) + chr(55), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(0b1010 + 0o52), 0b1000), nzTpIcepk0o8(chr(0b10010 + 0o36) + '\x6f' + chr(146 - 96) + chr(0b110000) + chr(0b10 + 0o64), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\x33' + '\062', 55505 - 55497), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + '\065', 828 - 820), nzTpIcepk0o8(chr(48) + chr(1931 - 1820) + chr(641 - 590) + chr(54) + chr(49), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + chr(49) + chr(51), 50241 - 50233), nzTpIcepk0o8(chr(0b110000) + chr(10399 - 10288) + chr(0b10110 + 0o33) + '\x31' + '\062', 0o10), nzTpIcepk0o8(chr(1133 - 1085) + chr(0b1011110 + 0o21) + chr(50) + chr(0b110100 + 0o3) + '\x31', 0o10), nzTpIcepk0o8(chr(0b100101 + 0o13) + '\157' + '\065' + chr(48), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\x32' + chr(53) + chr(0b110001), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101 + 0o142) + chr(50) + chr(0b110100) + chr(52), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b11110 + 0o23) + chr(0b1110 + 0o46) + '\x33', 38100 - 38092), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(10182 - 10071) + chr(51) + '\066' + '\x31', 8), nzTpIcepk0o8(chr(0b100110 + 0o12) + '\x6f' + chr(50) + chr(0b11 + 0o61) + '\064', 8), nzTpIcepk0o8(chr(48) + chr(111) + '\061' + '\065' + chr(54), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\x36' + '\x36', 0o10), nzTpIcepk0o8('\x30' + chr(0b111001 + 0o66) + chr(0b110011) + '\067' + chr(0b110011), 0o10), nzTpIcepk0o8('\x30' + chr(0b111111 + 0o60) + '\x33' + '\x32' + '\x36', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\061' + chr(0b110010) + '\067', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1001011 + 0o44) + chr(0b110011) + chr(2311 - 2256) + '\x30', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b110010 + 0o75) + chr(1770 - 1719) + chr(0b111 + 0o53) + chr(2113 - 2060), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\061' + chr(871 - 819) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(451 - 396), 531 - 523), nzTpIcepk0o8('\060' + chr(111) + chr(2422 - 2372) + chr(0b10010 + 0o43) + '\064', 29891 - 29883), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(0b1101111) + chr(0b110010 + 0o1) + chr(775 - 725) + '\065', 8), nzTpIcepk0o8(chr(732 - 684) + chr(6697 - 6586) + chr(49) + chr(51) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x31' + '\066' + chr(0b110000), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101110 + 0o1) + chr(51) + '\061', 0o10), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(1202 - 1148), 49187 - 49179), nzTpIcepk0o8('\060' + chr(0b1100001 + 0o16) + chr(50) + chr(1169 - 1114) + chr(0b110101), 28836 - 28828), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b1101111) + chr(50) + chr(0b1000 + 0o53) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(1077 - 1029) + '\157' + '\x33' + '\060' + '\060', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(454 - 406) + chr(4206 - 4095) + '\x35' + '\x30', 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x11'), chr(0b101100 + 0o70) + '\145' + chr(0b11101 + 0o106) + chr(0b1101001 + 0o6) + chr(100) + chr(0b100101 + 0o100))(chr(11578 - 11461) + chr(0b1110100) + '\x66' + chr(0b101101) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def v6GM4LXJJRhK(hXMPsSrOQzbh, zB3qJdM7x1vq): C4ocEXfgfR2R = nzTpIcepk0o8('\060' + chr(111) + chr(0b110001), 23582 - 23574) ZpfN5tSLaZze = -nzTpIcepk0o8('\x30' + '\157' + '\x31', 8) for CVWQQXFFjEGO in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'GF8$6\x01\x1coV\xbeXF'), chr(0b1100100) + chr(101) + '\x63' + '\x6f' + '\x64' + '\x65')(chr(0b1110101) + '\x74' + '\146' + '\055' + chr(0b100011 + 0o25))): ZpfN5tSLaZze += nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(0b101 + 0o152) + chr(49), 8) if roI3spqORKae(CVWQQXFFjEGO, roI3spqORKae(ES5oEprVxulp(b']\x14_\x1an\x1fKMi\xf5i'), chr(0b11111 + 0o105) + chr(0b1100101) + chr(8409 - 8310) + chr(0b1101111) + chr(100) + chr(0b1001110 + 0o27))(chr(0b1011001 + 0o34) + chr(0b11000 + 0o134) + chr(0b1100110) + chr(1213 - 1168) + '\x38')) == zB3qJdM7x1vq: C4ocEXfgfR2R = nzTpIcepk0o8(chr(48) + '\157' + '\060', ord("\x08")) break if C4ocEXfgfR2R: raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'XD\x13\x1an\x18LPy\xe8nR\x93\xf2\x15\xd8L\xcd\xd6\x06\x82\xd71S\x89\xa4'), '\x64' + chr(1548 - 1447) + chr(2183 - 2084) + chr(0b1101111) + chr(0b11000 + 0o114) + chr(3161 - 3060))('\x75' + chr(0b1110100) + chr(0b1000000 + 0o46) + chr(677 - 632) + '\x38'))) for ZlbFMSG8gCoF in bbT2xIe5pzk7(ftfygxgFas5X(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'GF8$6\x01\x1coV\xbeXF'), chr(0b1100100) + chr(2693 - 2592) + '\x63' + chr(0b1101111) + '\144' + '\x65')(chr(10238 - 10121) + '\x74' + '\146' + chr(0b101101) + chr(0b10 + 0o66))))): hXMPsSrOQzbh.accounts[ZlbFMSG8gCoF].W3F0PBwetpp1 = nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110000), 8) hXMPsSrOQzbh.accounts[ZpfN5tSLaZze].W3F0PBwetpp1 = nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001), 8) hXMPsSrOQzbh.szt6tE3Em_Ae = zB3qJdM7x1vq
ontio/ontology-python-sdk
ontology/wallet/wallet.py
WalletData.set_default_identity_by_index
def set_default_identity_by_index(self, index: int): """ This interface is used to set default account by given an index value. :param index: an int value that indicate the position of an account object in account list. """ identities_len = len(self.identities) if index >= identities_len: raise SDKException(ErrorCode.param_error) for i in range(identities_len): self.identities[i].is_default = False if i == index: self.identities[index].is_default = True
python
def set_default_identity_by_index(self, index: int): """ This interface is used to set default account by given an index value. :param index: an int value that indicate the position of an account object in account list. """ identities_len = len(self.identities) if index >= identities_len: raise SDKException(ErrorCode.param_error) for i in range(identities_len): self.identities[i].is_default = False if i == index: self.identities[index].is_default = True
[ "def", "set_default_identity_by_index", "(", "self", ",", "index", ":", "int", ")", ":", "identities_len", "=", "len", "(", "self", ".", "identities", ")", "if", "index", ">=", "identities_len", ":", "raise", "SDKException", "(", "ErrorCode", ".", "param_error", ")", "for", "i", "in", "range", "(", "identities_len", ")", ":", "self", ".", "identities", "[", "i", "]", ".", "is_default", "=", "False", "if", "i", "==", "index", ":", "self", ".", "identities", "[", "index", "]", ".", "is_default", "=", "True" ]
This interface is used to set default account by given an index value. :param index: an int value that indicate the position of an account object in account list.
[ "This", "interface", "is", "used", "to", "set", "default", "account", "by", "given", "an", "index", "value", "." ]
ac88bdda941896c5d2ced08422a9c5179d3f9b19
https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f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,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + '\157' + '\063' + chr(51) + '\063', 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001) + chr(0b110111) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110010) + chr(55) + chr(0b1001 + 0o54), 36933 - 36925), nzTpIcepk0o8(chr(748 - 700) + chr(111) + chr(0b110011) + chr(53) + '\061', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1000010 + 0o55) + chr(0b100 + 0o63) + chr(0b110 + 0o55), 0b1000), nzTpIcepk0o8('\060' + chr(11926 - 11815) + '\x31' + chr(2853 - 2799) + chr(0b1110 + 0o44), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(1641 - 1592) + chr(2340 - 2289) + chr(2311 - 2262), 64924 - 64916), nzTpIcepk0o8(chr(0b100101 + 0o13) + '\x6f' + '\061' + '\061' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(1083 - 1035) + '\157' + chr(836 - 786) + chr(55) + '\x37', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1011010 + 0o25) + chr(0b110 + 0o56) + chr(52), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(9467 - 9356) + chr(50) + chr(576 - 528) + chr(55), 0b1000), nzTpIcepk0o8(chr(460 - 412) + chr(111) + chr(0b110011) + chr(55) + chr(0b11001 + 0o36), 0o10), nzTpIcepk0o8(chr(464 - 416) + chr(0b1101111) + '\x32' + '\064' + chr(51), 0b1000), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b1101111) + chr(0b110010) + '\064' + chr(0b10101 + 0o36), 8), nzTpIcepk0o8('\060' + chr(0b11010 + 0o125) + '\063' + chr(0b1101 + 0o46) + chr(0b110000), 11764 - 11756), nzTpIcepk0o8(chr(1542 - 1494) + chr(111) + chr(0b110111) + chr(0b11110 + 0o26), 62976 - 62968), nzTpIcepk0o8('\060' + chr(0b100101 + 0o112) + '\x32' + chr(0b101111 + 0o1) + chr(51), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110001) + chr(0b110010) + chr(0b110111), 0b1000), nzTpIcepk0o8('\060' + chr(10018 - 9907) + '\x37' + chr(0b110001 + 0o6), 3103 - 3095), nzTpIcepk0o8(chr(1562 - 1514) + '\157' + '\x33' + '\x36' + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(0b1000100 + 0o53) + chr(0b1111 + 0o42) + chr(53) + '\063', 0o10), nzTpIcepk0o8(chr(48) + chr(11541 - 11430) + '\x34' + chr(48), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\x33' + chr(54) + '\x34', 18951 - 18943), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(111) + '\063' + chr(53) + chr(0b110101 + 0o1), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b11110 + 0o23) + chr(0b1001 + 0o56) + chr(1603 - 1553), 0b1000), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(0b100100 + 0o113) + chr(0b110011) + chr(0b110100) + chr(0b100010 + 0o21), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\061' + chr(0b110100) + chr(54), 45847 - 45839), nzTpIcepk0o8('\060' + '\x6f' + '\061' + chr(2166 - 2116) + chr(306 - 256), 0b1000), nzTpIcepk0o8(chr(2242 - 2194) + chr(0b1101111) + '\063' + '\x32' + chr(1536 - 1485), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(49) + chr(0b1101 + 0o44) + chr(55), 0o10), nzTpIcepk0o8('\060' + chr(0b1100 + 0o143) + chr(0b100001 + 0o21) + chr(2071 - 2017) + '\x32', 0b1000), nzTpIcepk0o8(chr(645 - 597) + chr(0b1101111) + chr(0b11001 + 0o36) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(11136 - 11025) + chr(49) + '\x30' + chr(0b110010), 0o10), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(11660 - 11549) + chr(51) + chr(1967 - 1915) + '\067', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(51) + chr(50) + '\061', ord("\x08")), nzTpIcepk0o8(chr(0b10 + 0o56) + '\x6f' + '\061' + chr(0b1000 + 0o52) + '\x34', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + '\062' + chr(0b10010 + 0o42) + chr(0b110011), 8), nzTpIcepk0o8('\060' + chr(111) + '\x32' + '\x37' + chr(0b110000), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(0b101 + 0o57), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\062' + chr(54) + '\x32', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\157' + '\065' + chr(0b110000), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xf5'), '\144' + chr(5885 - 5784) + chr(0b1100011) + '\x6f' + '\144' + chr(0b1100101))(chr(12287 - 12170) + '\164' + '\146' + '\055' + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def hYR0JPnEUUH9(hXMPsSrOQzbh, ZpfN5tSLaZze): WpkeyUG7ueK6 = ftfygxgFas5X(hXMPsSrOQzbh.bRbhkGRsP6gj) if ZpfN5tSLaZze >= WpkeyUG7ueK6: raise _QQM7naqUUr0(roI3spqORKae(nc65GayURxqG, roI3spqORKae(ES5oEprVxulp(b'\xab\x19\xcf\x88V-<8\xcdK\xf5'), chr(0b101101 + 0o67) + '\x65' + chr(7049 - 6950) + chr(111) + chr(0b1001001 + 0o33) + '\145')(chr(13544 - 13427) + '\164' + chr(3407 - 3305) + chr(0b101010 + 0o3) + '\x38'))) for ZlbFMSG8gCoF in bbT2xIe5pzk7(WpkeyUG7ueK6): hXMPsSrOQzbh.identities[ZlbFMSG8gCoF].W3F0PBwetpp1 = nzTpIcepk0o8(chr(48) + '\157' + '\x30', ord("\x08")) if ZlbFMSG8gCoF == ZpfN5tSLaZze: hXMPsSrOQzbh.identities[ZpfN5tSLaZze].W3F0PBwetpp1 = nzTpIcepk0o8(chr(0b11 + 0o55) + '\157' + chr(0b1001 + 0o50), 0o10)
vicenteneto/python-cartolafc
cartolafc/api.py
Api.set_credentials
def set_credentials(self, email, password): """ Realiza a autenticação no sistema do CartolaFC utilizando o email e password informados. Args: email (str): O email do usuário password (str): A senha do usuário Raises: cartolafc.CartolaFCError: Se o conjunto (email, password) não conseguiu realizar a autenticação com sucesso. """ self._email = email self._password = password response = requests.post(self._auth_url, json=dict(payload=dict(email=self._email, password=self._password, serviceId=4728))) body = response.json() if response.status_code == codes.ok: self._glb_id = body['glbId'] else: raise CartolaFCError(body['userMessage'])
python
def set_credentials(self, email, password): """ Realiza a autenticação no sistema do CartolaFC utilizando o email e password informados. Args: email (str): O email do usuário password (str): A senha do usuário Raises: cartolafc.CartolaFCError: Se o conjunto (email, password) não conseguiu realizar a autenticação com sucesso. """ self._email = email self._password = password response = requests.post(self._auth_url, json=dict(payload=dict(email=self._email, password=self._password, serviceId=4728))) body = response.json() if response.status_code == codes.ok: self._glb_id = body['glbId'] else: raise CartolaFCError(body['userMessage'])
[ "def", "set_credentials", "(", "self", ",", "email", ",", "password", ")", ":", "self", ".", "_email", "=", "email", "self", ".", "_password", "=", "password", "response", "=", "requests", ".", "post", "(", "self", ".", "_auth_url", ",", "json", "=", "dict", "(", "payload", "=", "dict", "(", "email", "=", "self", ".", "_email", ",", "password", "=", "self", ".", "_password", ",", "serviceId", "=", "4728", ")", ")", ")", "body", "=", "response", ".", "json", "(", ")", "if", "response", ".", "status_code", "==", "codes", ".", "ok", ":", "self", ".", "_glb_id", "=", "body", "[", "'glbId'", "]", "else", ":", "raise", "CartolaFCError", "(", "body", "[", "'userMessage'", "]", ")" ]
Realiza a autenticação no sistema do CartolaFC utilizando o email e password informados. Args: email (str): O email do usuário password (str): A senha do usuário Raises: cartolafc.CartolaFCError: Se o conjunto (email, password) não conseguiu realizar a autenticação com sucesso.
[ "Realiza", "a", "autenticação", "no", "sistema", "do", "CartolaFC", "utilizando", "o", "email", "e", "password", "informados", "." ]
15b2a192d7745f454d69a55ac9b7ef7c7abb53b9
https://github.com/vicenteneto/python-cartolafc/blob/15b2a192d7745f454d69a55ac9b7ef7c7abb53b9/cartolafc/api.py#L91-L110
train
Set the credentials for a user in the cartolafc.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,Y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z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + chr(1138 - 1087) + chr(48), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\x32', 15000 - 14992), nzTpIcepk0o8('\060' + chr(0b111100 + 0o63) + '\063' + chr(0b110111) + '\060', 0o10), nzTpIcepk0o8(chr(0b1100 + 0o44) + '\x6f' + '\x33' + chr(0b1100 + 0o44) + chr(0b110010), 13591 - 13583), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(6691 - 6580) + '\064' + '\x35', 52014 - 52006), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(11039 - 10928) + chr(0b110110) + chr(2462 - 2410), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(2500 - 2450) + chr(0b110001) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b10010 + 0o36) + '\157' + chr(2062 - 2012) + '\063' + chr(204 - 149), 22444 - 22436), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(111) + chr(0b110001) + '\062' + chr(0b110001), 11173 - 11165), nzTpIcepk0o8(chr(0b111 + 0o51) + '\x6f' + chr(0b11100 + 0o25) + '\x37' + chr(648 - 593), 0o10), nzTpIcepk0o8('\060' + chr(10908 - 10797) + chr(0b0 + 0o61) + chr(1600 - 1547) + chr(0b100011 + 0o17), 0b1000), nzTpIcepk0o8(chr(1030 - 982) + chr(111) + chr(1540 - 1490) + '\x36' + '\x31', 0b1000), nzTpIcepk0o8('\060' + chr(7948 - 7837) + '\x33' + '\x37' + '\062', ord("\x08")), nzTpIcepk0o8(chr(375 - 327) + '\157' + chr(51) + chr(0b110 + 0o54) + chr(54), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(2425 - 2375) + chr(0b11111 + 0o22) + chr(135 - 81), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(49) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(214 - 166) + chr(0b1101111) + chr(55), 0o10), nzTpIcepk0o8('\060' + chr(8861 - 8750) + chr(0b1101 + 0o45) + '\x30' + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(111) + '\062' + chr(0b100100 + 0o20) + '\x35', ord("\x08")), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(0b1010011 + 0o34) + chr(1406 - 1357) + '\x31' + chr(52), 0b1000), nzTpIcepk0o8(chr(1685 - 1637) + chr(0b1101111) + chr(0b110011) + chr(277 - 227) + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b10110 + 0o35) + '\x36' + '\062', 0o10), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b101101 + 0o102) + '\x32' + chr(1393 - 1343) + chr(0b100010 + 0o23), ord("\x08")), nzTpIcepk0o8(chr(2254 - 2206) + chr(111) + '\x32' + chr(0b1101 + 0o50) + '\x32', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\061' + '\067' + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b101 + 0o53) + '\x6f' + chr(0b110110), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + '\x35' + chr(55), 0b1000), nzTpIcepk0o8('\060' + chr(3616 - 3505) + chr(0b110010) + '\x33', 0o10), nzTpIcepk0o8(chr(1313 - 1265) + chr(10259 - 10148) + chr(1687 - 1636) + chr(0b101000 + 0o16) + chr(1165 - 1110), ord("\x08")), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(0b1101 + 0o142) + '\062' + chr(0b101000 + 0o12) + chr(0b110111), 45418 - 45410), nzTpIcepk0o8(chr(148 - 100) + chr(111) + chr(0b110011) + '\066' + chr(0b110010), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(50) + chr(53) + chr(50), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b10011 + 0o134) + chr(51) + '\x35' + '\065', 0b1000), nzTpIcepk0o8(chr(1882 - 1834) + chr(0b1101111) + chr(1048 - 999) + '\x32' + chr(51), 22395 - 22387), nzTpIcepk0o8(chr(0b110000) + chr(0b1001 + 0o146) + chr(0b101010 + 0o10) + '\062' + chr(52), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x33' + chr(0b110000) + '\066', 56166 - 56158), nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(0b101111 + 0o100) + chr(53) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1100000 + 0o17) + '\061' + chr(540 - 490) + chr(54), 52430 - 52422), nzTpIcepk0o8('\060' + chr(111) + chr(1556 - 1506) + '\x35' + chr(0b110100), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(2176 - 2126) + chr(1233 - 1185) + chr(446 - 393), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + '\157' + chr(97 - 44) + chr(48), 49360 - 49352)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xb6'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(100) + '\x65')(chr(2106 - 1989) + chr(116) + chr(4898 - 4796) + '\055' + chr(0b110001 + 0o7)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def EC1qdF7f9_7D(hXMPsSrOQzbh, BhwKvDaXtiJh, CgN2oEkfPaa_): hXMPsSrOQzbh.OwBtwZedCBOD = BhwKvDaXtiJh hXMPsSrOQzbh.wdTMIKsNY1gN = CgN2oEkfPaa_ k2zzaFDtbuhL = dDl_g5qi6_rH.BDtAhDSNJsjg(hXMPsSrOQzbh._auth_url, json=znjnJWK64FDT(payload=znjnJWK64FDT(email=hXMPsSrOQzbh.OwBtwZedCBOD, password=hXMPsSrOQzbh.wdTMIKsNY1gN, serviceId=nzTpIcepk0o8(chr(0b11110 + 0o22) + '\x6f' + '\x31' + '\x31' + '\x31' + '\x37' + chr(1507 - 1459), 0o10)))) ryRPGaxqs24n = k2zzaFDtbuhL.LNUKEwZDIbyb() if roI3spqORKae(k2zzaFDtbuhL, roI3spqORKae(ES5oEprVxulp(b'\xcfv\x8a\x87\x1c^\xf5\xf65\x1d\x12\xe0'), chr(0b1100100) + '\x65' + '\143' + chr(0b1010001 + 0o36) + '\144' + '\145')('\x75' + chr(0b1110100) + chr(0b10111 + 0o117) + chr(45) + '\070')) == roI3spqORKae(wXNZi6rDt0jg, roI3spqORKae(ES5oEprVxulp(b'\xf9p\x9b\xbb_\x0c\xf4\xa62\x14\x1f\xe5'), '\144' + chr(0b10101 + 0o120) + chr(0b1000011 + 0o40) + chr(0b100 + 0o153) + '\x64' + chr(0b1010100 + 0o21))(chr(0b11100 + 0o131) + '\x74' + chr(0b1100110) + chr(0b11000 + 0o25) + chr(1826 - 1770))): hXMPsSrOQzbh.FdSwOLBKuoxS = ryRPGaxqs24n[roI3spqORKae(ES5oEprVxulp(b'\xffn\x9a\x8bA'), chr(0b1100100) + '\x65' + '\143' + '\157' + chr(0b1000001 + 0o43) + chr(0b1100101))(chr(0b1101010 + 0o13) + chr(7932 - 7816) + chr(102) + chr(0b101101) + '\070')] else: raise PcIxAs2GVS6s(ryRPGaxqs24n[roI3spqORKae(ES5oEprVxulp(b'\xedq\x9d\xb0hQ\xfe\xec0\x18\x0f'), chr(7990 - 7890) + chr(0b11000 + 0o115) + chr(0b1110 + 0o125) + chr(111) + chr(4124 - 4024) + chr(0b1100100 + 0o1))(chr(6070 - 5953) + chr(736 - 620) + chr(102) + chr(0b11 + 0o52) + chr(0b110100 + 0o4))])
vicenteneto/python-cartolafc
cartolafc/api.py
Api.set_redis
def set_redis(self, redis_url, redis_timeout=10): """ Realiza a autenticação no servidor Redis utilizando a URL informada. Args: redis_url (str): URL para conectar ao servidor Redis, exemplo: redis://user:password@localhost:6379/2. redis_timeout (int): O timeout padrão (em segundos). kwargs (dict): Raises: cartolafc.CartolaFCError: Se não for possível se conectar ao servidor Redis """ self._redis_url = redis_url self._redis_timeout = redis_timeout if isinstance(redis_timeout, int) and redis_timeout > 0 else 10 try: self._redis = redis.StrictRedis.from_url(url=redis_url) self._redis.ping() except (ConnectionError, TimeoutError): raise CartolaFCError('Erro conectando ao servidor Redis.')
python
def set_redis(self, redis_url, redis_timeout=10): """ Realiza a autenticação no servidor Redis utilizando a URL informada. Args: redis_url (str): URL para conectar ao servidor Redis, exemplo: redis://user:password@localhost:6379/2. redis_timeout (int): O timeout padrão (em segundos). kwargs (dict): Raises: cartolafc.CartolaFCError: Se não for possível se conectar ao servidor Redis """ self._redis_url = redis_url self._redis_timeout = redis_timeout if isinstance(redis_timeout, int) and redis_timeout > 0 else 10 try: self._redis = redis.StrictRedis.from_url(url=redis_url) self._redis.ping() except (ConnectionError, TimeoutError): raise CartolaFCError('Erro conectando ao servidor Redis.')
[ "def", "set_redis", "(", "self", ",", "redis_url", ",", "redis_timeout", "=", "10", ")", ":", "self", ".", "_redis_url", "=", "redis_url", "self", ".", "_redis_timeout", "=", "redis_timeout", "if", "isinstance", "(", "redis_timeout", ",", "int", ")", "and", "redis_timeout", ">", "0", "else", "10", "try", ":", "self", ".", "_redis", "=", "redis", ".", "StrictRedis", ".", "from_url", "(", "url", "=", "redis_url", ")", "self", ".", "_redis", ".", "ping", "(", ")", "except", "(", "ConnectionError", ",", "TimeoutError", ")", ":", "raise", "CartolaFCError", "(", "'Erro conectando ao servidor Redis.'", ")" ]
Realiza a autenticação no servidor Redis utilizando a URL informada. Args: redis_url (str): URL para conectar ao servidor Redis, exemplo: redis://user:password@localhost:6379/2. redis_timeout (int): O timeout padrão (em segundos). kwargs (dict): Raises: cartolafc.CartolaFCError: Se não for possível se conectar ao servidor Redis
[ "Realiza", "a", "autenticação", "no", "servidor", "Redis", "utilizando", "a", "URL", "informada", "." ]
15b2a192d7745f454d69a55ac9b7ef7c7abb53b9
https://github.com/vicenteneto/python-cartolafc/blob/15b2a192d7745f454d69a55ac9b7ef7c7abb53b9/cartolafc/api.py#L112-L130
train
Realiza a autenticação no servidor Redis utilizando a URL informada.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTj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,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1907 - 1859) + '\157' + chr(49) + '\067', 0b1000), nzTpIcepk0o8(chr(48) + chr(4195 - 4084) + '\061' + '\x36' + chr(51), 46193 - 46185), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(54) + '\x30', 0o10), nzTpIcepk0o8(chr(1716 - 1668) + chr(0b1101111) + '\x33' + chr(1691 - 1638) + '\065', ord("\x08")), nzTpIcepk0o8(chr(1882 - 1834) + chr(0b1101111) + chr(0b11011 + 0o26) + '\x37' + '\065', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(49) + chr(0b1111 + 0o41) + chr(316 - 268), 47373 - 47365), nzTpIcepk0o8('\x30' + chr(5209 - 5098) + chr(0b1010 + 0o47) + '\x34' + '\x35', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\061' + '\x33' + chr(0b10000 + 0o46), 15103 - 15095), nzTpIcepk0o8('\x30' + chr(111) + chr(0b1000 + 0o52) + chr(1856 - 1808), 34279 - 34271), nzTpIcepk0o8(chr(1971 - 1923) + chr(111) + chr(0b110001) + chr(0b110100) + '\x35', 8), nzTpIcepk0o8('\060' + chr(111) + chr(53) + chr(1994 - 1943), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b111 + 0o54), ord("\x08")), nzTpIcepk0o8('\060' + chr(3680 - 3569) + '\x35' + chr(0b110001), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(51) + '\066' + chr(0b110100), 9668 - 9660), nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(8807 - 8696) + '\x31' + chr(53) + chr(1203 - 1149), 0b1000), nzTpIcepk0o8(chr(1951 - 1903) + chr(111) + chr(0b101011 + 0o6) + '\x33' + chr(121 - 72), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b101000 + 0o13) + chr(55) + chr(0b110111), 31050 - 31042), nzTpIcepk0o8('\060' + '\x6f' + '\063' + chr(54) + chr(0b100110 + 0o16), 8), nzTpIcepk0o8(chr(48) + chr(9863 - 9752) + chr(0b110010) + chr(0b100101 + 0o14) + '\x31', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110011) + chr(225 - 175) + chr(0b101111 + 0o1), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + chr(85 - 35) + chr(965 - 912), 45647 - 45639), nzTpIcepk0o8('\060' + chr(0b1101111 + 0o0) + chr(0b101011 + 0o7) + '\x34' + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(1715 - 1667) + '\x6f' + chr(712 - 663) + chr(0b10110 + 0o33), 0b1000), nzTpIcepk0o8('\x30' + chr(12055 - 11944) + chr(0b11001 + 0o31) + chr(351 - 302) + chr(0b110000), 373 - 365), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(111) + chr(1575 - 1524) + chr(562 - 514) + chr(51), 0o10), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1101111) + '\063' + chr(0b1100 + 0o53) + '\x35', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110011) + '\065' + chr(619 - 570), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b10100 + 0o35) + chr(49), 8), nzTpIcepk0o8(chr(0b10100 + 0o34) + '\x6f' + chr(1040 - 989) + chr(1792 - 1741) + '\061', 0b1000), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b1101111) + '\x32' + chr(0b10 + 0o60), ord("\x08")), nzTpIcepk0o8(chr(2092 - 2044) + chr(11582 - 11471) + chr(0b110010) + '\x31' + chr(0b110110), 2008 - 2000), nzTpIcepk0o8(chr(2270 - 2222) + '\157' + chr(0b110001) + chr(0b1101 + 0o46) + '\061', 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x32' + chr(0b110110) + chr(53), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(461 - 412) + chr(51) + chr(55), 35350 - 35342), nzTpIcepk0o8(chr(0b110000) + chr(0b100101 + 0o112) + chr(0b110011) + chr(466 - 415) + chr(0b110001), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110101) + '\066', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(49) + chr(0b111 + 0o53) + '\x30', 5538 - 5530), nzTpIcepk0o8(chr(1552 - 1504) + chr(111) + '\x33' + '\065' + chr(0b110010), 0o10), nzTpIcepk0o8(chr(1825 - 1777) + chr(0b1101111) + chr(50) + chr(1488 - 1439) + chr(53), 0b1000), nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(0b1101111) + chr(49) + '\x37' + chr(55), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b10000 + 0o40) + '\x6f' + chr(87 - 34) + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'!'), chr(0b1011000 + 0o14) + chr(0b1100101) + chr(1335 - 1236) + chr(111) + '\144' + chr(0b110100 + 0o61))(chr(12582 - 12465) + '\x74' + chr(9729 - 9627) + '\055' + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def HDML5tx64Ghc(hXMPsSrOQzbh, Y2hBh8_5GVt3, vdUFT7Mvk9gO=nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(847 - 797), 14678 - 14670)): hXMPsSrOQzbh.DM0Bh9LJ458q = Y2hBh8_5GVt3 hXMPsSrOQzbh.JTyoVRF93_hA = vdUFT7Mvk9gO if suIjIS24Zkqw(vdUFT7Mvk9gO, nzTpIcepk0o8) and vdUFT7Mvk9gO > nzTpIcepk0o8('\060' + chr(111) + chr(48), 0o10) else nzTpIcepk0o8(chr(1362 - 1314) + '\157' + '\x31' + '\x32', 8) try: hXMPsSrOQzbh.m3476jDiACQX = kaeTVEwzDLmD.StrictRedis.from_url(url=Y2hBh8_5GVt3) roI3spqORKae(hXMPsSrOQzbh._redis, roI3spqORKae(ES5oEprVxulp(b'h\to\xab\t\x06\x1cjb\x1d\x1c4'), '\x64' + '\x65' + '\x63' + chr(0b1101111) + chr(100) + chr(10093 - 9992))(chr(117) + chr(116) + chr(0b1010011 + 0o23) + chr(0b101101) + '\x38'))() except (Y8CO_HpFZe1H, FB4_7GjVy3pW): raise PcIxAs2GVS6s(roI3spqORKae(ES5oEprVxulp(b'J\x01B\x82]#\n0u\x06_bG\x90\x01y\x9e\x9b\xa9\xa30\xd4\x7f\xe1\xa7\x92\x9b)\x8bw\xea0\xc6q'), chr(5049 - 4949) + chr(1569 - 1468) + chr(99) + '\x6f' + '\x64' + '\145')(chr(0b11010 + 0o133) + chr(4692 - 4576) + '\x66' + chr(45) + '\x38'))
vicenteneto/python-cartolafc
cartolafc/api.py
Api.liga
def liga(self, nome=None, slug=None, page=1, order_by=CAMPEONATO): """ Este serviço requer que a API esteja autenticada, e realiza uma busca pelo nome ou slug informados. Este serviço obtém apenas 20 times por página, portanto, caso sua liga possua mais que 20 membros, deve-se utilizar o argumento "page" para obter mais times. Args: nome (str): Nome da liga que se deseja obter. Requerido se o slug não for informado. slug (str): Slug do time que se deseja obter. *Este argumento tem prioridade sobre o nome* page (int): Página dos times que se deseja obter. order_by (str): É possível obter os times ordenados por "campeonato", "turno", "mes", "rodada" e "patrimonio". As constantes estão disponíveis em "cartolafc.CAMPEONATO", "cartolafc.TURNO" e assim sucessivamente. Returns: Um objeto representando a liga encontrada. Raises: CartolaFCError: Se a API não está autenticada ou se nenhuma liga foi encontrada com os dados recebidos. """ if not any((nome, slug)): raise CartolaFCError('Você precisa informar o nome ou o slug da liga que deseja obter') slug = slug if slug else convert_team_name_to_slug(nome) url = '{api_url}/auth/liga/{slug}'.format(api_url=self._api_url, slug=slug) data = self._request(url, params=dict(page=page, orderBy=order_by)) return Liga.from_dict(data, order_by)
python
def liga(self, nome=None, slug=None, page=1, order_by=CAMPEONATO): """ Este serviço requer que a API esteja autenticada, e realiza uma busca pelo nome ou slug informados. Este serviço obtém apenas 20 times por página, portanto, caso sua liga possua mais que 20 membros, deve-se utilizar o argumento "page" para obter mais times. Args: nome (str): Nome da liga que se deseja obter. Requerido se o slug não for informado. slug (str): Slug do time que se deseja obter. *Este argumento tem prioridade sobre o nome* page (int): Página dos times que se deseja obter. order_by (str): É possível obter os times ordenados por "campeonato", "turno", "mes", "rodada" e "patrimonio". As constantes estão disponíveis em "cartolafc.CAMPEONATO", "cartolafc.TURNO" e assim sucessivamente. Returns: Um objeto representando a liga encontrada. Raises: CartolaFCError: Se a API não está autenticada ou se nenhuma liga foi encontrada com os dados recebidos. """ if not any((nome, slug)): raise CartolaFCError('Você precisa informar o nome ou o slug da liga que deseja obter') slug = slug if slug else convert_team_name_to_slug(nome) url = '{api_url}/auth/liga/{slug}'.format(api_url=self._api_url, slug=slug) data = self._request(url, params=dict(page=page, orderBy=order_by)) return Liga.from_dict(data, order_by)
[ "def", "liga", "(", "self", ",", "nome", "=", "None", ",", "slug", "=", "None", ",", "page", "=", "1", ",", "order_by", "=", "CAMPEONATO", ")", ":", "if", "not", "any", "(", "(", "nome", ",", "slug", ")", ")", ":", "raise", "CartolaFCError", "(", "'Você precisa informar o nome ou o slug da liga que deseja obter')", "", "slug", "=", "slug", "if", "slug", "else", "convert_team_name_to_slug", "(", "nome", ")", "url", "=", "'{api_url}/auth/liga/{slug}'", ".", "format", "(", "api_url", "=", "self", ".", "_api_url", ",", "slug", "=", "slug", ")", "data", "=", "self", ".", "_request", "(", "url", ",", "params", "=", "dict", "(", "page", "=", "page", ",", "orderBy", "=", "order_by", ")", ")", "return", "Liga", ".", "from_dict", "(", "data", ",", "order_by", ")" ]
Este serviço requer que a API esteja autenticada, e realiza uma busca pelo nome ou slug informados. Este serviço obtém apenas 20 times por página, portanto, caso sua liga possua mais que 20 membros, deve-se utilizar o argumento "page" para obter mais times. Args: nome (str): Nome da liga que se deseja obter. Requerido se o slug não for informado. slug (str): Slug do time que se deseja obter. *Este argumento tem prioridade sobre o nome* page (int): Página dos times que se deseja obter. order_by (str): É possível obter os times ordenados por "campeonato", "turno", "mes", "rodada" e "patrimonio". As constantes estão disponíveis em "cartolafc.CAMPEONATO", "cartolafc.TURNO" e assim sucessivamente. Returns: Um objeto representando a liga encontrada. Raises: CartolaFCError: Se a API não está autenticada ou se nenhuma liga foi encontrada com os dados recebidos.
[ "Este", "serviço", "requer", "que", "a", "API", "esteja", "autenticada", "e", "realiza", "uma", "busca", "pelo", "nome", "ou", "slug", "informados", ".", "Este", "serviço", "obtém", "apenas", "20", "times", "por", "página", "portanto", "caso", "sua", "liga", "possua", "mais", "que", "20", "membros", "deve", "-", "se", "utilizar", "o", "argumento", "page", "para", "obter", "mais", "times", "." ]
15b2a192d7745f454d69a55ac9b7ef7c7abb53b9
https://github.com/vicenteneto/python-cartolafc/blob/15b2a192d7745f454d69a55ac9b7ef7c7abb53b9/cartolafc/api.py#L139-L165
train
Return a um objeto representando a liga.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F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tLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\x6f' + chr(51) + chr(0b110010) + '\x37', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(51) + chr(0b101010 + 0o12) + '\x34', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1110 + 0o141) + chr(1506 - 1455) + chr(0b101000 + 0o11) + chr(49), 0b1000), nzTpIcepk0o8('\060' + chr(0b1010 + 0o145) + chr(2041 - 1989) + chr(0b110000), 11613 - 11605), nzTpIcepk0o8(chr(48) + '\157' + '\063' + chr(413 - 360) + '\066', 64308 - 64300), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b101111 + 0o3) + chr(0b1110 + 0o47) + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x31' + chr(52) + chr(54), 0b1000), nzTpIcepk0o8('\x30' + chr(9110 - 8999) + chr(0b110010) + chr(0b110100) + chr(0b100 + 0o62), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b1100 + 0o51) + chr(0b101100 + 0o6), ord("\x08")), nzTpIcepk0o8(chr(840 - 792) + chr(0b1101111) + '\062' + chr(0b11010 + 0o34) + chr(55), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(51) + '\x35' + '\063', ord("\x08")), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(0b1101111) + chr(2113 - 2062) + '\x36' + chr(0b110101), 49286 - 49278), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b11101 + 0o31) + '\x36', 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\063' + chr(0b100000 + 0o21) + '\066', 0o10), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(0b1101111) + chr(0b101010 + 0o7) + chr(267 - 215) + '\060', 0o10), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(0b100000 + 0o117) + '\x33' + chr(372 - 321) + chr(0b110011), 60655 - 60647), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b1010111 + 0o30) + chr(0b110010) + chr(49) + chr(53), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\061' + chr(0b10011 + 0o42) + chr(837 - 786), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1010110 + 0o31) + chr(0b110100) + chr(55), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1010000 + 0o37) + '\x33' + chr(2283 - 2231) + '\062', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(53) + '\065', 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b101001 + 0o11) + chr(0b110101) + chr(2827 - 2773), 8), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110 + 0o54) + '\063' + '\067', 50767 - 50759), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110011) + chr(1541 - 1487) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b1001 + 0o51) + chr(0b110001 + 0o0) + chr(50), 51185 - 51177), nzTpIcepk0o8(chr(904 - 856) + chr(0b1101111) + '\x31' + '\x32' + chr(2001 - 1949), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(618 - 568) + '\x37' + '\064', 53848 - 53840), nzTpIcepk0o8(chr(191 - 143) + '\x6f' + chr(1053 - 999), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(49) + chr(0b11 + 0o64) + '\066', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011) + chr(0b110101) + '\x30', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b110001) + '\067', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101100 + 0o3) + chr(414 - 364) + chr(0b110111) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(11482 - 11371) + '\067', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(0b1011 + 0o52) + chr(52), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1532 - 1482) + chr(0b101111 + 0o5) + chr(2237 - 2186), 32351 - 32343), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + chr(0b110010) + chr(0b110001), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\066' + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(6750 - 6639) + chr(0b1101 + 0o46) + chr(0b11001 + 0o32) + chr(0b11101 + 0o27), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b101011 + 0o104) + chr(1447 - 1397) + chr(0b110110) + '\x36', 45541 - 45533), nzTpIcepk0o8('\060' + '\157' + chr(50) + chr(1155 - 1101) + '\x32', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(0b1101111) + '\065' + chr(1116 - 1068), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xf9'), chr(8819 - 8719) + chr(0b100000 + 0o105) + '\143' + chr(111) + chr(0b10 + 0o142) + chr(0b1100101))(chr(0b100010 + 0o123) + chr(1237 - 1121) + chr(0b1100110) + chr(0b101101) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def BNwNw8L4HDJD(hXMPsSrOQzbh, cAZVNgVckYjK=None, kMwZMMRH4hj5=None, saC2QU0nRquP=nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(111) + chr(685 - 636), 0o10), w8k5rNhphfqm=u8nys52QTJrg): if not VF4pKOObtlPc((cAZVNgVckYjK, kMwZMMRH4hj5)): raise PcIxAs2GVS6s(roI3spqORKae(ES5oEprVxulp(b"\x81\x8b\xaa\xe3D\x8e\x16\xd4O\xd4\x82\x86W\xee\t\xb5\xeb\x04U\x8f\xcc\xdc\xbf\x98\xaa:\xd3k\x1b\xc8 \xcd'\xc3\x83\xe2_\xa9\xd1\x92\xb3\x85\xe9L\x87\xc9\x07\x86[\xc2\x8e\xd5R\xab\x13\xbe\xe7\n\x07\x8d\xcf\xda\xfa\x85"), '\144' + chr(0b110 + 0o137) + '\x63' + '\157' + chr(0b1100100) + '\x65')('\x75' + chr(13028 - 12912) + chr(0b1100110) + '\x2d' + chr(0b111000))) kMwZMMRH4hj5 = kMwZMMRH4hj5 if kMwZMMRH4hj5 else DjwFmrhXjY_3(cAZVNgVckYjK) XuBkOpBKZJ5Z = roI3spqORKae(ES5oEprVxulp(b'\xac\x85\xb9I\xb1\xdb\x14\xcaW\x98\x8a\x80B\xa6O\xb7\xe4\x0cF\xcd\xd6\xdd\xf3\x82\xed)'), chr(100) + '\145' + '\x63' + chr(111) + '\144' + chr(0b101000 + 0o75))(chr(117) + '\164' + chr(1869 - 1767) + '\x2d' + chr(0b11110 + 0o32)).q33KG3foQ_CJ(api_url=hXMPsSrOQzbh.gpkgq1UwJyF9, slug=kMwZMMRH4hj5) FfKOThdpoDTb = hXMPsSrOQzbh.G0tfiEoJ08DV(XuBkOpBKZJ5Z, params=znjnJWK64FDT(page=saC2QU0nRquP, orderBy=w8k5rNhphfqm)) return roI3spqORKae(CJ15t7KkfVgS, roI3spqORKae(ES5oEprVxulp(b'\xb5\x86\xabj\xdd\xe0\x08\xcap\xcf\xda\xaf'), '\144' + chr(2699 - 2598) + chr(0b1100011) + chr(111) + '\144' + chr(101))('\x75' + chr(0b100011 + 0o121) + '\146' + chr(0b101101) + '\x38'))(FfKOThdpoDTb, w8k5rNhphfqm)
vicenteneto/python-cartolafc
cartolafc/api.py
Api.ligas
def ligas(self, query): """ Retorna o resultado da busca ao Cartola por um determinado termo de pesquisa. Args: query (str): Termo para utilizar na busca. Returns: Uma lista de instâncias de cartolafc.Liga, uma para cada liga contento o termo utilizado na busca. """ url = '{api_url}/ligas'.format(api_url=self._api_url) data = self._request(url, params=dict(q=query)) return [Liga.from_dict(liga_info) for liga_info in data]
python
def ligas(self, query): """ Retorna o resultado da busca ao Cartola por um determinado termo de pesquisa. Args: query (str): Termo para utilizar na busca. Returns: Uma lista de instâncias de cartolafc.Liga, uma para cada liga contento o termo utilizado na busca. """ url = '{api_url}/ligas'.format(api_url=self._api_url) data = self._request(url, params=dict(q=query)) return [Liga.from_dict(liga_info) for liga_info in data]
[ "def", "ligas", "(", "self", ",", "query", ")", ":", "url", "=", "'{api_url}/ligas'", ".", "format", "(", "api_url", "=", "self", ".", "_api_url", ")", "data", "=", "self", ".", "_request", "(", "url", ",", "params", "=", "dict", "(", "q", "=", "query", ")", ")", "return", "[", "Liga", ".", "from_dict", "(", "liga_info", ")", "for", "liga_info", "in", "data", "]" ]
Retorna o resultado da busca ao Cartola por um determinado termo de pesquisa. Args: query (str): Termo para utilizar na busca. Returns: Uma lista de instâncias de cartolafc.Liga, uma para cada liga contento o termo utilizado na busca.
[ "Retorna", "o", "resultado", "da", "busca", "ao", "Cartola", "por", "um", "determinado", "termo", "de", "pesquisa", "." ]
15b2a192d7745f454d69a55ac9b7ef7c7abb53b9
https://github.com/vicenteneto/python-cartolafc/blob/15b2a192d7745f454d69a55ac9b7ef7c7abb53b9/cartolafc/api.py#L185-L197
train
Retorna o resultado da busca ao Cartola por um determinado termo de pesquisa.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPt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EhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + '\157' + chr(2351 - 2302) + chr(0b1011 + 0o50) + '\062', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\x31' + chr(54) + '\x33', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(61 - 10) + chr(49) + chr(429 - 374), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1001011 + 0o44) + chr(0b110010) + '\061' + chr(0b11100 + 0o24), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(50) + '\x33' + '\067', 53614 - 53606), nzTpIcepk0o8('\060' + '\157' + '\062' + chr(52) + chr(54), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(51) + '\061' + '\x32', 62041 - 62033), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + chr(55) + chr(0b11100 + 0o25), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b111 + 0o150) + chr(0b10000 + 0o45) + chr(0b11111 + 0o23), 0b1000), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(0b1101111) + chr(50) + '\x35' + '\064', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(2130 - 2081) + '\x33' + '\x32', 8), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\064' + chr(0b110010), 3765 - 3757), nzTpIcepk0o8(chr(0b110000) + chr(0b110 + 0o151) + chr(0b110011), 19539 - 19531), nzTpIcepk0o8(chr(398 - 350) + chr(0b1010111 + 0o30) + chr(0b10011 + 0o37) + '\063' + chr(1428 - 1374), ord("\x08")), nzTpIcepk0o8(chr(0b10 + 0o56) + '\157' + '\x33' + chr(1302 - 1249) + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(0b1101111) + chr(0b110010) + chr(53) + chr(0b110010), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b10010 + 0o40) + chr(55) + chr(0b110000 + 0o1), ord("\x08")), nzTpIcepk0o8(chr(567 - 519) + '\157' + chr(51) + chr(0b110101) + chr(111 - 60), 0b1000), nzTpIcepk0o8(chr(100 - 52) + '\157' + chr(712 - 662) + '\063' + chr(48), 0b1000), nzTpIcepk0o8('\060' + chr(0b1100011 + 0o14) + chr(1024 - 975) + chr(0b100110 + 0o13) + '\066', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(2047 - 1997) + chr(0b1101 + 0o47) + chr(51), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b11 + 0o57) + '\x35' + chr(54), 13962 - 13954), nzTpIcepk0o8('\x30' + chr(111) + '\063' + chr(2477 - 2427) + chr(0b111 + 0o53), ord("\x08")), nzTpIcepk0o8(chr(1729 - 1681) + chr(0b1101111) + chr(0b11000 + 0o32) + chr(54) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(1515 - 1467) + chr(11080 - 10969) + chr(0b110001) + '\066', ord("\x08")), nzTpIcepk0o8(chr(1711 - 1663) + chr(0b1101111) + chr(0b110001) + chr(1098 - 1049), 1762 - 1754), nzTpIcepk0o8('\060' + chr(0b1011001 + 0o26) + chr(0b1100 + 0o45) + chr(55) + chr(824 - 772), ord("\x08")), nzTpIcepk0o8('\060' + chr(9666 - 9555) + chr(49) + '\060' + '\x32', 0o10), nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(111) + chr(0b110010) + chr(0b110110) + chr(2596 - 2543), 8), nzTpIcepk0o8(chr(1938 - 1890) + '\157' + '\062' + chr(53), 0o10), nzTpIcepk0o8(chr(1992 - 1944) + '\x6f' + chr(51) + chr(0b110011) + '\060', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(302 - 248) + '\x30', 8794 - 8786), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(10785 - 10674) + '\x35' + '\064', ord("\x08")), nzTpIcepk0o8('\x30' + chr(9461 - 9350) + '\062' + '\x35', 8), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + chr(0b110000) + chr(54), 14035 - 14027), nzTpIcepk0o8(chr(48) + chr(11635 - 11524) + '\x35', 0o10), nzTpIcepk0o8(chr(48) + chr(0b110001 + 0o76) + '\063' + chr(2311 - 2259) + chr(2487 - 2434), 27105 - 27097), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(111) + chr(1506 - 1451), 0o10), nzTpIcepk0o8(chr(48) + chr(2452 - 2341) + chr(51) + chr(2311 - 2262) + chr(2362 - 2311), 51501 - 51493), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + chr(0b110111) + chr(2668 - 2616), 57337 - 57329)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(111) + chr(0b10011 + 0o42) + '\x30', ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b't'), '\144' + chr(5919 - 5818) + chr(0b1110 + 0o125) + chr(0b1101111) + chr(1552 - 1452) + chr(0b1011010 + 0o13))(chr(1026 - 909) + chr(0b1110100) + '\x66' + chr(0b101101) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def J_HaUZXzli6Z(hXMPsSrOQzbh, wKKXKFBlqW0G): XuBkOpBKZJ5Z = roI3spqORKae(ES5oEprVxulp(b'!\x12\xbf\xe1\xc0\xd3\xb8\x95W\x836Kd\xff\x9e'), chr(0b10 + 0o142) + '\x65' + chr(8246 - 8147) + chr(0b1101111) + chr(9792 - 9692) + '\145')(chr(117) + chr(0b1110100) + '\146' + '\x2d' + chr(1157 - 1101)).q33KG3foQ_CJ(api_url=hXMPsSrOQzbh.gpkgq1UwJyF9) FfKOThdpoDTb = hXMPsSrOQzbh.G0tfiEoJ08DV(XuBkOpBKZJ5Z, params=znjnJWK64FDT(q=wKKXKFBlqW0G)) return [roI3spqORKae(CJ15t7KkfVgS, roI3spqORKae(ES5oEprVxulp(b'8\x11\xad\xc2\xac\xe8\xa4\x95p\xd4kx'), '\x64' + '\145' + chr(5422 - 5323) + '\x6f' + '\144' + chr(0b111001 + 0o54))(chr(117) + chr(950 - 834) + '\146' + chr(0b101101) + chr(1899 - 1843)))(v8Pbv0XU3QWr) for v8Pbv0XU3QWr in FfKOThdpoDTb]
vicenteneto/python-cartolafc
cartolafc/api.py
Api.mercado
def mercado(self): """ Obtém o status do mercado na rodada atual. Returns: Uma instância de cartolafc.Mercado representando o status do mercado na rodada atual. """ url = '{api_url}/mercado/status'.format(api_url=self._api_url) data = self._request(url) return Mercado.from_dict(data)
python
def mercado(self): """ Obtém o status do mercado na rodada atual. Returns: Uma instância de cartolafc.Mercado representando o status do mercado na rodada atual. """ url = '{api_url}/mercado/status'.format(api_url=self._api_url) data = self._request(url) return Mercado.from_dict(data)
[ "def", "mercado", "(", "self", ")", ":", "url", "=", "'{api_url}/mercado/status'", ".", "format", "(", "api_url", "=", "self", ".", "_api_url", ")", "data", "=", "self", ".", "_request", "(", "url", ")", "return", "Mercado", ".", "from_dict", "(", "data", ")" ]
Obtém o status do mercado na rodada atual. Returns: Uma instância de cartolafc.Mercado representando o status do mercado na rodada atual.
[ "Obtém", "o", "status", "do", "mercado", "na", "rodada", "atual", "." ]
15b2a192d7745f454d69a55ac9b7ef7c7abb53b9
https://github.com/vicenteneto/python-cartolafc/blob/15b2a192d7745f454d69a55ac9b7ef7c7abb53b9/cartolafc/api.py#L205-L214
train
Return a Mercado object representing a status do mercado na rodada atual.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u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I5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1243 - 1195) + '\x6f' + chr(0b110010) + '\x36' + chr(49), 6343 - 6335), nzTpIcepk0o8(chr(48) + chr(1908 - 1797) + '\061' + chr(1762 - 1708) + chr(0b11101 + 0o25), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b100100 + 0o17) + '\062' + chr(1723 - 1670), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\x33' + '\063' + '\064', 0o10), nzTpIcepk0o8('\060' + chr(5617 - 5506) + '\061' + '\x31' + chr(0b110000), 63382 - 63374), nzTpIcepk0o8(chr(359 - 311) + '\x6f' + chr(0b100011 + 0o17) + '\x32' + chr(1156 - 1105), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\065' + '\066', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101101 + 0o2) + chr(0b110001) + chr(718 - 663) + '\x34', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b11101 + 0o122) + '\066' + chr(0b110111), 60704 - 60696), nzTpIcepk0o8(chr(873 - 825) + chr(10437 - 10326) + chr(49) + chr(54) + '\x33', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011 + 0o2) + chr(53), 0b1000), nzTpIcepk0o8('\060' + chr(2339 - 2228) + chr(752 - 703) + chr(0b10011 + 0o41) + '\x37', 21100 - 21092), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + chr(1116 - 1065) + chr(0b110001), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(528 - 478) + '\x37' + '\x33', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b101111 + 0o100) + chr(1934 - 1885) + '\062' + chr(51), 0o10), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b1101111) + chr(1054 - 1004) + chr(292 - 238), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\062' + '\x30' + chr(0b11100 + 0o30), 63554 - 63546), nzTpIcepk0o8('\060' + chr(2392 - 2281) + '\064', 21271 - 21263), nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(0b111100 + 0o63) + chr(0b101001 + 0o10), 23713 - 23705), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b11010 + 0o31) + '\x32' + '\x31', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(49) + '\066' + chr(54), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(850 - 801) + chr(1370 - 1315) + chr(2134 - 2079), 62510 - 62502), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110101) + chr(0b100 + 0o60), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\x33' + chr(48) + chr(0b110100), 54679 - 54671), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(0b110011 + 0o74) + '\x32' + chr(50) + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(0b110010 + 0o75) + chr(49) + chr(50) + '\x33', 8), nzTpIcepk0o8(chr(1802 - 1754) + '\157' + chr(0b110001) + '\062' + chr(726 - 677), 15727 - 15719), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(54) + chr(53), 22156 - 22148), nzTpIcepk0o8(chr(2137 - 2089) + chr(111) + chr(0b110001) + chr(0b110111) + chr(54), 48235 - 48227), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110001) + '\x34' + chr(0b11100 + 0o33), 8), nzTpIcepk0o8(chr(2149 - 2101) + chr(0b1101111) + chr(1225 - 1175) + '\x30', 0b1000), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(8485 - 8374) + '\064' + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\157' + chr(51) + '\062' + chr(2558 - 2507), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1344 - 1295) + '\x33' + chr(52), 19208 - 19200), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(0b10010 + 0o135) + '\062' + '\067' + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1752 - 1701) + chr(53) + '\062', 12604 - 12596), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b1101100 + 0o3) + chr(51) + '\065' + '\064', 0o10), nzTpIcepk0o8(chr(358 - 310) + chr(111) + '\x32' + chr(53), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b10011 + 0o134) + '\062' + '\063' + chr(52), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1100110 + 0o11) + chr(1122 - 1071) + '\x33' + '\064', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + '\x6f' + chr(53) + chr(0b10001 + 0o37), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x9f'), '\144' + chr(0b1100101) + chr(9671 - 9572) + chr(111) + chr(4851 - 4751) + chr(101))(chr(12056 - 11939) + chr(0b11011 + 0o131) + chr(5005 - 4903) + chr(0b100000 + 0o15) + chr(2512 - 2456)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def BX8srKd4Hv4J(hXMPsSrOQzbh): XuBkOpBKZJ5Z = roI3spqORKae(ES5oEprVxulp(b'\xca\x13\xa5\xb5\x17\xe6\\\x10J\\@\x02\xab\xd82r\xeb+r\xa5\x17\x0bY\xb7'), chr(7493 - 7393) + chr(6729 - 6628) + chr(4062 - 3963) + '\157' + chr(0b1100100 + 0o0) + '\x65')(chr(0b1 + 0o164) + chr(0b10111 + 0o135) + chr(0b101010 + 0o74) + chr(0b100000 + 0o15) + chr(56)).q33KG3foQ_CJ(api_url=hXMPsSrOQzbh.gpkgq1UwJyF9) FfKOThdpoDTb = hXMPsSrOQzbh.G0tfiEoJ08DV(XuBkOpBKZJ5Z) return roI3spqORKae(O5Jt_uvjawzK, roI3spqORKae(ES5oEprVxulp(b'\xd3\x10\xb7\x96{\xdd@\x10m\x0b\x1c='), chr(100) + chr(0b1010101 + 0o20) + '\x63' + chr(0b1101111) + '\144' + chr(8133 - 8032))(chr(117) + chr(6473 - 6357) + chr(7429 - 7327) + chr(45) + '\x38'))(FfKOThdpoDTb)
vicenteneto/python-cartolafc
cartolafc/api.py
Api.parciais
def parciais(self): """ Obtém um mapa com todos os atletas que já pontuaram na rodada atual (aberta). Returns: Uma mapa, onde a key é um inteiro representando o id do atleta e o valor é uma instância de cartolafc.Atleta Raises: CartolaFCError: Se o mercado atual estiver com o status fechado. """ if self.mercado().status.id == MERCADO_FECHADO: url = '{api_url}/atletas/pontuados'.format(api_url=self._api_url) data = self._request(url) clubes = {clube['id']: Clube.from_dict(clube) for clube in data['clubes'].values()} return {int(atleta_id): Atleta.from_dict(atleta, clubes=clubes, atleta_id=int(atleta_id)) for atleta_id, atleta in data['atletas'].items() if atleta['clube_id'] > 0} raise CartolaFCError('As pontuações parciais só ficam disponíveis com o mercado fechado.')
python
def parciais(self): """ Obtém um mapa com todos os atletas que já pontuaram na rodada atual (aberta). Returns: Uma mapa, onde a key é um inteiro representando o id do atleta e o valor é uma instância de cartolafc.Atleta Raises: CartolaFCError: Se o mercado atual estiver com o status fechado. """ if self.mercado().status.id == MERCADO_FECHADO: url = '{api_url}/atletas/pontuados'.format(api_url=self._api_url) data = self._request(url) clubes = {clube['id']: Clube.from_dict(clube) for clube in data['clubes'].values()} return {int(atleta_id): Atleta.from_dict(atleta, clubes=clubes, atleta_id=int(atleta_id)) for atleta_id, atleta in data['atletas'].items() if atleta['clube_id'] > 0} raise CartolaFCError('As pontuações parciais só ficam disponíveis com o mercado fechado.')
[ "def", "parciais", "(", "self", ")", ":", "if", "self", ".", "mercado", "(", ")", ".", "status", ".", "id", "==", "MERCADO_FECHADO", ":", "url", "=", "'{api_url}/atletas/pontuados'", ".", "format", "(", "api_url", "=", "self", ".", "_api_url", ")", "data", "=", "self", ".", "_request", "(", "url", ")", "clubes", "=", "{", "clube", "[", "'id'", "]", ":", "Clube", ".", "from_dict", "(", "clube", ")", "for", "clube", "in", "data", "[", "'clubes'", "]", ".", "values", "(", ")", "}", "return", "{", "int", "(", "atleta_id", ")", ":", "Atleta", ".", "from_dict", "(", "atleta", ",", "clubes", "=", "clubes", ",", "atleta_id", "=", "int", "(", "atleta_id", ")", ")", "for", "atleta_id", ",", "atleta", "in", "data", "[", "'atletas'", "]", ".", "items", "(", ")", "if", "atleta", "[", "'clube_id'", "]", ">", "0", "}", "raise", "CartolaFCError", "(", "'As pontuações parciais só ficam disponíveis com o mercado fechado.')", "" ]
Obtém um mapa com todos os atletas que já pontuaram na rodada atual (aberta). Returns: Uma mapa, onde a key é um inteiro representando o id do atleta e o valor é uma instância de cartolafc.Atleta Raises: CartolaFCError: Se o mercado atual estiver com o status fechado.
[ "Obtém", "um", "mapa", "com", "todos", "os", "atletas", "que", "já", "pontuaram", "na", "rodada", "atual", "(", "aberta", ")", "." ]
15b2a192d7745f454d69a55ac9b7ef7c7abb53b9
https://github.com/vicenteneto/python-cartolafc/blob/15b2a192d7745f454d69a55ac9b7ef7c7abb53b9/cartolafc/api.py#L222-L239
train
Return a dictionary of all the parciais in a mercado atual estiver.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqO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riYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(0b1101111) + '\063' + chr(0b110100) + '\062', 0b1000), nzTpIcepk0o8('\060' + chr(0b0 + 0o157) + chr(394 - 343) + chr(1274 - 1223), 0o10), nzTpIcepk0o8('\x30' + chr(0b1000101 + 0o52) + chr(2001 - 1951) + chr(432 - 380) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(90 - 42) + chr(0b1001000 + 0o47) + '\x33' + '\x32' + chr(0b111 + 0o51), 0b1000), nzTpIcepk0o8(chr(48) + chr(4266 - 4155) + chr(0b100010 + 0o20) + '\062' + '\060', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b10100 + 0o36) + chr(0b10101 + 0o34) + chr(54), 0b1000), nzTpIcepk0o8('\060' + chr(0b1010100 + 0o33) + chr(2499 - 2449) + chr(0b101 + 0o62) + chr(0b110001), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(1861 - 1809) + chr(1861 - 1808), 20354 - 20346), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x33' + chr(1755 - 1707) + '\x37', 0o10), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b1101111) + chr(0b10110 + 0o34) + chr(0b110000 + 0o7) + chr(51), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(1731 - 1681) + chr(1042 - 990) + chr(2660 - 2608), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b101101 + 0o5) + chr(0b110100) + chr(49), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b100010 + 0o20) + chr(0b110001) + chr(0b10100 + 0o40), ord("\x08")), nzTpIcepk0o8(chr(600 - 552) + '\157' + chr(0b110010) + '\x34' + chr(940 - 892), ord("\x08")), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(7648 - 7537) + chr(0b110001) + chr(54), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\x32' + chr(48) + '\x34', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b101101 + 0o5) + chr(0b110111) + chr(1980 - 1929), 8), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b1110 + 0o43) + chr(778 - 730) + chr(0b100010 + 0o22), 0b1000), nzTpIcepk0o8(chr(1610 - 1562) + '\x6f' + chr(0b110010) + chr(0b111 + 0o54) + chr(0b110 + 0o60), 0o10), nzTpIcepk0o8(chr(74 - 26) + chr(111) + '\062' + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(51) + chr(0b110011 + 0o3) + chr(2178 - 2128), ord("\x08")), nzTpIcepk0o8('\x30' + chr(1617 - 1506) + '\066' + '\064', 39248 - 39240), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(0b110011) + chr(53), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b10011 + 0o43) + '\x32', ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(218 - 168) + chr(0b110010) + chr(0b10001 + 0o40), ord("\x08")), nzTpIcepk0o8(chr(0b11110 + 0o22) + '\157' + '\062' + chr(0b110111) + chr(1082 - 1029), 0o10), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(11118 - 11007) + '\063' + chr(0b110000) + chr(0b101 + 0o61), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101 + 0o142) + '\062' + chr(0b11011 + 0o25) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\061' + chr(0b110001), 16483 - 16475), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b111 + 0o53) + chr(706 - 653) + '\062', 0o10), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(9620 - 9509) + chr(1202 - 1153) + chr(0b110110), 8), nzTpIcepk0o8(chr(1067 - 1019) + '\157' + chr(0b110001) + chr(2137 - 2089) + chr(0b110001), 20763 - 20755), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(51) + chr(0b100110 + 0o15) + chr(465 - 415), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + chr(53) + chr(1564 - 1512), ord("\x08")), nzTpIcepk0o8(chr(2047 - 1999) + chr(0b100000 + 0o117) + chr(0b100 + 0o55) + '\063' + chr(0b110100), 46333 - 46325), nzTpIcepk0o8(chr(0b110000) + chr(0b110010 + 0o75) + chr(0b110100 + 0o3) + chr(0b110001), 60533 - 60525), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110011 + 0o0) + chr(1956 - 1907) + '\x35', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(789 - 738) + '\067' + chr(0b10100 + 0o36), 43194 - 43186), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(0b110110) + chr(48), 0b1000), nzTpIcepk0o8('\x30' + chr(6607 - 6496) + '\x31' + chr(52) + '\x35', 6506 - 6498)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\065' + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xcc'), '\x64' + chr(0b10010 + 0o123) + chr(0b1100011) + chr(0b1101111) + '\144' + chr(0b1010001 + 0o24))('\x75' + '\164' + '\146' + chr(608 - 563) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def eVA1LgujoPw8(hXMPsSrOQzbh): if roI3spqORKae(hXMPsSrOQzbh.mercado().status, roI3spqORKae(ES5oEprVxulp(b'\x8fz\xea\xbe\xdc\xe9\x81\xaa\xf2\xc1\xf4\xf5'), '\144' + chr(0b1100101) + '\x63' + chr(9452 - 9341) + chr(0b1100100) + chr(0b100100 + 0o101))('\165' + chr(116) + chr(102) + chr(0b101101) + chr(1711 - 1655))) == aJRBgKlUrC4w: XuBkOpBKZJ5Z = roI3spqORKae(ES5oEprVxulp(b'\x99z\xd6\xb9\xcf\xfb\xcb\x89\xba\x94\xc5\xd5\xe0\xc5z\xe5\xc8k\xee{\x9c@\xe8S\xf5\xd2\xb5'), chr(0b1100100) + chr(2405 - 2304) + chr(0b111111 + 0o44) + chr(2339 - 2228) + chr(100) + chr(0b11011 + 0o112))(chr(0b1000011 + 0o62) + chr(0b1110100) + chr(1027 - 925) + chr(1396 - 1351) + '\070').q33KG3foQ_CJ(api_url=hXMPsSrOQzbh.gpkgq1UwJyF9) FfKOThdpoDTb = hXMPsSrOQzbh.G0tfiEoJ08DV(XuBkOpBKZJ5Z) oBNOCAgAnPj3 = {_y3_qvZ3doZb[roI3spqORKae(ES5oEprVxulp(b'\x8b\x7f'), chr(0b1100100) + chr(101) + chr(7783 - 7684) + chr(1182 - 1071) + chr(100) + '\145')('\x75' + chr(116) + '\x66' + '\055' + chr(0b10010 + 0o46))]: lQjPGY6aazFv.bbbJ3NnlZx1Z(_y3_qvZ3doZb) for _y3_qvZ3doZb in FfKOThdpoDTb[roI3spqORKae(ES5oEprVxulp(b'\x81w\xd3\xb2\xf5\xfd'), '\144' + chr(101) + '\143' + chr(0b1011011 + 0o24) + chr(100) + chr(101))('\165' + chr(2692 - 2576) + chr(0b1100110) + chr(45) + chr(0b110100 + 0o4))].CsodZJH6x9Tx()} return {nzTpIcepk0o8(Yhux1j7gBQxh): roI3spqORKae(y3EgbpQv_Rhd, roI3spqORKae(ES5oEprVxulp(b'\x80y\xc4\x9a\xa3\xc0\xd7\x89\x9d\xc3\x95\xfb'), '\144' + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b1010000 + 0o24) + chr(0b1011010 + 0o13))('\165' + chr(0b100110 + 0o116) + '\146' + chr(0b101101) + '\070'))(NKKVywa9D45p, clubes=oBNOCAgAnPj3, atleta_id=nzTpIcepk0o8(Yhux1j7gBQxh)) for (Yhux1j7gBQxh, NKKVywa9D45p) in roI3spqORKae(FfKOThdpoDTb[roI3spqORKae(ES5oEprVxulp(b'\x83o\xca\xb5\xe4\xef\xca'), '\x64' + chr(0b1000000 + 0o45) + chr(0b1010011 + 0o20) + chr(111) + '\144' + '\x65')(chr(0b1110101) + '\164' + '\146' + chr(0b101101) + chr(0b111000))], roI3spqORKae(ES5oEprVxulp(b'\xbbD\xc8\x9e\xd5\xf4\xf1\xd1\xf4\xcd\xfc\xc8'), chr(0b1110 + 0o126) + chr(101) + chr(3061 - 2962) + chr(0b10101 + 0o132) + chr(0b1100100) + '\x65')(chr(117) + chr(9066 - 8950) + chr(0b111 + 0o137) + chr(45) + chr(0b111000)))() if NKKVywa9D45p[roI3spqORKae(ES5oEprVxulp(b'\x81w\xd3\xb2\xf5\xd1\xd0\x81'), chr(0b1001010 + 0o32) + '\145' + chr(0b1100011) + '\x6f' + chr(7970 - 7870) + chr(0b1010000 + 0o25))(chr(11347 - 11230) + '\164' + chr(102) + chr(0b101101) + chr(56))] > nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(0b101100 + 0o103) + chr(115 - 67), 0o10)} raise PcIxAs2GVS6s(roI3spqORKae(ES5oEprVxulp(b'\xa3h\x86\xa0\xff\xe0\xcd\x90\xa6x\x03b9\xc5}\xa4\xcb%\xecw\x9bU\xf4A\xb1\xce\x054)\xccg"\xbb\x81|]\xa4\x89\x00\n\x8c\xd8\x0b\xa6\xf5\xe7\xca\xc5\xa4\xd4\xc9\x81\xe3\x80c\xe1\xc9\'\xffp\x9d\x14\xfbW\xf2\xd5\xa7\xe3f\x84'), chr(0b11111 + 0o105) + '\x65' + '\143' + chr(8469 - 8358) + chr(0b111 + 0o135) + '\x65')('\x75' + chr(0b1110100) + chr(10373 - 10271) + chr(45) + chr(0b111000)))
vicenteneto/python-cartolafc
cartolafc/api.py
Api.time
def time(self, id=None, nome=None, slug=None, as_json=False): """ Obtém um time específico, baseando-se no nome ou no slug utilizado. Ao menos um dos dois devem ser informado. Args: id (int): Id to time que se deseja obter. *Este argumento sempre será utilizado primeiro* nome (str): Nome do time que se deseja obter. Requerido se o slug não for informado. slug (str): Slug do time que se deseja obter. *Este argumento tem prioridade sobre o nome* as_json (bool): Se desejar obter o retorno no formato json. Returns: Uma instância de cartolafc.Time se o time foi encontrado. Raises: cartolafc.CartolaFCError: Se algum erro aconteceu, como por exemplo: Nenhum time foi encontrado. """ if not any((id, nome, slug)): raise CartolaFCError('Você precisa informar o nome ou o slug do time que deseja obter') param = 'id' if id else 'slug' value = id if id else (slug if slug else convert_team_name_to_slug(nome)) url = '{api_url}/time/{param}/{value}'.format(api_url=self._api_url, param=param, value=value) data = self._request(url) if bool(as_json): return data clubes = {clube['id']: Clube.from_dict(clube) for clube in data['clubes'].values()} return Time.from_dict(data, clubes=clubes, capitao=data['capitao_id'])
python
def time(self, id=None, nome=None, slug=None, as_json=False): """ Obtém um time específico, baseando-se no nome ou no slug utilizado. Ao menos um dos dois devem ser informado. Args: id (int): Id to time que se deseja obter. *Este argumento sempre será utilizado primeiro* nome (str): Nome do time que se deseja obter. Requerido se o slug não for informado. slug (str): Slug do time que se deseja obter. *Este argumento tem prioridade sobre o nome* as_json (bool): Se desejar obter o retorno no formato json. Returns: Uma instância de cartolafc.Time se o time foi encontrado. Raises: cartolafc.CartolaFCError: Se algum erro aconteceu, como por exemplo: Nenhum time foi encontrado. """ if not any((id, nome, slug)): raise CartolaFCError('Você precisa informar o nome ou o slug do time que deseja obter') param = 'id' if id else 'slug' value = id if id else (slug if slug else convert_team_name_to_slug(nome)) url = '{api_url}/time/{param}/{value}'.format(api_url=self._api_url, param=param, value=value) data = self._request(url) if bool(as_json): return data clubes = {clube['id']: Clube.from_dict(clube) for clube in data['clubes'].values()} return Time.from_dict(data, clubes=clubes, capitao=data['capitao_id'])
[ "def", "time", "(", "self", ",", "id", "=", "None", ",", "nome", "=", "None", ",", "slug", "=", "None", ",", "as_json", "=", "False", ")", ":", "if", "not", "any", "(", "(", "id", ",", "nome", ",", "slug", ")", ")", ":", "raise", "CartolaFCError", "(", "'Você precisa informar o nome ou o slug do time que deseja obter')", "", "param", "=", "'id'", "if", "id", "else", "'slug'", "value", "=", "id", "if", "id", "else", "(", "slug", "if", "slug", "else", "convert_team_name_to_slug", "(", "nome", ")", ")", "url", "=", "'{api_url}/time/{param}/{value}'", ".", "format", "(", "api_url", "=", "self", ".", "_api_url", ",", "param", "=", "param", ",", "value", "=", "value", ")", "data", "=", "self", ".", "_request", "(", "url", ")", "if", "bool", "(", "as_json", ")", ":", "return", "data", "clubes", "=", "{", "clube", "[", "'id'", "]", ":", "Clube", ".", "from_dict", "(", "clube", ")", "for", "clube", "in", "data", "[", "'clubes'", "]", ".", "values", "(", ")", "}", "return", "Time", ".", "from_dict", "(", "data", ",", "clubes", "=", "clubes", ",", "capitao", "=", "data", "[", "'capitao_id'", "]", ")" ]
Obtém um time específico, baseando-se no nome ou no slug utilizado. Ao menos um dos dois devem ser informado. Args: id (int): Id to time que se deseja obter. *Este argumento sempre será utilizado primeiro* nome (str): Nome do time que se deseja obter. Requerido se o slug não for informado. slug (str): Slug do time que se deseja obter. *Este argumento tem prioridade sobre o nome* as_json (bool): Se desejar obter o retorno no formato json. Returns: Uma instância de cartolafc.Time se o time foi encontrado. Raises: cartolafc.CartolaFCError: Se algum erro aconteceu, como por exemplo: Nenhum time foi encontrado.
[ "Obtém", "um", "time", "específico", "baseando", "-", "se", "no", "nome", "ou", "no", "slug", "utilizado", ".", "Ao", "menos", "um", "dos", "dois", "devem", "ser", "informado", "." ]
15b2a192d7745f454d69a55ac9b7ef7c7abb53b9
https://github.com/vicenteneto/python-cartolafc/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,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(111) + chr(645 - 596) + chr(0b110110) + chr(0b110011), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(889 - 840) + chr(0b110111) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(48) + chr(2799 - 2688) + chr(50) + '\061' + chr(55), 0b1000), nzTpIcepk0o8(chr(1517 - 1469) + chr(7167 - 7056) + chr(50) + '\066', 0b1000), nzTpIcepk0o8('\060' + chr(6784 - 6673) + '\x33' + chr(0b1000 + 0o57) + chr(2483 - 2428), ord("\x08")), nzTpIcepk0o8('\x30' + chr(5649 - 5538) + chr(0b100110 + 0o13) + chr(50) + '\063', 51789 - 51781), nzTpIcepk0o8(chr(944 - 896) + chr(0b1101111) + chr(92 - 43) + chr(0b110101) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(94 - 44) + chr(1446 - 1398), 34207 - 34199), nzTpIcepk0o8('\060' + chr(0b1010111 + 0o30) + chr(51) + chr(0b110010) + chr(0b110010), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1 + 0o156) + chr(2183 - 2133) + chr(0b110001) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(2080 - 2032) + chr(2097 - 1986) + '\063' + chr(0b101011 + 0o14) + '\063', 0o10), nzTpIcepk0o8(chr(1560 - 1512) + chr(111) + chr(0b110001) + chr(2353 - 2304) + chr(48), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\x33' + chr(51) + chr(1165 - 1114), 0o10), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b1000110 + 0o51) + '\x33' + chr(0b110100) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(51) + chr(51) + '\x34', 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\063' + chr(0b1110 + 0o43), ord("\x08")), nzTpIcepk0o8(chr(1718 - 1670) + chr(111) + chr(154 - 104) + chr(0b110000 + 0o1) + chr(1173 - 1120), ord("\x08")), nzTpIcepk0o8(chr(1847 - 1799) + '\x6f' + chr(1286 - 1236) + '\x33' + chr(50), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(3472 - 3361) + '\x32' + chr(0b100 + 0o63) + '\067', 49041 - 49033), nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(111) + chr(51) + '\063' + chr(0b11101 + 0o32), 0b1000), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(9632 - 9521) + chr(50) + chr(0b10000 + 0o44) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(99 - 51) + '\157' + chr(0b110001) + chr(0b100 + 0o54) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\x32' + chr(777 - 728) + chr(0b110001), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(51) + chr(0b100011 + 0o24) + chr(0b110110), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + chr(52) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\061' + chr(53) + chr(2582 - 2529), 39315 - 39307), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(427 - 376) + chr(0b110101) + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(49) + '\060' + chr(1182 - 1132), ord("\x08")), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(8259 - 8148) + chr(0b110111) + chr(0b1110 + 0o42), ord("\x08")), nzTpIcepk0o8(chr(473 - 425) + chr(0b1101001 + 0o6) + chr(53) + chr(0b10001 + 0o40), 0b1000), nzTpIcepk0o8(chr(188 - 140) + chr(9853 - 9742) + chr(0b100000 + 0o26) + chr(51), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b111010 + 0o65) + '\062' + '\x34' + '\x32', 0o10), nzTpIcepk0o8(chr(1802 - 1754) + chr(0b1101111) + chr(2327 - 2278) + chr(854 - 799), 43468 - 43460), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + chr(53) + '\x33', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110011) + '\x34' + '\067', ord("\x08")), nzTpIcepk0o8(chr(1099 - 1051) + chr(111) + chr(50) + chr(0b110101) + chr(55), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b11 + 0o154) + '\063' + '\x34' + chr(477 - 426), 8), nzTpIcepk0o8('\x30' + chr(3973 - 3862) + chr(50) + chr(2719 - 2664) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b100010 + 0o20) + chr(1926 - 1874) + '\x34', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110010) + '\x32' + '\060', 25375 - 25367)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + '\157' + chr(53) + chr(404 - 356), 29329 - 29321)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b']'), chr(100) + chr(101) + chr(0b101101 + 0o66) + '\157' + chr(0b1100100) + chr(0b1000010 + 0o43))('\165' + '\164' + chr(2125 - 2023) + '\055' + chr(1731 - 1675)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def oprIvDIRQyCb(hXMPsSrOQzbh, maLnLg8O5zPT=None, cAZVNgVckYjK=None, kMwZMMRH4hj5=None, _MayW0ggQxos=nzTpIcepk0o8(chr(343 - 295) + chr(0b1101111) + chr(2279 - 2231), ord("\x08"))): if not VF4pKOObtlPc((maLnLg8O5zPT, cAZVNgVckYjK, kMwZMMRH4hj5)): raise PcIxAs2GVS6s(roI3spqORKae(ES5oEprVxulp(b'%\x12\xec\xd5Us\x18b\xb7\xeb\x92;\xba\xc3\xb5w\xeb\xf5\xcd\xb2\xc42\xa9\x91\x80\x03\x80/]\t\\\xd7/\xc4\xc7\xdc\x8f\xcc\xc3\xb0\x17\x12\xafb\x96>\r0\xa3\xfd\x9eh\xbf\x86\xaf|\xe7\xfb\x9f\xb0\xc74\xec\x8c'), chr(0b101011 + 0o71) + chr(101) + chr(0b1100011) + '\157' + '\x64' + chr(0b1100101))(chr(117) + chr(116) + chr(102) + chr(174 - 129) + '\070')) BDr7SxpOFXwl = roI3spqORKae(ES5oEprVxulp(b'\x1a\x19'), chr(100) + chr(5864 - 5763) + chr(4538 - 4439) + chr(0b1011011 + 0o24) + chr(0b1100100) + chr(101))('\x75' + '\164' + chr(0b111110 + 0o50) + chr(0b101101) + chr(0b111000)) if maLnLg8O5zPT else roI3spqORKae(ES5oEprVxulp(b'\x00\x11\xfaq'), chr(471 - 371) + chr(0b1111 + 0o126) + chr(3008 - 2909) + chr(0b1101111) + '\x64' + '\x65')('\165' + chr(4704 - 4588) + chr(0b1010011 + 0o23) + chr(0b11100 + 0o21) + chr(1888 - 1832)) uV9iBiw0y_Mp = maLnLg8O5zPT if maLnLg8O5zPT else kMwZMMRH4hj5 if kMwZMMRH4hj5 else DjwFmrhXjY_3(cAZVNgVckYjK) XuBkOpBKZJ5Z = roI3spqORKae(ES5oEprVxulp(b'\x08\x1c\xff\x7f\xa0&\x1a|\xaf\xa7\x8f!\xb6\x86\xf3b\xfd\xfb\xcd\xbe\xc8=\xa6\x85\xd6\x0c\x837]T'), chr(0b1100100) + chr(1353 - 1252) + chr(99) + '\x6f' + '\x64' + chr(8523 - 8422))(chr(7945 - 7828) + chr(0b1110100) + '\x66' + chr(45) + chr(1023 - 967)).q33KG3foQ_CJ(api_url=hXMPsSrOQzbh.gpkgq1UwJyF9, param=BDr7SxpOFXwl, value=uV9iBiw0y_Mp) FfKOThdpoDTb = hXMPsSrOQzbh.G0tfiEoJ08DV(XuBkOpBKZJ5Z) if TVUhqOt5_BbS(_MayW0ggQxos): return FfKOThdpoDTb oBNOCAgAnPj3 = {_y3_qvZ3doZb[roI3spqORKae(ES5oEprVxulp(b'\x1a\x19'), chr(5544 - 5444) + chr(0b1100101) + '\143' + chr(111) + chr(1997 - 1897) + chr(0b1100101))(chr(0b1110101) + chr(116) + '\x66' + chr(88 - 43) + chr(0b110000 + 0o10))]: lQjPGY6aazFv.bbbJ3NnlZx1Z(_y3_qvZ3doZb) for _y3_qvZ3doZb in FfKOThdpoDTb[roI3spqORKae(ES5oEprVxulp(b'\x10\x11\xfat\x9a '), '\x64' + chr(4473 - 4372) + chr(6362 - 6263) + '\x6f' + '\x64' + chr(0b1010000 + 0o25))(chr(117) + chr(0b1110100) + '\x66' + chr(0b100101 + 0o10) + chr(56))].CsodZJH6x9Tx()} return roI3spqORKae(fsDKHjH2DeEs, roI3spqORKae(ES5oEprVxulp(b'\x11\x1f\xed\\\xcc\x1d\x06|\x88\xf0\xca\x12'), chr(100) + chr(0b1100101) + chr(6871 - 6772) + '\x6f' + chr(0b1001110 + 0o26) + '\145')('\x75' + '\x74' + '\146' + chr(45) + chr(0b111000)))(FfKOThdpoDTb, clubes=oBNOCAgAnPj3, capitao=FfKOThdpoDTb[roI3spqORKae(ES5oEprVxulp(b'\x10\x1c\xff\x7f\x8b2\x07O\xbb\xec'), '\x64' + chr(2763 - 2662) + '\143' + chr(4435 - 4324) + chr(100) + '\x65')('\x75' + '\164' + '\x66' + chr(1803 - 1758) + chr(2359 - 2303))])
vicenteneto/python-cartolafc
cartolafc/api.py
Api.times
def times(self, query): """ Retorna o resultado da busca ao Cartola por um determinado termo de pesquisa. Args: query (str): Termo para utilizar na busca. Returns: Uma lista de instâncias de cartolafc.TimeInfo, uma para cada time contento o termo utilizado na busca. """ url = '{api_url}/times'.format(api_url=self._api_url) data = self._request(url, params=dict(q=query)) return [TimeInfo.from_dict(time_info) for time_info in data]
python
def times(self, query): """ Retorna o resultado da busca ao Cartola por um determinado termo de pesquisa. Args: query (str): Termo para utilizar na busca. Returns: Uma lista de instâncias de cartolafc.TimeInfo, uma para cada time contento o termo utilizado na busca. """ url = '{api_url}/times'.format(api_url=self._api_url) data = self._request(url, params=dict(q=query)) return [TimeInfo.from_dict(time_info) for time_info in data]
[ "def", "times", "(", "self", ",", "query", ")", ":", "url", "=", "'{api_url}/times'", ".", "format", "(", "api_url", "=", "self", ".", "_api_url", ")", "data", "=", "self", ".", "_request", "(", "url", ",", "params", "=", "dict", "(", "q", "=", "query", ")", ")", "return", "[", "TimeInfo", ".", "from_dict", "(", "time_info", ")", "for", "time_info", "in", "data", "]" ]
Retorna o resultado da busca ao Cartola por um determinado termo de pesquisa. Args: query (str): Termo para utilizar na busca. Returns: Uma lista de instâncias de cartolafc.TimeInfo, uma para cada time contento o termo utilizado na busca.
[ "Retorna", "o", "resultado", "da", "busca", "ao", "Cartola", "por", "um", "determinado", "termo", "de", "pesquisa", "." ]
15b2a192d7745f454d69a55ac9b7ef7c7abb53b9
https://github.com/vicenteneto/python-cartolafc/blob/15b2a192d7745f454d69a55ac9b7ef7c7abb53b9/cartolafc/api.py#L293-L304
train
Retorna o resultado da busca ao Cartola por um determinado termo de pesquisa.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW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QBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(0b10100 + 0o133) + chr(84 - 34) + chr(0b110110) + chr(51), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(50) + chr(0b110110) + chr(0b100101 + 0o22), 0b1000), nzTpIcepk0o8(chr(1941 - 1893) + '\x6f' + chr(51) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(2292 - 2241) + chr(0b110111) + chr(0b101100 + 0o11), 30988 - 30980), nzTpIcepk0o8(chr(0b110000) + chr(0b1001011 + 0o44) + chr(0b111 + 0o53) + '\x30' + chr(54), 0o10), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(111) + '\063' + chr(0b110101) + chr(0b110011), 8812 - 8804), nzTpIcepk0o8(chr(1186 - 1138) + chr(8458 - 8347) + chr(2285 - 2236) + '\062' + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(0b1101111) + chr(0b1010 + 0o47) + '\063', 45979 - 45971), nzTpIcepk0o8(chr(1165 - 1117) + chr(111) + '\x32' + '\067' + '\x33', 4616 - 4608), nzTpIcepk0o8('\060' + '\157' + chr(0b110001) + chr(0b110010) + chr(53), 0b1000), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(2743 - 2632) + chr(737 - 687) + '\x30', 0o10), nzTpIcepk0o8(chr(1667 - 1619) + chr(1628 - 1517) + chr(0b110001) + '\061' + chr(0b110110), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\x31' + chr(0b110110) + chr(346 - 294), 28107 - 28099), nzTpIcepk0o8(chr(0b110000) + chr(6229 - 6118) + chr(0b1100 + 0o45) + chr(48) + chr(0b1000 + 0o52), 52920 - 52912), nzTpIcepk0o8(chr(134 - 86) + '\157' + chr(51) + chr(0b110110) + chr(0b0 + 0o60), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1011 + 0o144) + chr(0b10000 + 0o43) + '\060' + chr(51), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b11101 + 0o25) + chr(1103 - 1048), ord("\x08")), nzTpIcepk0o8(chr(0b110 + 0o52) + chr(111) + chr(2170 - 2120) + '\067' + chr(0b110000), 0o10), nzTpIcepk0o8('\060' + chr(1209 - 1098) + chr(0b110010) + '\x30' + chr(0b110111), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\062' + chr(50) + '\063', 0b1000), nzTpIcepk0o8(chr(1601 - 1553) + chr(10887 - 10776) + chr(51) + chr(0b110001) + chr(53), 49080 - 49072), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(2229 - 2178) + '\062' + '\x37', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\061' + chr(0b1010 + 0o46) + chr(0b1 + 0o63), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b10001 + 0o40) + chr(49) + '\x34', 0b1000), nzTpIcepk0o8('\x30' + chr(841 - 730) + chr(50) + chr(1985 - 1935) + '\x30', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(2391 - 2340) + '\067' + '\061', 0o10), nzTpIcepk0o8('\060' + chr(0b11111 + 0o120) + '\063' + '\065' + '\063', 8), nzTpIcepk0o8(chr(1346 - 1298) + '\x6f' + chr(0b110110) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b100001 + 0o17) + '\x6f' + '\062' + chr(0b101010 + 0o10) + chr(0b10011 + 0o40), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110011) + chr(323 - 273) + '\x31', 0o10), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(0b110 + 0o151) + chr(0b110010) + chr(55) + chr(0b110001), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(2330 - 2281) + chr(621 - 573) + chr(935 - 880), 0o10), nzTpIcepk0o8('\x30' + chr(6397 - 6286) + '\061' + chr(2258 - 2205) + '\064', 0b1000), nzTpIcepk0o8('\060' + '\157' + '\061' + chr(0b110010) + chr(0b1100 + 0o53), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1010011 + 0o34) + chr(2105 - 2054) + '\063', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x31' + '\065' + chr(0b110100), 8), nzTpIcepk0o8(chr(48) + chr(0b1011010 + 0o25) + chr(49) + chr(0b110110) + chr(0b10011 + 0o35), 1995 - 1987), nzTpIcepk0o8(chr(0b110000) + chr(0b1100100 + 0o13) + chr(0b110010) + chr(0b110110) + '\065', 0b1000), nzTpIcepk0o8('\060' + chr(5124 - 5013) + chr(53) + chr(0b11000 + 0o33), 0o10), nzTpIcepk0o8(chr(0b11011 + 0o25) + '\x6f' + '\062' + chr(0b110010) + chr(0b111 + 0o52), 22955 - 22947)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + '\157' + '\x35' + '\060', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x9d'), '\x64' + chr(101) + chr(6896 - 6797) + chr(0b1101111) + '\x64' + chr(5852 - 5751))(chr(117) + chr(116) + chr(102) + '\055' + chr(0b10000 + 0o50)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def wV5dGZrosDy4(hXMPsSrOQzbh, wKKXKFBlqW0G): XuBkOpBKZJ5Z = roI3spqORKae(ES5oEprVxulp(b"\xc8\xd6i\x94\xd9\x9e&g\xc6zd'\x19'\x83"), chr(0b1100100) + '\145' + chr(99) + chr(5421 - 5310) + '\x64' + chr(101))('\165' + chr(116) + '\146' + chr(1574 - 1529) + '\070').q33KG3foQ_CJ(api_url=hXMPsSrOQzbh.gpkgq1UwJyF9) FfKOThdpoDTb = hXMPsSrOQzbh.G0tfiEoJ08DV(XuBkOpBKZJ5Z, params=znjnJWK64FDT(q=wKKXKFBlqW0G)) return [roI3spqORKae(zxLMXn2b66I7, roI3spqORKae(ES5oEprVxulp(b'\xd1\xd5{\xb7\xb5\xa5:g\xe1-!\x14'), chr(0b110011 + 0o61) + chr(6251 - 6150) + chr(99) + chr(111) + chr(9016 - 8916) + chr(5366 - 5265))(chr(117) + chr(116) + chr(6228 - 6126) + '\x2d' + '\070'))(u3p9G8vwKWWH) for u3p9G8vwKWWH in FfKOThdpoDTb]
openvax/gtfparse
gtfparse/read_gtf.py
parse_gtf
def parse_gtf( filepath_or_buffer, chunksize=1024 * 1024, features=None, intern_columns=["seqname", "source", "strand", "frame"], fix_quotes_columns=["attribute"]): """ Parameters ---------- filepath_or_buffer : str or buffer object chunksize : int features : set or None Drop entries which aren't one of these features intern_columns : list These columns are short strings which should be interned fix_quotes_columns : list Most commonly the 'attribute' column which had broken quotes on some Ensembl release GTF files. """ if features is not None: features = set(features) dataframes = [] def parse_frame(s): if s == ".": return 0 else: return int(s) # GTF columns: # 1) seqname: str ("1", "X", "chrX", etc...) # 2) source : str # Different versions of GTF use second column as of: # (a) gene biotype # (b) transcript biotype # (c) the annotation source # See: https://www.biostars.org/p/120306/#120321 # 3) feature : str ("gene", "transcript", &c) # 4) start : int # 5) end : int # 6) score : float or "." # 7) strand : "+", "-", or "." # 8) frame : 0, 1, 2 or "." # 9) attribute : key-value pairs separated by semicolons # (see more complete description in docstring at top of file) chunk_iterator = pd.read_csv( filepath_or_buffer, sep="\t", comment="#", names=REQUIRED_COLUMNS, skipinitialspace=True, skip_blank_lines=True, error_bad_lines=True, warn_bad_lines=True, chunksize=chunksize, engine="c", dtype={ "start": np.int64, "end": np.int64, "score": np.float32, "seqname": str, }, na_values=".", converters={"frame": parse_frame}) dataframes = [] try: for df in chunk_iterator: for intern_column in intern_columns: df[intern_column] = [intern(str(s)) for s in df[intern_column]] # compare feature strings after interning if features is not None: df = df[df["feature"].isin(features)] for fix_quotes_column in fix_quotes_columns: # Catch mistaken semicolons by replacing "xyz;" with "xyz" # Required to do this since the Ensembl GTF for Ensembl # release 78 has mistakes such as: # gene_name = "PRAMEF6;" transcript_name = "PRAMEF6;-201" df[fix_quotes_column] = [ s.replace(';\"', '\"').replace(";-", "-") for s in df[fix_quotes_column] ] dataframes.append(df) except Exception as e: raise ParsingError(str(e)) df = pd.concat(dataframes) return df
python
def parse_gtf( filepath_or_buffer, chunksize=1024 * 1024, features=None, intern_columns=["seqname", "source", "strand", "frame"], fix_quotes_columns=["attribute"]): """ Parameters ---------- filepath_or_buffer : str or buffer object chunksize : int features : set or None Drop entries which aren't one of these features intern_columns : list These columns are short strings which should be interned fix_quotes_columns : list Most commonly the 'attribute' column which had broken quotes on some Ensembl release GTF files. """ if features is not None: features = set(features) dataframes = [] def parse_frame(s): if s == ".": return 0 else: return int(s) # GTF columns: # 1) seqname: str ("1", "X", "chrX", etc...) # 2) source : str # Different versions of GTF use second column as of: # (a) gene biotype # (b) transcript biotype # (c) the annotation source # See: https://www.biostars.org/p/120306/#120321 # 3) feature : str ("gene", "transcript", &c) # 4) start : int # 5) end : int # 6) score : float or "." # 7) strand : "+", "-", or "." # 8) frame : 0, 1, 2 or "." # 9) attribute : key-value pairs separated by semicolons # (see more complete description in docstring at top of file) chunk_iterator = pd.read_csv( filepath_or_buffer, sep="\t", comment="#", names=REQUIRED_COLUMNS, skipinitialspace=True, skip_blank_lines=True, error_bad_lines=True, warn_bad_lines=True, chunksize=chunksize, engine="c", dtype={ "start": np.int64, "end": np.int64, "score": np.float32, "seqname": str, }, na_values=".", converters={"frame": parse_frame}) dataframes = [] try: for df in chunk_iterator: for intern_column in intern_columns: df[intern_column] = [intern(str(s)) for s in df[intern_column]] # compare feature strings after interning if features is not None: df = df[df["feature"].isin(features)] for fix_quotes_column in fix_quotes_columns: # Catch mistaken semicolons by replacing "xyz;" with "xyz" # Required to do this since the Ensembl GTF for Ensembl # release 78 has mistakes such as: # gene_name = "PRAMEF6;" transcript_name = "PRAMEF6;-201" df[fix_quotes_column] = [ s.replace(';\"', '\"').replace(";-", "-") for s in df[fix_quotes_column] ] dataframes.append(df) except Exception as e: raise ParsingError(str(e)) df = pd.concat(dataframes) return df
[ "def", "parse_gtf", "(", "filepath_or_buffer", ",", "chunksize", "=", "1024", "*", "1024", ",", "features", "=", "None", ",", "intern_columns", "=", "[", "\"seqname\"", ",", "\"source\"", ",", "\"strand\"", ",", "\"frame\"", "]", ",", "fix_quotes_columns", "=", "[", "\"attribute\"", "]", ")", ":", "if", "features", "is", "not", "None", ":", "features", "=", "set", "(", "features", ")", "dataframes", "=", "[", "]", "def", "parse_frame", "(", "s", ")", ":", "if", "s", "==", "\".\"", ":", "return", "0", "else", ":", "return", "int", "(", "s", ")", "# GTF columns:", "# 1) seqname: str (\"1\", \"X\", \"chrX\", etc...)", "# 2) source : str", "# Different versions of GTF use second column as of:", "# (a) gene biotype", "# (b) transcript biotype", "# (c) the annotation source", "# See: https://www.biostars.org/p/120306/#120321", "# 3) feature : str (\"gene\", \"transcript\", &c)", "# 4) start : int", "# 5) end : int", "# 6) score : float or \".\"", "# 7) strand : \"+\", \"-\", or \".\"", "# 8) frame : 0, 1, 2 or \".\"", "# 9) attribute : key-value pairs separated by semicolons", "# (see more complete description in docstring at top of file)", "chunk_iterator", "=", "pd", ".", "read_csv", "(", "filepath_or_buffer", ",", "sep", "=", "\"\\t\"", ",", "comment", "=", "\"#\"", ",", "names", "=", "REQUIRED_COLUMNS", ",", "skipinitialspace", "=", "True", ",", "skip_blank_lines", "=", "True", ",", "error_bad_lines", "=", "True", ",", "warn_bad_lines", "=", "True", ",", "chunksize", "=", "chunksize", ",", "engine", "=", "\"c\"", ",", "dtype", "=", "{", "\"start\"", ":", "np", ".", "int64", ",", "\"end\"", ":", "np", ".", "int64", ",", "\"score\"", ":", "np", ".", "float32", ",", "\"seqname\"", ":", "str", ",", "}", ",", "na_values", "=", "\".\"", ",", "converters", "=", "{", "\"frame\"", ":", "parse_frame", "}", ")", "dataframes", "=", "[", "]", "try", ":", "for", "df", "in", "chunk_iterator", ":", "for", "intern_column", "in", "intern_columns", ":", "df", "[", "intern_column", "]", "=", "[", "intern", "(", "str", "(", "s", ")", ")", "for", "s", "in", "df", "[", "intern_column", "]", "]", "# compare feature strings after interning", "if", "features", "is", "not", "None", ":", "df", "=", "df", "[", "df", "[", "\"feature\"", "]", ".", "isin", "(", "features", ")", "]", "for", "fix_quotes_column", "in", "fix_quotes_columns", ":", "# Catch mistaken semicolons by replacing \"xyz;\" with \"xyz\"", "# Required to do this since the Ensembl GTF for Ensembl", "# release 78 has mistakes such as:", "# gene_name = \"PRAMEF6;\" transcript_name = \"PRAMEF6;-201\"", "df", "[", "fix_quotes_column", "]", "=", "[", "s", ".", "replace", "(", "';\\\"'", ",", "'\\\"'", ")", ".", "replace", "(", "\";-\"", ",", "\"-\"", ")", "for", "s", "in", "df", "[", "fix_quotes_column", "]", "]", "dataframes", ".", "append", "(", "df", ")", "except", "Exception", "as", "e", ":", "raise", "ParsingError", "(", "str", "(", "e", ")", ")", "df", "=", "pd", ".", "concat", "(", "dataframes", ")", "return", "df" ]
Parameters ---------- filepath_or_buffer : str or buffer object chunksize : int features : set or None Drop entries which aren't one of these features intern_columns : list These columns are short strings which should be interned fix_quotes_columns : list Most commonly the 'attribute' column which had broken quotes on some Ensembl release GTF files.
[ "Parameters", "----------" ]
c79cab0c2a5ac3d08de9f932fa29a56d334a712b
https://github.com/openvax/gtfparse/blob/c79cab0c2a5ac3d08de9f932fa29a56d334a712b/gtfparse/read_gtf.py#L32-L126
train
Parses a GTF file into a list of dictionaries.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h6aCn31dg,oxjHmqoBrCHG,GA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W,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1101111) + chr(49) + chr(49), 27899 - 27891), nzTpIcepk0o8(chr(2110 - 2062) + chr(111) + chr(2129 - 2080), 18543 - 18535), nzTpIcepk0o8(chr(48) + chr(0b1000001 + 0o56) + chr(54) + chr(48), 0o10), nzTpIcepk0o8(chr(0b10111 + 0o31) + '\x6f' + '\x31' + chr(0b110111) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(0b1011010 + 0o25) + chr(0b11111 + 0o22) + chr(739 - 690) + '\060', 60238 - 60230), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b100001 + 0o116) + '\063' + '\066' + chr(50), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\x33' + chr(923 - 874) + chr(1257 - 1209), ord("\x08")), nzTpIcepk0o8(chr(1610 - 1562) + '\157' + chr(53) + chr(0b10011 + 0o36), 0b1000), nzTpIcepk0o8(chr(1531 - 1483) + '\x6f' + chr(0b100010 + 0o21) + chr(48) + '\x32', 751 - 743), nzTpIcepk0o8(chr(0b110000) + chr(0b100010 + 0o115) + chr(671 - 621) + '\064' + chr(0b110101), 20879 - 20871), nzTpIcepk0o8('\060' + chr(0b11110 + 0o121) + chr(0b110001) + chr(0b110010) + chr(1581 - 1526), 25368 - 25360), nzTpIcepk0o8('\x30' + chr(1594 - 1483) + '\x32' + chr(2176 - 2128) + chr(0b1011 + 0o54), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x33' + '\060' + '\x32', 8), nzTpIcepk0o8(chr(48) + '\x6f' + chr(2290 - 2240) + chr(1007 - 954) + chr(2999 - 2944), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(5922 - 5811) + '\061' + chr(0b101001 + 0o12), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b0 + 0o157) + chr(453 - 398) + chr(1724 - 1669), 27192 - 27184), nzTpIcepk0o8(chr(314 - 266) + chr(0b1100010 + 0o15) + chr(0b110011) + chr(0b101010 + 0o7) + '\066', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(49) + chr(0b110001) + chr(0b10 + 0o57), 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\063' + chr(0b1111 + 0o41) + '\x37', 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\x34' + '\x37', 0b1000), nzTpIcepk0o8(chr(1575 - 1527) + '\x6f' + chr(0b11011 + 0o27) + chr(0b110101) + chr(0b100110 + 0o15), ord("\x08")), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(111) + chr(0b110011) + chr(50) + chr(0b110100), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\061' + chr(50) + chr(52), 0b1000), nzTpIcepk0o8('\x30' + chr(3333 - 3222) + chr(1373 - 1322) + chr(50) + '\x33', 3089 - 3081), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x32' + chr(0b111 + 0o54) + chr(0b111 + 0o51), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(3839 - 3728) + chr(2023 - 1972) + '\065' + '\060', 40668 - 40660), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b11100 + 0o25) + chr(54) + '\065', 0o10), nzTpIcepk0o8(chr(0b10000 + 0o40) + '\157' + chr(0b110001) + '\x35', 1201 - 1193), nzTpIcepk0o8(chr(48) + chr(111) + chr(1370 - 1319) + chr(0b110101) + chr(0b110010), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(2039 - 1984), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31' + chr(53) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(53) + chr(0b110000), 7008 - 7000), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(111) + chr(0b110010) + chr(0b110101) + chr(854 - 806), 0o10), nzTpIcepk0o8(chr(0b1010 + 0o46) + '\x6f' + chr(0b1001 + 0o50) + '\065' + chr(0b10110 + 0o36), 8), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(2432 - 2321) + chr(50) + chr(48) + '\x30', 0b1000), nzTpIcepk0o8(chr(176 - 128) + '\157' + chr(188 - 137) + chr(2040 - 1989) + chr(0b1110 + 0o44), 0b1000), nzTpIcepk0o8('\060' + chr(0b1000100 + 0o53) + chr(0b100110 + 0o13) + chr(50) + '\066', 47127 - 47119), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(2383 - 2334) + chr(0b110011), 57662 - 57654), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(11895 - 11784) + chr(0b110011) + chr(2593 - 2538) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(1623 - 1575) + chr(111) + '\064' + chr(53), 20520 - 20512)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(0b1101010 + 0o5) + chr(0b110011 + 0o2) + chr(0b110000), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b"'"), '\x64' + chr(101) + chr(2546 - 2447) + chr(0b1101111) + chr(3938 - 3838) + chr(0b1100101))(chr(117) + '\x74' + '\146' + chr(0b101101) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def ct0LY4d4edJc(KHLEN6U1KOr3, QqkiMOFRml3h=nzTpIcepk0o8(chr(1890 - 1842) + chr(0b1101111) + chr(0b110010) + '\x30' + chr(0b110000) + chr(48), 58777 - 58769) * nzTpIcepk0o8(chr(1343 - 1295) + chr(0b1101111) + '\x32' + '\060' + chr(48) + '\x30', 8), azxuCKSXk6dv=None, TPSAFeBbcDJq=[roI3spqORKae(ES5oEprVxulp(b'zdA\x16)\x9f\xad'), '\144' + chr(0b1100101) + chr(1602 - 1503) + chr(0b101101 + 0o102) + chr(1882 - 1782) + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'znE\n+\x97'), chr(0b11010 + 0o112) + chr(0b1100101) + chr(99) + '\x6f' + '\x64' + chr(0b111000 + 0o55))(chr(0b1110101) + chr(0b11100 + 0o130) + '\146' + chr(0b101101) + chr(0b101001 + 0o17)), roI3spqORKae(ES5oEprVxulp(b'zuB\x19&\x96'), chr(100) + '\x65' + '\143' + chr(0b11011 + 0o124) + '\x64' + chr(101))(chr(117) + '\164' + chr(0b1100110) + chr(188 - 143) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'osQ\x15-'), chr(100) + '\x65' + chr(99) + chr(3096 - 2985) + chr(0b1011001 + 0o13) + '\145')('\x75' + '\164' + '\x66' + chr(1921 - 1876) + chr(56))], FGiDXtLQVWyy=[roI3spqORKae(ES5oEprVxulp(b'huD\n!\x90\xbd]\xa7'), chr(1394 - 1294) + chr(0b1100101) + chr(99) + '\157' + chr(3003 - 2903) + chr(101))('\x75' + '\x74' + chr(3265 - 3163) + chr(45) + chr(0b111000))]): if azxuCKSXk6dv is not None: azxuCKSXk6dv = Bvi71nNyvlqO(azxuCKSXk6dv) EnpLkd2aiqG2 = [] def WgdDnaXu6gC6(PmE5_h409JAA): if PmE5_h409JAA == roI3spqORKae(ES5oEprVxulp(b"'"), chr(0b1100100) + '\145' + '\x63' + '\157' + chr(0b111000 + 0o54) + '\145')(chr(2004 - 1887) + chr(0b10 + 0o162) + chr(0b1100110) + '\055' + chr(0b111000)): return nzTpIcepk0o8(chr(2149 - 2101) + chr(111) + '\060', 48719 - 48711) else: return nzTpIcepk0o8(PmE5_h409JAA) cqSJY_Tptkbu = HLKt4sa1j9hm.read_csv(KHLEN6U1KOr3, sep=roI3spqORKae(ES5oEprVxulp(b'\x00'), '\x64' + chr(101) + chr(3156 - 3057) + chr(0b1101111) + '\144' + '\x65')(chr(1344 - 1227) + chr(6708 - 6592) + chr(0b1100101 + 0o1) + chr(0b1000 + 0o45) + chr(643 - 587)), comment=roI3spqORKae(ES5oEprVxulp(b'*'), chr(6625 - 6525) + chr(0b1100101) + chr(0b1100011) + '\157' + '\144' + chr(101))('\165' + chr(0b1110100) + '\146' + chr(1565 - 1520) + chr(2149 - 2093)), names=nwd9EFi_8hZV, skipinitialspace=nzTpIcepk0o8(chr(48) + chr(0b1000110 + 0o51) + chr(0b110001), 8), skip_blank_lines=nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001), 8), error_bad_lines=nzTpIcepk0o8(chr(48) + chr(0b1001101 + 0o42) + chr(49), 8), warn_bad_lines=nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(0b1101111) + '\x31', 8), chunksize=QqkiMOFRml3h, engine=roI3spqORKae(ES5oEprVxulp(b'j'), '\x64' + chr(0b1100101) + chr(99) + chr(2222 - 2111) + chr(0b1100100) + chr(0b101110 + 0o67))(chr(0b1110101) + chr(116) + chr(0b1100110) + '\x2d' + '\x38'), dtype={roI3spqORKae(ES5oEprVxulp(b'zuQ\n<'), '\144' + '\x65' + '\x63' + chr(111) + chr(0b1100100) + chr(1296 - 1195))(chr(12650 - 12533) + chr(116) + chr(1001 - 899) + chr(0b101101) + '\070'): nDF4gVNx0u9Q.int64, roI3spqORKae(ES5oEprVxulp(b'loT'), '\144' + chr(0b1100101) + chr(99) + '\x6f' + chr(100) + '\x65')('\x75' + chr(0b10110 + 0o136) + chr(102) + chr(0b101101) + chr(358 - 302)): nDF4gVNx0u9Q.int64, roI3spqORKae(ES5oEprVxulp(b'zb_\n-'), chr(4162 - 4062) + chr(8361 - 8260) + chr(0b1100 + 0o127) + '\157' + '\144' + chr(4132 - 4031))('\x75' + '\164' + chr(102) + chr(0b101101) + '\x38'): nDF4gVNx0u9Q.float32, roI3spqORKae(ES5oEprVxulp(b'zdA\x16)\x9f\xad'), chr(8250 - 8150) + chr(5364 - 5263) + '\143' + chr(9778 - 9667) + '\x64' + chr(3681 - 3580))(chr(0b1110101) + chr(0b1110100) + chr(3467 - 3365) + '\x2d' + chr(0b1011 + 0o55)): N9zlRy29S1SS}, na_values=roI3spqORKae(ES5oEprVxulp(b"'"), '\144' + chr(2988 - 2887) + chr(0b1100011) + chr(6392 - 6281) + '\144' + chr(4360 - 4259))(chr(0b111111 + 0o66) + chr(4534 - 4418) + '\146' + chr(553 - 508) + chr(56)), converters={roI3spqORKae(ES5oEprVxulp(b'osQ\x15-'), chr(0b110000 + 0o64) + chr(6617 - 6516) + '\x63' + chr(111) + chr(100) + '\x65')(chr(0b1110101) + chr(0b1011001 + 0o33) + chr(102) + chr(0b11000 + 0o25) + '\070'): WgdDnaXu6gC6}) EnpLkd2aiqG2 = [] try: for jpOn8DNZxbbx in cqSJY_Tptkbu: for As5OoGHcHpac in TPSAFeBbcDJq: jpOn8DNZxbbx[As5OoGHcHpac] = [gkjFzwcPG8IJ(N9zlRy29S1SS(PmE5_h409JAA)) for PmE5_h409JAA in jpOn8DNZxbbx[As5OoGHcHpac]] if azxuCKSXk6dv is not None: jpOn8DNZxbbx = jpOn8DNZxbbx[jpOn8DNZxbbx[roI3spqORKae(ES5oEprVxulp(b'odQ\x0c=\x80\xad'), chr(100) + '\x65' + '\143' + chr(111) + '\x64' + '\x65')('\x75' + chr(4485 - 4369) + '\146' + chr(1086 - 1041) + '\x38')].isin(azxuCKSXk6dv)] for FuwDnBtIWOLx in FGiDXtLQVWyy: jpOn8DNZxbbx[FuwDnBtIWOLx] = [PmE5_h409JAA.replace(roI3spqORKae(ES5oEprVxulp(b'2#'), chr(100) + chr(0b101001 + 0o74) + chr(5959 - 5860) + chr(5703 - 5592) + chr(100) + '\145')(chr(0b1110101) + chr(116) + chr(0b100111 + 0o77) + '\x2d' + chr(56)), roI3spqORKae(ES5oEprVxulp(b'+'), chr(100) + chr(6927 - 6826) + chr(99) + chr(2005 - 1894) + chr(0b1100010 + 0o2) + chr(101))('\x75' + chr(0b110101 + 0o77) + chr(102) + chr(45) + chr(0b100011 + 0o25))).E91dbqOZXBpJ(roI3spqORKae(ES5oEprVxulp(b'2,'), chr(0b11110 + 0o106) + chr(0b1011000 + 0o15) + chr(0b101011 + 0o70) + chr(111) + '\144' + chr(0b10101 + 0o120))(chr(117) + '\164' + '\146' + chr(0b101001 + 0o4) + chr(56)), roI3spqORKae(ES5oEprVxulp(b'$'), chr(4895 - 4795) + chr(0b1100101) + '\143' + '\x6f' + '\144' + chr(0b1100010 + 0o3))(chr(7385 - 7268) + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(0b11110 + 0o32))) for PmE5_h409JAA in jpOn8DNZxbbx[FuwDnBtIWOLx]] roI3spqORKae(EnpLkd2aiqG2, roI3spqORKae(ES5oEprVxulp(b'AUcL0\x95\x8fF\xa8\xca\x02\xb2'), chr(5774 - 5674) + '\145' + chr(0b1010011 + 0o20) + chr(4621 - 4510) + '\x64' + chr(0b110 + 0o137))(chr(0b1110101) + chr(0b1110100) + chr(8950 - 8848) + chr(0b101101) + '\070'))(jpOn8DNZxbbx) except zfo2Sgkz3IVJ as wgf0sgcu_xPL: raise qYVrOpb3W1HV(N9zlRy29S1SS(wgf0sgcu_xPL)) jpOn8DNZxbbx = HLKt4sa1j9hm.concat(EnpLkd2aiqG2) return jpOn8DNZxbbx
openvax/gtfparse
gtfparse/read_gtf.py
parse_gtf_and_expand_attributes
def parse_gtf_and_expand_attributes( filepath_or_buffer, chunksize=1024 * 1024, restrict_attribute_columns=None, features=None): """ Parse lines into column->values dictionary and then expand the 'attribute' column into multiple columns. This expansion happens by replacing strings of semi-colon separated key-value values in the 'attribute' column with one column per distinct key, with a list of values for each row (using None for rows where key didn't occur). Parameters ---------- filepath_or_buffer : str or buffer object chunksize : int restrict_attribute_columns : list/set of str or None If given, then only usese attribute columns. features : set or None Ignore entries which don't correspond to one of the supplied features """ result = parse_gtf( filepath_or_buffer, chunksize=chunksize, features=features) attribute_values = result["attribute"] del result["attribute"] for column_name, values in expand_attribute_strings( attribute_values, usecols=restrict_attribute_columns).items(): result[column_name] = values return result
python
def parse_gtf_and_expand_attributes( filepath_or_buffer, chunksize=1024 * 1024, restrict_attribute_columns=None, features=None): """ Parse lines into column->values dictionary and then expand the 'attribute' column into multiple columns. This expansion happens by replacing strings of semi-colon separated key-value values in the 'attribute' column with one column per distinct key, with a list of values for each row (using None for rows where key didn't occur). Parameters ---------- filepath_or_buffer : str or buffer object chunksize : int restrict_attribute_columns : list/set of str or None If given, then only usese attribute columns. features : set or None Ignore entries which don't correspond to one of the supplied features """ result = parse_gtf( filepath_or_buffer, chunksize=chunksize, features=features) attribute_values = result["attribute"] del result["attribute"] for column_name, values in expand_attribute_strings( attribute_values, usecols=restrict_attribute_columns).items(): result[column_name] = values return result
[ "def", "parse_gtf_and_expand_attributes", "(", "filepath_or_buffer", ",", "chunksize", "=", "1024", "*", "1024", ",", "restrict_attribute_columns", "=", "None", ",", "features", "=", "None", ")", ":", "result", "=", "parse_gtf", "(", "filepath_or_buffer", ",", "chunksize", "=", "chunksize", ",", "features", "=", "features", ")", "attribute_values", "=", "result", "[", "\"attribute\"", "]", "del", "result", "[", "\"attribute\"", "]", "for", "column_name", ",", "values", "in", "expand_attribute_strings", "(", "attribute_values", ",", "usecols", "=", "restrict_attribute_columns", ")", ".", "items", "(", ")", ":", "result", "[", "column_name", "]", "=", "values", "return", "result" ]
Parse lines into column->values dictionary and then expand the 'attribute' column into multiple columns. This expansion happens by replacing strings of semi-colon separated key-value values in the 'attribute' column with one column per distinct key, with a list of values for each row (using None for rows where key didn't occur). Parameters ---------- filepath_or_buffer : str or buffer object chunksize : int restrict_attribute_columns : list/set of str or None If given, then only usese attribute columns. features : set or None Ignore entries which don't correspond to one of the supplied features
[ "Parse", "lines", "into", "column", "-", ">", "values", "dictionary", "and", "then", "expand", "the", "attribute", "column", "into", "multiple", "columns", ".", "This", "expansion", "happens", "by", "replacing", "strings", "of", "semi", "-", "colon", "separated", "key", "-", "value", "values", "in", "the", "attribute", "column", "with", "one", "column", "per", "distinct", "key", "with", "a", "list", "of", "values", "for", "each", "row", "(", "using", "None", "for", "rows", "where", "key", "didn", "t", "occur", ")", "." ]
c79cab0c2a5ac3d08de9f932fa29a56d334a712b
https://github.com/openvax/gtfparse/blob/c79cab0c2a5ac3d08de9f932fa29a56d334a712b/gtfparse/read_gtf.py#L129-L162
train
Parses a GTF file into column - > values dictionary and then expands the attribute values into multiple columns.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZR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oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + '\157' + chr(0b1 + 0o66), ord("\x08")), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(7249 - 7138) + chr(0b100010 + 0o20) + chr(51) + chr(0b110100), 0o10), nzTpIcepk0o8('\060' + chr(8904 - 8793) + chr(2146 - 2097) + chr(0b110101) + '\x34', 0o10), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b1010001 + 0o36) + chr(0b110011) + chr(55) + chr(0b110110), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(53) + chr(49), 0o10), nzTpIcepk0o8(chr(48) + chr(9188 - 9077) + '\x31' + '\065', 0o10), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(111) + chr(0b110001) + chr(51) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(49) + chr(127 - 76) + '\060', 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b10111 + 0o32) + chr(386 - 333) + '\x31', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b10111 + 0o34) + chr(0b110110) + '\065', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b100101 + 0o14) + '\064' + '\x31', 0o10), nzTpIcepk0o8('\x30' + chr(7096 - 6985) + '\x32' + chr(0b11011 + 0o27) + chr(0b110010), 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\062', ord("\x08")), nzTpIcepk0o8(chr(2195 - 2147) + chr(0b1101111) + chr(0b111 + 0o53) + '\x34' + chr(491 - 441), 59704 - 59696), nzTpIcepk0o8('\x30' + chr(2712 - 2601) + chr(0b11101 + 0o24) + '\064' + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b11101 + 0o25) + chr(55) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110011) + '\063' + '\x30', 0b1000), nzTpIcepk0o8(chr(1717 - 1669) + '\157' + chr(0b100000 + 0o21) + chr(48), 0b1000), nzTpIcepk0o8('\x30' + chr(833 - 722) + '\061' + chr(52) + '\x30', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(50) + chr(0b110001) + '\x36', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(358 - 308) + chr(1910 - 1858) + chr(341 - 289), 0o10), nzTpIcepk0o8('\060' + chr(5894 - 5783) + chr(1083 - 1033) + chr(50) + '\063', 0o10), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(0b1101111) + '\x34' + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1011100 + 0o23) + chr(1347 - 1298) + chr(444 - 393) + chr(49), 0o10), nzTpIcepk0o8(chr(282 - 234) + chr(111) + chr(0b11110 + 0o23) + chr(0b110011) + '\x35', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(2363 - 2309), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001 + 0o5) + '\064', 48250 - 48242), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110010) + '\067' + chr(51), 8), nzTpIcepk0o8(chr(2230 - 2182) + '\157' + chr(50) + chr(49) + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\061' + '\x36' + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(0b1101111) + chr(0b10011 + 0o37) + '\x36' + '\064', 0o10), nzTpIcepk0o8(chr(1811 - 1763) + chr(111) + '\063' + '\x32' + chr(0b11001 + 0o32), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(0b11 + 0o56) + chr(602 - 554), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(51) + chr(0b110010) + chr(0b1010 + 0o46), 46564 - 46556), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + chr(1270 - 1222), 39094 - 39086), nzTpIcepk0o8('\060' + chr(111) + chr(0b110010) + '\062' + chr(55), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b111111 + 0o60) + chr(0b10100 + 0o35) + '\x30' + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110000 + 0o2) + chr(53) + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(1856 - 1808) + chr(0b1101010 + 0o5) + chr(51) + chr(54) + chr(1490 - 1442), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(51) + chr(0b110010) + '\060', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + '\x6f' + '\x35' + chr(229 - 181), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b')'), chr(100) + chr(0b1100101) + chr(99) + chr(111) + chr(0b1100100) + chr(0b1000010 + 0o43))(chr(0b1110101) + chr(13069 - 12953) + chr(5148 - 5046) + chr(567 - 522) + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Ar83dcmJiN1E(KHLEN6U1KOr3, QqkiMOFRml3h=nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(48) + chr(48) + '\x30', 14941 - 14933) * nzTpIcepk0o8(chr(48) + '\157' + chr(0b110010) + chr(1512 - 1464) + '\x30' + chr(170 - 122), 8), Ym0rWQlCVSL9=None, azxuCKSXk6dv=None): POx95m7SPOVy = ct0LY4d4edJc(KHLEN6U1KOr3, chunksize=QqkiMOFRml3h, features=azxuCKSXk6dv) xL16xCEZDjn0 = POx95m7SPOVy[roI3spqORKae(ES5oEprVxulp(b'f\xe8\x18\x8c@o),\x0c'), '\144' + '\145' + '\143' + chr(0b1101111) + chr(0b1100100) + chr(0b111010 + 0o53))(chr(0b1110101) + chr(0b1010100 + 0o40) + chr(102) + chr(0b101101) + chr(1100 - 1044))] del POx95m7SPOVy[roI3spqORKae(ES5oEprVxulp(b'f\xe8\x18\x8c@o),\x0c'), '\144' + '\145' + chr(0b101110 + 0o65) + chr(111) + chr(100) + chr(101))('\165' + chr(0b1110100) + chr(0b1100 + 0o132) + chr(0b100111 + 0o6) + chr(2217 - 2161))] for (u1KUWDQCF1xR, CsodZJH6x9Tx) in roI3spqORKae(dIE00nfDqXj2(xL16xCEZDjn0, usecols=Ym0rWQlCVSL9), roI3spqORKae(ES5oEprVxulp(b'^\xc3\x02\xb0lw\x14lZ\x839\xfb'), '\144' + chr(101) + chr(99) + '\x6f' + '\x64' + '\145')('\165' + '\x74' + chr(0b1100110) + chr(45) + chr(0b100110 + 0o22)))(): POx95m7SPOVy[u1KUWDQCF1xR] = CsodZJH6x9Tx return POx95m7SPOVy
openvax/gtfparse
gtfparse/read_gtf.py
read_gtf
def read_gtf( filepath_or_buffer, expand_attribute_column=True, infer_biotype_column=False, column_converters={}, usecols=None, features=None, chunksize=1024 * 1024): """ Parse a GTF into a dictionary mapping column names to sequences of values. Parameters ---------- filepath_or_buffer : str or buffer object Path to GTF file (may be gzip compressed) or buffer object such as StringIO expand_attribute_column : bool Replace strings of semi-colon separated key-value values in the 'attribute' column with one column per distinct key, with a list of values for each row (using None for rows where key didn't occur). infer_biotype_column : bool Due to the annoying ambiguity of the second GTF column across multiple Ensembl releases, figure out if an older GTF's source column is actually the gene_biotype or transcript_biotype. column_converters : dict, optional Dictionary mapping column names to conversion functions. Will replace empty strings with None and otherwise passes them to given conversion function. usecols : list of str or None Restrict which columns are loaded to the give set. If None, then load all columns. features : set of str or None Drop rows which aren't one of the features in the supplied set chunksize : int """ if isinstance(filepath_or_buffer, string_types) and not exists(filepath_or_buffer): raise ValueError("GTF file does not exist: %s" % filepath_or_buffer) if expand_attribute_column: result_df = parse_gtf_and_expand_attributes( filepath_or_buffer, chunksize=chunksize, restrict_attribute_columns=usecols) else: result_df = parse_gtf(result_df, features=features) for column_name, column_type in list(column_converters.items()): result_df[column_name] = [ column_type(string_value) if len(string_value) > 0 else None for string_value in result_df[column_name] ] # Hackishly infer whether the values in the 'source' column of this GTF # are actually representing a biotype by checking for the most common # gene_biotype and transcript_biotype value 'protein_coding' if infer_biotype_column: unique_source_values = set(result_df["source"]) if "protein_coding" in unique_source_values: column_names = set(result_df.columns) # Disambiguate between the two biotypes by checking if # gene_biotype is already present in another column. If it is, # the 2nd column is the transcript_biotype (otherwise, it's the # gene_biotype) if "gene_biotype" not in column_names: logging.info("Using column 'source' to replace missing 'gene_biotype'") result_df["gene_biotype"] = result_df["source"] if "transcript_biotype" not in column_names: logging.info("Using column 'source' to replace missing 'transcript_biotype'") result_df["transcript_biotype"] = result_df["source"] if usecols is not None: column_names = set(result_df.columns) valid_columns = [c for c in usecols if c in column_names] result_df = result_df[valid_columns] return result_df
python
def read_gtf( filepath_or_buffer, expand_attribute_column=True, infer_biotype_column=False, column_converters={}, usecols=None, features=None, chunksize=1024 * 1024): """ Parse a GTF into a dictionary mapping column names to sequences of values. Parameters ---------- filepath_or_buffer : str or buffer object Path to GTF file (may be gzip compressed) or buffer object such as StringIO expand_attribute_column : bool Replace strings of semi-colon separated key-value values in the 'attribute' column with one column per distinct key, with a list of values for each row (using None for rows where key didn't occur). infer_biotype_column : bool Due to the annoying ambiguity of the second GTF column across multiple Ensembl releases, figure out if an older GTF's source column is actually the gene_biotype or transcript_biotype. column_converters : dict, optional Dictionary mapping column names to conversion functions. Will replace empty strings with None and otherwise passes them to given conversion function. usecols : list of str or None Restrict which columns are loaded to the give set. If None, then load all columns. features : set of str or None Drop rows which aren't one of the features in the supplied set chunksize : int """ if isinstance(filepath_or_buffer, string_types) and not exists(filepath_or_buffer): raise ValueError("GTF file does not exist: %s" % filepath_or_buffer) if expand_attribute_column: result_df = parse_gtf_and_expand_attributes( filepath_or_buffer, chunksize=chunksize, restrict_attribute_columns=usecols) else: result_df = parse_gtf(result_df, features=features) for column_name, column_type in list(column_converters.items()): result_df[column_name] = [ column_type(string_value) if len(string_value) > 0 else None for string_value in result_df[column_name] ] # Hackishly infer whether the values in the 'source' column of this GTF # are actually representing a biotype by checking for the most common # gene_biotype and transcript_biotype value 'protein_coding' if infer_biotype_column: unique_source_values = set(result_df["source"]) if "protein_coding" in unique_source_values: column_names = set(result_df.columns) # Disambiguate between the two biotypes by checking if # gene_biotype is already present in another column. If it is, # the 2nd column is the transcript_biotype (otherwise, it's the # gene_biotype) if "gene_biotype" not in column_names: logging.info("Using column 'source' to replace missing 'gene_biotype'") result_df["gene_biotype"] = result_df["source"] if "transcript_biotype" not in column_names: logging.info("Using column 'source' to replace missing 'transcript_biotype'") result_df["transcript_biotype"] = result_df["source"] if usecols is not None: column_names = set(result_df.columns) valid_columns = [c for c in usecols if c in column_names] result_df = result_df[valid_columns] return result_df
[ "def", "read_gtf", "(", "filepath_or_buffer", ",", "expand_attribute_column", "=", "True", ",", "infer_biotype_column", "=", "False", ",", "column_converters", "=", "{", "}", ",", "usecols", "=", "None", ",", "features", "=", "None", ",", "chunksize", "=", "1024", "*", "1024", ")", ":", "if", "isinstance", "(", "filepath_or_buffer", ",", "string_types", ")", "and", "not", "exists", "(", "filepath_or_buffer", ")", ":", "raise", "ValueError", "(", "\"GTF file does not exist: %s\"", "%", "filepath_or_buffer", ")", "if", "expand_attribute_column", ":", "result_df", "=", "parse_gtf_and_expand_attributes", "(", "filepath_or_buffer", ",", "chunksize", "=", "chunksize", ",", "restrict_attribute_columns", "=", "usecols", ")", "else", ":", "result_df", "=", "parse_gtf", "(", "result_df", ",", "features", "=", "features", ")", "for", "column_name", ",", "column_type", "in", "list", "(", "column_converters", ".", "items", "(", ")", ")", ":", "result_df", "[", "column_name", "]", "=", "[", "column_type", "(", "string_value", ")", "if", "len", "(", "string_value", ")", ">", "0", "else", "None", "for", "string_value", "in", "result_df", "[", "column_name", "]", "]", "# Hackishly infer whether the values in the 'source' column of this GTF", "# are actually representing a biotype by checking for the most common", "# gene_biotype and transcript_biotype value 'protein_coding'", "if", "infer_biotype_column", ":", "unique_source_values", "=", "set", "(", "result_df", "[", "\"source\"", "]", ")", "if", "\"protein_coding\"", "in", "unique_source_values", ":", "column_names", "=", "set", "(", "result_df", ".", "columns", ")", "# Disambiguate between the two biotypes by checking if", "# gene_biotype is already present in another column. If it is,", "# the 2nd column is the transcript_biotype (otherwise, it's the", "# gene_biotype)", "if", "\"gene_biotype\"", "not", "in", "column_names", ":", "logging", ".", "info", "(", "\"Using column 'source' to replace missing 'gene_biotype'\"", ")", "result_df", "[", "\"gene_biotype\"", "]", "=", "result_df", "[", "\"source\"", "]", "if", "\"transcript_biotype\"", "not", "in", "column_names", ":", "logging", ".", "info", "(", "\"Using column 'source' to replace missing 'transcript_biotype'\"", ")", "result_df", "[", "\"transcript_biotype\"", "]", "=", "result_df", "[", "\"source\"", "]", "if", "usecols", "is", "not", "None", ":", "column_names", "=", "set", "(", "result_df", ".", "columns", ")", "valid_columns", "=", "[", "c", "for", "c", "in", "usecols", "if", "c", "in", "column_names", "]", "result_df", "=", "result_df", "[", "valid_columns", "]", "return", "result_df" ]
Parse a GTF into a dictionary mapping column names to sequences of values. Parameters ---------- filepath_or_buffer : str or buffer object Path to GTF file (may be gzip compressed) or buffer object such as StringIO expand_attribute_column : bool Replace strings of semi-colon separated key-value values in the 'attribute' column with one column per distinct key, with a list of values for each row (using None for rows where key didn't occur). infer_biotype_column : bool Due to the annoying ambiguity of the second GTF column across multiple Ensembl releases, figure out if an older GTF's source column is actually the gene_biotype or transcript_biotype. column_converters : dict, optional Dictionary mapping column names to conversion functions. Will replace empty strings with None and otherwise passes them to given conversion function. usecols : list of str or None Restrict which columns are loaded to the give set. If None, then load all columns. features : set of str or None Drop rows which aren't one of the features in the supplied set chunksize : int
[ "Parse", "a", "GTF", "into", "a", "dictionary", "mapping", "column", "names", "to", "sequences", "of", "values", "." ]
c79cab0c2a5ac3d08de9f932fa29a56d334a712b
https://github.com/openvax/gtfparse/blob/c79cab0c2a5ac3d08de9f932fa29a56d334a712b/gtfparse/read_gtf.py#L165-L247
train
Parses a GTF file into a dictionary mapping column names to sequences of values.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h6aCn31dg,oxjHmqoBrCHG,GA4ANb_Tki5v,LdFlJR2ssk3y,gCu7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pTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(0b1101100 + 0o3) + chr(51) + chr(48) + '\x33', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\061' + chr(0b110111) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(1311 - 1263) + '\x6f' + chr(1698 - 1649) + '\063' + chr(0b11000 + 0o31), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b110101) + chr(0b110 + 0o55), 53318 - 53310), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(111) + '\062' + '\064' + chr(0b100010 + 0o23), 30775 - 30767), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(50) + chr(2754 - 2699) + chr(48), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\x32' + chr(55) + chr(2297 - 2242), 51674 - 51666), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110100 + 0o3), 60209 - 60201), nzTpIcepk0o8('\060' + chr(111) + '\x32' + chr(533 - 481) + '\066', 0o10), nzTpIcepk0o8('\060' + '\157' + '\061' + '\064' + chr(0b110110), 0o10), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(111) + chr(50) + '\x31' + chr(0b110100), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b100011 + 0o16) + chr(55) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(0b1100001 + 0o16) + '\061' + chr(0b110111) + chr(50), 8), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(0b1011 + 0o144) + '\x36' + '\066', 0o10), nzTpIcepk0o8(chr(78 - 30) + '\x6f' + chr(51) + chr(0b11010 + 0o26) + chr(0b10100 + 0o36), 22302 - 22294), nzTpIcepk0o8(chr(306 - 258) + '\x6f' + chr(0b110001) + '\x30' + chr(1174 - 1121), 0b1000), nzTpIcepk0o8(chr(0b101001 + 0o7) + '\x6f' + '\x33' + chr(0b110110) + '\063', 0b1000), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(4301 - 4190) + chr(51) + chr(55) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(904 - 855) + '\062' + chr(2872 - 2818), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(0b101001 + 0o16) + chr(2234 - 2182), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(499 - 449) + '\x34' + chr(0b1001 + 0o54), 8), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1101111) + chr(2200 - 2150) + chr(0b10100 + 0o37) + chr(54), 36700 - 36692), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + chr(50) + chr(0b11001 + 0o27), 0o10), nzTpIcepk0o8('\060' + chr(6279 - 6168) + '\x32' + chr(51) + chr(0b110110), 8), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b1010 + 0o50) + chr(55) + '\x36', 0o10), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b1101111) + '\062' + chr(2419 - 2367), 13832 - 13824), nzTpIcepk0o8(chr(0b101 + 0o53) + '\x6f' + chr(0b110011) + chr(0b110011) + '\065', 0o10), nzTpIcepk0o8('\060' + chr(4170 - 4059) + chr(0b110001) + '\x35' + chr(117 - 68), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(49) + chr(54) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(0b1101110 + 0o1) + chr(0b110101) + chr(0b1 + 0o64), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\x37' + chr(0b101011 + 0o13), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110010 + 0o0) + chr(49) + '\x34', 8), nzTpIcepk0o8(chr(48) + '\x6f' + chr(49) + '\x32' + '\x34', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110011) + chr(0b110101) + '\067', 0b1000), nzTpIcepk0o8('\x30' + chr(11031 - 10920) + '\063' + chr(860 - 811) + chr(1482 - 1432), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(8972 - 8861) + chr(0b110100 + 0o0) + '\065', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(50) + chr(0b110110) + chr(50), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(49) + chr(53), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b11 + 0o154) + '\x31' + chr(1773 - 1723) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b100111 + 0o14) + '\064' + chr(0b10 + 0o65), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(188 - 140) + '\x6f' + '\x35' + chr(48), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xed'), '\x64' + chr(0b10010 + 0o123) + '\x63' + chr(111) + chr(8724 - 8624) + chr(0b1000000 + 0o45))(chr(117) + chr(0b100 + 0o160) + '\x66' + '\x2d' + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def vlriGSJFjSns(KHLEN6U1KOr3, RO9TiMDoRoiE=nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b1101111) + chr(0b101101 + 0o4), ord("\x08")), RbJKMcSakDeW=nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110000), ord("\x08")), tiNjoKNC8z7J={}, DyuBQoAdFfHM=None, azxuCKSXk6dv=None, QqkiMOFRml3h=nzTpIcepk0o8(chr(1041 - 993) + '\x6f' + chr(0b110010) + '\x30' + chr(0b110000) + chr(48), 0o10) * nzTpIcepk0o8(chr(2297 - 2249) + chr(8452 - 8341) + chr(0b100110 + 0o14) + '\060' + chr(528 - 480) + chr(1086 - 1038), 8)): if suIjIS24Zkqw(KHLEN6U1KOr3, Q9V5WOaImAwl) and (not zSIynPuEvlQ4(KHLEN6U1KOr3)): raise WbNHlDKpyPtQ(roI3spqORKae(ES5oEprVxulp(b'\x84.\x1f\x0b\xc3\xd1\xd3b\x86\x02\xe3\x1a\t\x16\xac*\x87\xdf3\x04\xcc\xed\xe4\xa4\x9e1\xae'), '\144' + '\x65' + chr(0b11110 + 0o105) + '\x6f' + chr(5772 - 5672) + '\x65')(chr(226 - 109) + chr(0b110010 + 0o102) + '\x66' + chr(0b101101) + chr(0b111000)) % KHLEN6U1KOr3) if RO9TiMDoRoiE: XNMnDY_b8CuB = Ar83dcmJiN1E(KHLEN6U1KOr3, chunksize=QqkiMOFRml3h, restrict_attribute_columns=DyuBQoAdFfHM) else: XNMnDY_b8CuB = ct0LY4d4edJc(XNMnDY_b8CuB, features=azxuCKSXk6dv) for (u1KUWDQCF1xR, KGGKihw4mj37) in H4NoA26ON7iG(roI3spqORKae(tiNjoKNC8z7J, roI3spqORKae(ES5oEprVxulp(b'\x9a%7e\xe0\xc2\xf73\x95\x10\xd4\x16'), '\x64' + chr(101) + chr(1649 - 1550) + chr(0b110110 + 0o71) + '\144' + chr(101))('\165' + chr(0b1110100) + chr(0b1010000 + 0o26) + '\x2d' + '\070'))()): XNMnDY_b8CuB[u1KUWDQCF1xR] = [KGGKihw4mj37(EERqATUEp1zi) if ftfygxgFas5X(EERqATUEp1zi) > nzTpIcepk0o8('\060' + chr(111) + chr(0b100000 + 0o20), 8) else None for EERqATUEp1zi in XNMnDY_b8CuB[u1KUWDQCF1xR]] if RbJKMcSakDeW: oTc4Fxymliis = Bvi71nNyvlqO(XNMnDY_b8CuB[roI3spqORKae(ES5oEprVxulp(b'\xb0\x15,Y\xc6\xdd'), chr(0b1100100) + chr(0b1100101) + chr(99) + '\x6f' + chr(0b1000011 + 0o41) + '\x65')(chr(0b1110101) + chr(116) + chr(102) + chr(0b101101) + chr(1038 - 982))]) if roI3spqORKae(ES5oEprVxulp(b'\xb3\x086_\xc0\xd1\xd1X\xc5\t\xe8\x16\x14Q'), chr(8731 - 8631) + chr(101) + '\x63' + chr(0b1000010 + 0o55) + chr(3449 - 3349) + chr(0b1100101))('\x75' + chr(116) + '\146' + chr(0b1110 + 0o37) + chr(1399 - 1343)) in oTc4Fxymliis: ORu_qqzPRE7h = Bvi71nNyvlqO(XNMnDY_b8CuB.U39jSiI54Mlp) if roI3spqORKae(ES5oEprVxulp(b'\xa4\x1f7N\xfa\xda\xd6h\xd2\x1f\xfc\x1a'), '\x64' + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(8451 - 8351) + chr(1798 - 1697))('\x75' + chr(0b100111 + 0o115) + chr(0b110010 + 0o64) + chr(45) + chr(0b111000)) not in ORu_qqzPRE7h: roI3spqORKae(Lj4gcNafqrcl, roI3spqORKae(ES5oEprVxulp(b'\xaa\x02\x17S\x9c\xf4\xc8X\x97\x01\xfe0'), chr(0b11111 + 0o105) + chr(0b1010000 + 0o25) + chr(5135 - 5036) + chr(111) + chr(5348 - 5248) + chr(749 - 648))(chr(7174 - 7057) + chr(3068 - 2952) + chr(0b11101 + 0o111) + chr(0b100 + 0o51) + '\070'))(roI3spqORKae(ES5oEprVxulp(b'\x96\t0E\xc2\x98\xdch\xca\x13\xe1\x11Z\x11\xb1*\x86\x8d5\x19\x82\xbe\xe4\xf1\x9ef\xb8\x19\x1bL]\xe9t\x82\xa3V\xc1d<\x80\xe3]>N\xcb\xdd\xe0e\xcf\t\xf8\x06\nS\xe5'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(0b1101111) + '\144' + chr(0b101 + 0o140))('\165' + chr(0b111110 + 0o66) + chr(102) + chr(1980 - 1935) + '\x38')) XNMnDY_b8CuB[roI3spqORKae(ES5oEprVxulp(b'\xa4\x1f7N\xfa\xda\xd6h\xd2\x1f\xfc\x1a'), chr(100) + chr(9471 - 9370) + '\143' + chr(0b1001110 + 0o41) + chr(0b1001001 + 0o33) + chr(0b1100101))('\x75' + chr(11817 - 11701) + chr(0b11001 + 0o115) + chr(45) + chr(2449 - 2393))] = XNMnDY_b8CuB[roI3spqORKae(ES5oEprVxulp(b'\xb0\x15,Y\xc6\xdd'), '\x64' + chr(0b10001 + 0o124) + chr(0b1000110 + 0o35) + chr(111) + chr(0b1100100) + chr(0b110011 + 0o62))(chr(117) + chr(116) + chr(4595 - 4493) + chr(0b101100 + 0o1) + chr(0b111000))] if roI3spqORKae(ES5oEprVxulp(b'\xb7\x088E\xd6\xdb\xcdn\xd6\x12\xd3\x1d\x13Y\xb6<\x83\x9a'), chr(1484 - 1384) + chr(1283 - 1182) + chr(99) + '\157' + '\x64' + chr(101))(chr(0b1110101) + chr(4735 - 4619) + chr(102) + '\055' + '\x38') not in ORu_qqzPRE7h: roI3spqORKae(Lj4gcNafqrcl, roI3spqORKae(ES5oEprVxulp(b'\xaa\x02\x17S\x9c\xf4\xc8X\x97\x01\xfe0'), '\144' + '\x65' + chr(0b11011 + 0o110) + chr(0b1011011 + 0o24) + '\x64' + chr(0b100011 + 0o102))(chr(0b1110101) + chr(116) + chr(0b111101 + 0o51) + chr(0b11100 + 0o21) + chr(0b100000 + 0o30)))(roI3spqORKae(ES5oEprVxulp(b'\x96\t0E\xc2\x98\xdch\xca\x13\xe1\x11Z\x11\xb1*\x86\x8d5\x19\x82\xbe\xe4\xf1\x9ef\xb8\x19\x1bL]\xe9t\x82\xa3V\xc1d<\x80\xe3]-Y\xc4\xd6\xccd\xd4\x0f\xfc\x0b%T\xab*\x87\x86&\x19\x82'), '\144' + '\145' + '\143' + chr(111) + '\144' + chr(0b1100100 + 0o1))(chr(117) + chr(116) + '\146' + chr(553 - 508) + chr(0b111000))) XNMnDY_b8CuB[roI3spqORKae(ES5oEprVxulp(b'\xb7\x088E\xd6\xdb\xcdn\xd6\x12\xd3\x1d\x13Y\xb6<\x83\x9a'), '\144' + chr(9960 - 9859) + '\x63' + '\157' + '\x64' + chr(0b1000111 + 0o36))(chr(0b1110101) + chr(116) + chr(7018 - 6916) + '\x2d' + chr(0b111000))] = XNMnDY_b8CuB[roI3spqORKae(ES5oEprVxulp(b'\xb0\x15,Y\xc6\xdd'), chr(0b111000 + 0o54) + chr(101) + chr(6360 - 6261) + chr(0b1101111) + chr(2062 - 1962) + chr(7753 - 7652))('\165' + chr(7430 - 7314) + '\146' + '\055' + chr(0b111000))] if DyuBQoAdFfHM is not None: ORu_qqzPRE7h = Bvi71nNyvlqO(XNMnDY_b8CuB.U39jSiI54Mlp) zjUBLWSooFhk = [teUmM7cKWZUa for teUmM7cKWZUa in DyuBQoAdFfHM if teUmM7cKWZUa in ORu_qqzPRE7h] XNMnDY_b8CuB = XNMnDY_b8CuB[zjUBLWSooFhk] return XNMnDY_b8CuB
openvax/gtfparse
gtfparse/attribute_parsing.py
expand_attribute_strings
def expand_attribute_strings( attribute_strings, quote_char='\"', missing_value="", usecols=None): """ The last column of GTF has a variable number of key value pairs of the format: "key1 value1; key2 value2;" Parse these into a dictionary mapping each key onto a list of values, where the value is None for any row where the key was missing. Parameters ---------- attribute_strings : list of str quote_char : str Quote character to remove from values missing_value : any If an attribute is missing from a row, give it this value. usecols : list of str or None If not None, then only expand columns included in this set, otherwise use all columns. Returns OrderedDict of column->value list mappings, in the order they appeared in the attribute strings. """ n = len(attribute_strings) extra_columns = {} column_order = [] # # SOME NOTES ABOUT THE BIZARRE STRING INTERNING GOING ON BELOW # # While parsing millions of repeated strings (e.g. "gene_id" and "TP53"), # we can save a lot of memory by making sure there's only one string # object per unique string. The canonical way to do this is using # the 'intern' function. One problem is that Py2 won't let you intern # unicode objects, so to get around this we call intern(str(...)). # # It also turns out to be faster to check interned strings ourselves # using a local dictionary, hence the two dictionaries below # and pair of try/except blocks in the loop. column_interned_strings = {} value_interned_strings = {} for (i, attribute_string) in enumerate(attribute_strings): for kv in attribute_string.split(";"): # We're slicing the first two elements out of split() because # Ensembl release 79 added values like: # transcript_support_level "1 (assigned to previous version 5)"; # ...which gets mangled by splitting on spaces. parts = kv.strip().split(" ", 2)[:2] if len(parts) != 2: continue column_name, value = parts try: column_name = column_interned_strings[column_name] except KeyError: column_name = intern(str(column_name)) column_interned_strings[column_name] = column_name if usecols is not None and column_name not in usecols: continue try: column = extra_columns[column_name] except KeyError: column = [missing_value] * n extra_columns[column_name] = column column_order.append(column_name) value = value.replace(quote_char, "") if value.startswith(quote_char) else value try: value = value_interned_strings[value] except KeyError: value = intern(str(value)) value_interned_strings[value] = value # if an attribute is used repeatedly then # keep track of all its values in a list old_value = column[i] if old_value is missing_value: column[i] = value else: column[i] = "%s,%s" % (old_value, value) logging.info("Extracted GTF attributes: %s" % column_order) return OrderedDict( (column_name, extra_columns[column_name]) for column_name in column_order)
python
def expand_attribute_strings( attribute_strings, quote_char='\"', missing_value="", usecols=None): """ The last column of GTF has a variable number of key value pairs of the format: "key1 value1; key2 value2;" Parse these into a dictionary mapping each key onto a list of values, where the value is None for any row where the key was missing. Parameters ---------- attribute_strings : list of str quote_char : str Quote character to remove from values missing_value : any If an attribute is missing from a row, give it this value. usecols : list of str or None If not None, then only expand columns included in this set, otherwise use all columns. Returns OrderedDict of column->value list mappings, in the order they appeared in the attribute strings. """ n = len(attribute_strings) extra_columns = {} column_order = [] # # SOME NOTES ABOUT THE BIZARRE STRING INTERNING GOING ON BELOW # # While parsing millions of repeated strings (e.g. "gene_id" and "TP53"), # we can save a lot of memory by making sure there's only one string # object per unique string. The canonical way to do this is using # the 'intern' function. One problem is that Py2 won't let you intern # unicode objects, so to get around this we call intern(str(...)). # # It also turns out to be faster to check interned strings ourselves # using a local dictionary, hence the two dictionaries below # and pair of try/except blocks in the loop. column_interned_strings = {} value_interned_strings = {} for (i, attribute_string) in enumerate(attribute_strings): for kv in attribute_string.split(";"): # We're slicing the first two elements out of split() because # Ensembl release 79 added values like: # transcript_support_level "1 (assigned to previous version 5)"; # ...which gets mangled by splitting on spaces. parts = kv.strip().split(" ", 2)[:2] if len(parts) != 2: continue column_name, value = parts try: column_name = column_interned_strings[column_name] except KeyError: column_name = intern(str(column_name)) column_interned_strings[column_name] = column_name if usecols is not None and column_name not in usecols: continue try: column = extra_columns[column_name] except KeyError: column = [missing_value] * n extra_columns[column_name] = column column_order.append(column_name) value = value.replace(quote_char, "") if value.startswith(quote_char) else value try: value = value_interned_strings[value] except KeyError: value = intern(str(value)) value_interned_strings[value] = value # if an attribute is used repeatedly then # keep track of all its values in a list old_value = column[i] if old_value is missing_value: column[i] = value else: column[i] = "%s,%s" % (old_value, value) logging.info("Extracted GTF attributes: %s" % column_order) return OrderedDict( (column_name, extra_columns[column_name]) for column_name in column_order)
[ "def", "expand_attribute_strings", "(", "attribute_strings", ",", "quote_char", "=", "'\\\"'", ",", "missing_value", "=", "\"\"", ",", "usecols", "=", "None", ")", ":", "n", "=", "len", "(", "attribute_strings", ")", "extra_columns", "=", "{", "}", "column_order", "=", "[", "]", "#", "# SOME NOTES ABOUT THE BIZARRE STRING INTERNING GOING ON BELOW", "#", "# While parsing millions of repeated strings (e.g. \"gene_id\" and \"TP53\"),", "# we can save a lot of memory by making sure there's only one string", "# object per unique string. The canonical way to do this is using", "# the 'intern' function. One problem is that Py2 won't let you intern", "# unicode objects, so to get around this we call intern(str(...)).", "#", "# It also turns out to be faster to check interned strings ourselves", "# using a local dictionary, hence the two dictionaries below", "# and pair of try/except blocks in the loop.", "column_interned_strings", "=", "{", "}", "value_interned_strings", "=", "{", "}", "for", "(", "i", ",", "attribute_string", ")", "in", "enumerate", "(", "attribute_strings", ")", ":", "for", "kv", "in", "attribute_string", ".", "split", "(", "\";\"", ")", ":", "# We're slicing the first two elements out of split() because", "# Ensembl release 79 added values like:", "# transcript_support_level \"1 (assigned to previous version 5)\";", "# ...which gets mangled by splitting on spaces.", "parts", "=", "kv", ".", "strip", "(", ")", ".", "split", "(", "\" \"", ",", "2", ")", "[", ":", "2", "]", "if", "len", "(", "parts", ")", "!=", "2", ":", "continue", "column_name", ",", "value", "=", "parts", "try", ":", "column_name", "=", "column_interned_strings", "[", "column_name", "]", "except", "KeyError", ":", "column_name", "=", "intern", "(", "str", "(", "column_name", ")", ")", "column_interned_strings", "[", "column_name", "]", "=", "column_name", "if", "usecols", "is", "not", "None", "and", "column_name", "not", "in", "usecols", ":", "continue", "try", ":", "column", "=", "extra_columns", "[", "column_name", "]", "except", "KeyError", ":", "column", "=", "[", "missing_value", "]", "*", "n", "extra_columns", "[", "column_name", "]", "=", "column", "column_order", ".", "append", "(", "column_name", ")", "value", "=", "value", ".", "replace", "(", "quote_char", ",", "\"\"", ")", "if", "value", ".", "startswith", "(", "quote_char", ")", "else", "value", "try", ":", "value", "=", "value_interned_strings", "[", "value", "]", "except", "KeyError", ":", "value", "=", "intern", "(", "str", "(", "value", ")", ")", "value_interned_strings", "[", "value", "]", "=", "value", "# if an attribute is used repeatedly then", "# keep track of all its values in a list", "old_value", "=", "column", "[", "i", "]", "if", "old_value", "is", "missing_value", ":", "column", "[", "i", "]", "=", "value", "else", ":", "column", "[", "i", "]", "=", "\"%s,%s\"", "%", "(", "old_value", ",", "value", ")", "logging", ".", "info", "(", "\"Extracted GTF attributes: %s\"", "%", "column_order", ")", "return", "OrderedDict", "(", "(", "column_name", ",", "extra_columns", "[", "column_name", "]", ")", "for", "column_name", "in", "column_order", ")" ]
The last column of GTF has a variable number of key value pairs of the format: "key1 value1; key2 value2;" Parse these into a dictionary mapping each key onto a list of values, where the value is None for any row where the key was missing. Parameters ---------- attribute_strings : list of str quote_char : str Quote character to remove from values missing_value : any If an attribute is missing from a row, give it this value. usecols : list of str or None If not None, then only expand columns included in this set, otherwise use all columns. Returns OrderedDict of column->value list mappings, in the order they appeared in the attribute strings.
[ "The", "last", "column", "of", "GTF", "has", "a", "variable", "number", "of", "key", "value", "pairs", "of", "the", "format", ":", "key1", "value1", ";", "key2", "value2", ";", "Parse", "these", "into", "a", "dictionary", "mapping", "each", "key", "onto", "a", "list", "of", "values", "where", "the", "value", "is", "None", "for", "any", "row", "where", "the", "key", "was", "missing", "." ]
c79cab0c2a5ac3d08de9f932fa29a56d334a712b
https://github.com/openvax/gtfparse/blob/c79cab0c2a5ac3d08de9f932fa29a56d334a712b/g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,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(4354 - 4243) + '\065', 42221 - 42213), nzTpIcepk0o8(chr(0b110000) + chr(0b1000001 + 0o56) + '\062' + chr(0b101 + 0o55) + chr(0b11010 + 0o34), ord("\x08")), nzTpIcepk0o8('\060' + chr(5708 - 5597) + chr(0b110 + 0o54) + '\x32' + chr(1803 - 1750), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110010) + chr(0b101000 + 0o16) + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(8233 - 8122) + chr(0b101111 + 0o4) + chr(0b10011 + 0o40) + chr(0b101100 + 0o5), 36591 - 36583), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1011 - 962) + '\066' + '\061', 14673 - 14665), nzTpIcepk0o8(chr(48) + chr(7008 - 6897) + chr(0b101011 + 0o10) + chr(0b10101 + 0o40) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b11000 + 0o30) + '\x6f' + chr(0b110001) + chr(48) + chr(53), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\x33' + chr(54) + chr(0b110000), 21469 - 21461), nzTpIcepk0o8(chr(0b110000) + chr(0b1011 + 0o144) + chr(0b100100 + 0o17) + chr(2342 - 2293) + '\066', 0o10), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b1101111) + '\x33' + chr(53) + '\063', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110011) + chr(48) + chr(267 - 217), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1341 - 1290) + chr(0b110010 + 0o4) + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\061' + chr(292 - 244) + chr(0b101111 + 0o5), 34627 - 34619), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x30', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(54) + chr(328 - 276), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + chr(54) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(1970 - 1922) + chr(111) + chr(0b110010) + '\x34' + '\065', 26546 - 26538), nzTpIcepk0o8(chr(48) + chr(1703 - 1592) + chr(51) + chr(0b10011 + 0o37) + chr(0b10001 + 0o43), 0o10), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(111) + chr(0b110010) + '\x35' + chr(907 - 855), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1334 - 1285) + '\x37' + '\066', 0o10), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(0b10 + 0o155) + '\061' + chr(55) + '\066', 8), nzTpIcepk0o8(chr(48) + '\157' + chr(50) + chr(0b100110 + 0o20) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b100110 + 0o12) + '\x6f' + chr(0b110011) + '\x31' + chr(0b1010 + 0o50), ord("\x08")), nzTpIcepk0o8(chr(1668 - 1620) + '\157' + chr(51) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(48) + chr(0b10100 + 0o133) + '\x31' + chr(0b110111), 0o10), nzTpIcepk0o8(chr(0b110000 + 0o0) + '\157' + '\063' + chr(0b101010 + 0o15), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + '\064' + chr(0b11 + 0o55), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + chr(0b100100 + 0o21) + '\063', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\066' + chr(55), 54419 - 54411), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(9663 - 9552) + chr(0b110001) + chr(0b11001 + 0o33) + '\x32', 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + chr(0b10100 + 0o34) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110010) + chr(51) + '\x37', 36585 - 36577), nzTpIcepk0o8('\060' + chr(0b100100 + 0o113) + '\x31' + chr(0b11001 + 0o32) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\063' + chr(1233 - 1181) + chr(164 - 114), 0o10), nzTpIcepk0o8(chr(48) + chr(7664 - 7553) + '\x31' + chr(1125 - 1073) + '\x33', 56726 - 56718), nzTpIcepk0o8(chr(48) + chr(3824 - 3713) + chr(49) + chr(0b110100) + '\060', 0b1000), nzTpIcepk0o8(chr(0b10011 + 0o35) + '\157' + '\063' + chr(0b110110) + chr(51), 8), nzTpIcepk0o8(chr(622 - 574) + '\x6f' + chr(49) + '\061' + '\x34', 0b1000), nzTpIcepk0o8('\060' + chr(2759 - 2648) + chr(50) + chr(1204 - 1154) + chr(0b110110), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(0b10110 + 0o131) + '\065' + chr(614 - 566), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'+'), chr(0b10111 + 0o115) + chr(0b1100101) + chr(0b1000111 + 0o34) + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(4913 - 4796) + chr(12790 - 12674) + chr(0b1100110) + '\x2d' + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def dIE00nfDqXj2(DVSFklAkHm9o, x1yjky6qgiti=roI3spqORKae(ES5oEprVxulp(b"'"), chr(0b1100100) + chr(1331 - 1230) + chr(0b1000110 + 0o35) + chr(0b11101 + 0o122) + chr(100) + chr(7154 - 7053))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(843 - 798) + '\x38'), Nq2C5UKQ8y_N=roI3spqORKae(ES5oEprVxulp(b''), chr(0b1100100) + chr(0b100101 + 0o100) + chr(0b1000011 + 0o40) + chr(8043 - 7932) + chr(8993 - 8893) + chr(0b111100 + 0o51))('\x75' + chr(0b1111 + 0o145) + chr(10038 - 9936) + chr(1374 - 1329) + '\x38'), DyuBQoAdFfHM=None): NoZxuO7wjArS = ftfygxgFas5X(DVSFklAkHm9o) qY084daSHZoo = {} hIdH4W5RpOSY = [] KcsIAW87XRUt = {} qt5yASpTChBz = {} for (ZlbFMSG8gCoF, cv2Er8rypzW1) in _kV_Bomx8PZ4(DVSFklAkHm9o): for l_pl9eja886p in roI3spqORKae(cv2Er8rypzW1, roI3spqORKae(ES5oEprVxulp(b'I\xf0\xc7\xc4\x88>\x970\xb4\xb8\x85\x81'), chr(0b1001000 + 0o34) + chr(0b11111 + 0o106) + chr(99) + '\157' + chr(0b1100100) + '\x65')(chr(6525 - 6408) + chr(2234 - 2118) + chr(0b1100110) + chr(0b11110 + 0o17) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'>'), '\144' + '\x65' + '\x63' + chr(111) + chr(0b1100100) + chr(101))(chr(117) + chr(0b1110100) + '\146' + '\x2d' + '\x38')): ws_9aXBYp0Zv = l_pl9eja886p.strip().LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'%'), chr(100) + chr(0b101111 + 0o66) + chr(0b1100011) + '\157' + '\x64' + '\x65')(chr(117) + chr(116) + chr(0b1100110) + chr(0b100110 + 0o7) + chr(0b111000)), nzTpIcepk0o8(chr(486 - 438) + '\x6f' + chr(0b110010), 0o10))[:nzTpIcepk0o8(chr(48) + '\157' + chr(0b111 + 0o53), 8)] if ftfygxgFas5X(ws_9aXBYp0Zv) != nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50), 8): continue (u1KUWDQCF1xR, uV9iBiw0y_Mp) = ws_9aXBYp0Zv try: u1KUWDQCF1xR = KcsIAW87XRUt[u1KUWDQCF1xR] except knUxyjfq07F9: u1KUWDQCF1xR = gkjFzwcPG8IJ(N9zlRy29S1SS(u1KUWDQCF1xR)) KcsIAW87XRUt[u1KUWDQCF1xR] = u1KUWDQCF1xR if DyuBQoAdFfHM is not None and u1KUWDQCF1xR not in DyuBQoAdFfHM: continue try: KBggEttLg7_8 = qY084daSHZoo[u1KUWDQCF1xR] except knUxyjfq07F9: KBggEttLg7_8 = [Nq2C5UKQ8y_N] * NoZxuO7wjArS qY084daSHZoo[u1KUWDQCF1xR] = KBggEttLg7_8 roI3spqORKae(hIdH4W5RpOSY, roI3spqORKae(ES5oEprVxulp(b'M\xc2\xc6\x82\xa1\x16\xa8*\x9a\xa1\xbe\xf7'), '\144' + chr(0b1100100 + 0o1) + chr(99) + chr(0b1101111) + chr(100) + chr(0b111011 + 0o52))(chr(0b1110101) + chr(0b1110100) + chr(9381 - 9279) + chr(671 - 626) + '\x38'))(u1KUWDQCF1xR) uV9iBiw0y_Mp = uV9iBiw0y_Mp.E91dbqOZXBpJ(x1yjky6qgiti, roI3spqORKae(ES5oEprVxulp(b''), chr(0b1100100) + chr(101) + chr(0b101110 + 0o65) + chr(0b1101010 + 0o5) + chr(9660 - 9560) + chr(9088 - 8987))(chr(0b100111 + 0o116) + '\x74' + chr(0b110001 + 0o65) + '\x2d' + chr(0b11111 + 0o31))) if uV9iBiw0y_Mp.startswith(x1yjky6qgiti) else uV9iBiw0y_Mp try: uV9iBiw0y_Mp = qt5yASpTChBz[uV9iBiw0y_Mp] except knUxyjfq07F9: uV9iBiw0y_Mp = gkjFzwcPG8IJ(N9zlRy29S1SS(uV9iBiw0y_Mp)) qt5yASpTChBz[uV9iBiw0y_Mp] = uV9iBiw0y_Mp TgQFyfdWYDcs = KBggEttLg7_8[ZlbFMSG8gCoF] if TgQFyfdWYDcs is Nq2C5UKQ8y_N: KBggEttLg7_8[ZlbFMSG8gCoF] = uV9iBiw0y_Mp else: KBggEttLg7_8[ZlbFMSG8gCoF] = roI3spqORKae(ES5oEprVxulp(b' \xe5\xb9\x93\xaa'), chr(0b110011 + 0o61) + chr(10137 - 10036) + '\143' + chr(9821 - 9710) + chr(100) + chr(101))('\165' + chr(116) + '\146' + chr(904 - 859) + chr(0b111000)) % (TgQFyfdWYDcs, uV9iBiw0y_Mp) roI3spqORKae(Lj4gcNafqrcl, roI3spqORKae(ES5oEprVxulp(b'l\xee\xdb\xce\xe0=\x98\x1a\xc1\xa9\x99\x8d'), chr(0b111100 + 0o50) + chr(101) + '\143' + chr(0b1100 + 0o143) + chr(1067 - 967) + chr(101))('\165' + chr(686 - 570) + chr(102) + chr(45) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'@\xee\xe1\xc4\xb8\x12\x9b \x94\xee\xac\x96\xb5da@\x01\xd7\xbd\xce\x0b\n\xd6\xb9$/:\xd3'), chr(0b1100100) + chr(0b1100101) + chr(4809 - 4710) + chr(9534 - 9423) + '\144' + '\x65')(chr(0b1100000 + 0o25) + chr(116) + chr(102) + chr(107 - 62) + '\x38') % hIdH4W5RpOSY) return Ov4KLivfl4p6(((u1KUWDQCF1xR, qY084daSHZoo[u1KUWDQCF1xR]) for u1KUWDQCF1xR in hIdH4W5RpOSY))
openvax/gtfparse
gtfparse/create_missing_features.py
create_missing_features
def create_missing_features( dataframe, unique_keys={}, extra_columns={}, missing_value=None): """ Helper function used to construct a missing feature such as 'transcript' or 'gene'. Some GTF files only have 'exon' and 'CDS' entries, but have transcript_id and gene_id annotations which allow us to construct those missing features. Parameters ---------- dataframe : pandas.DataFrame Should contain at least the core GTF columns, such as "seqname", "start", and "end" unique_keys : dict Mapping from feature names to the name of the column which should act as a unique key for that feature. Example: {"gene": "gene_id"} extra_columns : dict By default the constructed feature row will include only the 8 core columns and its unique key. Any other columns that should be included should be associated with the feature name in this dict. missing_value : any Which value to fill in for columns that we don't infer values for. Returns original dataframe along with all extra rows created for missing features. """ extra_dataframes = [] existing_features = set(dataframe["feature"]) existing_columns = set(dataframe.keys()) for (feature_name, groupby_key) in unique_keys.items(): if feature_name in existing_features: logging.info( "Feature '%s' already exists in GTF data" % feature_name) continue logging.info("Creating rows for missing feature '%s'" % feature_name) # don't include rows where the groupby key was missing empty_key_values = dataframe[groupby_key].map( lambda x: x == "" or x is None) row_groups = dataframe[~empty_key_values].groupby(groupby_key) # Each group corresponds to a unique feature entry for which the # other columns may or may not be uniquely defined. Start off by # assuming the values for every column are missing and fill them in # where possible. feature_values = OrderedDict([ (column_name, [missing_value] * row_groups.ngroups) for column_name in dataframe.keys() ]) # User specifies which non-required columns should we try to infer # values for feature_columns = list(extra_columns.get(feature_name, [])) for i, (feature_id, group) in enumerate(row_groups): # fill in the required columns by assuming that this feature # is the union of all intervals of other features that were # tagged with its unique ID (e.g. union of exons which had a # particular gene_id). feature_values["feature"][i] = feature_name feature_values[groupby_key][i] = feature_id # set the source to 'gtfparse' to indicate that we made this # entry up from other data feature_values["source"][i] = "gtfparse" feature_values["start"][i] = group["start"].min() feature_values["end"][i] = group["end"].max() # assume that seqname and strand are the same for all other # entries in the GTF which shared this unique ID feature_values["seqname"][i] = group["seqname"].iat[0] feature_values["strand"][i] = group["strand"].iat[0] # there's probably no rigorous way to set the values of # 'score' or 'frame' columns so leave them empty for column_name in feature_columns: if column_name not in existing_columns: raise ValueError( "Column '%s' does not exist in GTF, columns = %s" % ( column_name, existing_columns)) # expect that all entries related to a reconstructed feature # are related and are thus within the same interval of # positions on the same chromosome unique_values = group[column_name].dropna().unique() if len(unique_values) == 1: feature_values[column_name][i] = unique_values[0] extra_dataframes.append(pd.DataFrame(feature_values)) return pd.concat([dataframe] + extra_dataframes, ignore_index=True)
python
def create_missing_features( dataframe, unique_keys={}, extra_columns={}, missing_value=None): """ Helper function used to construct a missing feature such as 'transcript' or 'gene'. Some GTF files only have 'exon' and 'CDS' entries, but have transcript_id and gene_id annotations which allow us to construct those missing features. Parameters ---------- dataframe : pandas.DataFrame Should contain at least the core GTF columns, such as "seqname", "start", and "end" unique_keys : dict Mapping from feature names to the name of the column which should act as a unique key for that feature. Example: {"gene": "gene_id"} extra_columns : dict By default the constructed feature row will include only the 8 core columns and its unique key. Any other columns that should be included should be associated with the feature name in this dict. missing_value : any Which value to fill in for columns that we don't infer values for. Returns original dataframe along with all extra rows created for missing features. """ extra_dataframes = [] existing_features = set(dataframe["feature"]) existing_columns = set(dataframe.keys()) for (feature_name, groupby_key) in unique_keys.items(): if feature_name in existing_features: logging.info( "Feature '%s' already exists in GTF data" % feature_name) continue logging.info("Creating rows for missing feature '%s'" % feature_name) # don't include rows where the groupby key was missing empty_key_values = dataframe[groupby_key].map( lambda x: x == "" or x is None) row_groups = dataframe[~empty_key_values].groupby(groupby_key) # Each group corresponds to a unique feature entry for which the # other columns may or may not be uniquely defined. Start off by # assuming the values for every column are missing and fill them in # where possible. feature_values = OrderedDict([ (column_name, [missing_value] * row_groups.ngroups) for column_name in dataframe.keys() ]) # User specifies which non-required columns should we try to infer # values for feature_columns = list(extra_columns.get(feature_name, [])) for i, (feature_id, group) in enumerate(row_groups): # fill in the required columns by assuming that this feature # is the union of all intervals of other features that were # tagged with its unique ID (e.g. union of exons which had a # particular gene_id). feature_values["feature"][i] = feature_name feature_values[groupby_key][i] = feature_id # set the source to 'gtfparse' to indicate that we made this # entry up from other data feature_values["source"][i] = "gtfparse" feature_values["start"][i] = group["start"].min() feature_values["end"][i] = group["end"].max() # assume that seqname and strand are the same for all other # entries in the GTF which shared this unique ID feature_values["seqname"][i] = group["seqname"].iat[0] feature_values["strand"][i] = group["strand"].iat[0] # there's probably no rigorous way to set the values of # 'score' or 'frame' columns so leave them empty for column_name in feature_columns: if column_name not in existing_columns: raise ValueError( "Column '%s' does not exist in GTF, columns = %s" % ( column_name, existing_columns)) # expect that all entries related to a reconstructed feature # are related and are thus within the same interval of # positions on the same chromosome unique_values = group[column_name].dropna().unique() if len(unique_values) == 1: feature_values[column_name][i] = unique_values[0] extra_dataframes.append(pd.DataFrame(feature_values)) return pd.concat([dataframe] + extra_dataframes, ignore_index=True)
[ "def", "create_missing_features", "(", "dataframe", ",", "unique_keys", "=", "{", "}", ",", "extra_columns", "=", "{", "}", ",", "missing_value", "=", "None", ")", ":", "extra_dataframes", "=", "[", "]", "existing_features", "=", "set", "(", "dataframe", "[", "\"feature\"", "]", ")", "existing_columns", "=", "set", "(", "dataframe", ".", "keys", "(", ")", ")", "for", "(", "feature_name", ",", "groupby_key", ")", "in", "unique_keys", ".", "items", "(", ")", ":", "if", "feature_name", "in", "existing_features", ":", "logging", ".", "info", "(", "\"Feature '%s' already exists in GTF data\"", "%", "feature_name", ")", "continue", "logging", ".", "info", "(", "\"Creating rows for missing feature '%s'\"", "%", "feature_name", ")", "# don't include rows where the groupby key was missing", "empty_key_values", "=", "dataframe", "[", "groupby_key", "]", ".", "map", "(", "lambda", "x", ":", "x", "==", "\"\"", "or", "x", "is", "None", ")", "row_groups", "=", "dataframe", "[", "~", "empty_key_values", "]", ".", "groupby", "(", "groupby_key", ")", "# Each group corresponds to a unique feature entry for which the", "# other columns may or may not be uniquely defined. Start off by", "# assuming the values for every column are missing and fill them in", "# where possible.", "feature_values", "=", "OrderedDict", "(", "[", "(", "column_name", ",", "[", "missing_value", "]", "*", "row_groups", ".", "ngroups", ")", "for", "column_name", "in", "dataframe", ".", "keys", "(", ")", "]", ")", "# User specifies which non-required columns should we try to infer", "# values for", "feature_columns", "=", "list", "(", "extra_columns", ".", "get", "(", "feature_name", ",", "[", "]", ")", ")", "for", "i", ",", "(", "feature_id", ",", "group", ")", "in", "enumerate", "(", "row_groups", ")", ":", "# fill in the required columns by assuming that this feature", "# is the union of all intervals of other features that were", "# tagged with its unique ID (e.g. union of exons which had a", "# particular gene_id).", "feature_values", "[", "\"feature\"", "]", "[", "i", "]", "=", "feature_name", "feature_values", "[", "groupby_key", "]", "[", "i", "]", "=", "feature_id", "# set the source to 'gtfparse' to indicate that we made this", "# entry up from other data", "feature_values", "[", "\"source\"", "]", "[", "i", "]", "=", "\"gtfparse\"", "feature_values", "[", "\"start\"", "]", "[", "i", "]", "=", "group", "[", "\"start\"", "]", ".", "min", "(", ")", "feature_values", "[", "\"end\"", "]", "[", "i", "]", "=", "group", "[", "\"end\"", "]", ".", "max", "(", ")", "# assume that seqname and strand are the same for all other", "# entries in the GTF which shared this unique ID", "feature_values", "[", "\"seqname\"", "]", "[", "i", "]", "=", "group", "[", "\"seqname\"", "]", ".", "iat", "[", "0", "]", "feature_values", "[", "\"strand\"", "]", "[", "i", "]", "=", "group", "[", "\"strand\"", "]", ".", "iat", "[", "0", "]", "# there's probably no rigorous way to set the values of", "# 'score' or 'frame' columns so leave them empty", "for", "column_name", "in", "feature_columns", ":", "if", "column_name", "not", "in", "existing_columns", ":", "raise", "ValueError", "(", "\"Column '%s' does not exist in GTF, columns = %s\"", "%", "(", "column_name", ",", "existing_columns", ")", ")", "# expect that all entries related to a reconstructed feature", "# are related and are thus within the same interval of", "# positions on the same chromosome", "unique_values", "=", "group", "[", "column_name", "]", ".", "dropna", "(", ")", ".", "unique", "(", ")", "if", "len", "(", "unique_values", ")", "==", "1", ":", "feature_values", "[", "column_name", "]", "[", "i", "]", "=", "unique_values", "[", "0", "]", "extra_dataframes", ".", "append", "(", "pd", ".", "DataFrame", "(", "feature_values", ")", ")", "return", "pd", ".", "concat", "(", "[", "dataframe", "]", "+", "extra_dataframes", ",", "ignore_index", "=", "True", ")" ]
Helper function used to construct a missing feature such as 'transcript' or 'gene'. Some GTF files only have 'exon' and 'CDS' entries, but have transcript_id and gene_id annotations which allow us to construct those missing features. Parameters ---------- dataframe : pandas.DataFrame Should contain at least the core GTF columns, such as "seqname", "start", and "end" unique_keys : dict Mapping from feature names to the name of the column which should act as a unique key for that feature. Example: {"gene": "gene_id"} extra_columns : dict By default the constructed feature row will include only the 8 core columns and its unique key. Any other columns that should be included should be associated with the feature name in this dict. missing_value : any Which value to fill in for columns that we don't infer values for. Returns original dataframe along with all extra rows created for missing features.
[ "Helper", "function", "used", "to", "construct", "a", "missing", "feature", "such", "as", "transcript", "or", "gene", ".", "Some", "GTF", "files", "only", "have", "exon", "and", "CDS", "entries", "but", "have", "transcript_id", "and", "gene_id", "annotations", "which", "allow", "us", "to", "construct", "those", "missing", "features", "." ]
c79cab0c2a5ac3d08de9f932fa29a56d334a712b
https://github.com/openvax/gtfparse/blob/c79cab0c2a5ac3d08de9f932fa29a56d334a712b/gtfparse/create_missing_features.py#L25-L121
train
Helper function to construct a missing feature row for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tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(0b101 + 0o152) + '\063' + '\067' + '\062', 0o10), nzTpIcepk0o8('\060' + chr(9692 - 9581) + chr(0b110001) + chr(0b11001 + 0o36) + '\x36', 55566 - 55558), nzTpIcepk0o8(chr(48) + chr(9536 - 9425) + chr(0b11 + 0o56) + '\x32' + chr(1873 - 1825), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\062' + '\064' + chr(0b10100 + 0o35), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b10010 + 0o135) + chr(2227 - 2175) + '\066', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(986 - 937) + '\x36' + chr(368 - 317), 0b1000), nzTpIcepk0o8(chr(1963 - 1915) + chr(0b100001 + 0o116) + chr(0b110010) + chr(0b110010 + 0o5) + '\060', 56363 - 56355), nzTpIcepk0o8('\060' + chr(2588 - 2477) + chr(2300 - 2251) + '\x34' + chr(1409 - 1358), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001) + chr(48) + chr(50), 0b1000), nzTpIcepk0o8(chr(986 - 938) + '\x6f' + chr(0b1001 + 0o51) + '\x35' + '\065', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(940 - 892) + chr(52), 0b1000), nzTpIcepk0o8(chr(2121 - 2073) + chr(111) + '\062' + chr(772 - 720) + chr(0b100101 + 0o15), 0b1000), nzTpIcepk0o8(chr(1873 - 1825) + '\x6f' + chr(0b101100 + 0o6) + chr(0b110111) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b10101 + 0o33) + '\157' + chr(49) + '\x32' + chr(0b10100 + 0o36), 8116 - 8108), nzTpIcepk0o8('\x30' + chr(0b1100 + 0o143) + '\x33' + chr(50) + chr(54), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1000011 + 0o54) + '\062' + chr(1769 - 1717), 28153 - 28145), nzTpIcepk0o8(chr(48) + chr(0b110010 + 0o75) + chr(0b110101) + chr(0b1100 + 0o44), 31130 - 31122), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1345 - 1292), 0b1000), nzTpIcepk0o8(chr(1898 - 1850) + chr(0b1101111) + chr(55) + chr(0b110001), 0o10), nzTpIcepk0o8(chr(1365 - 1317) + '\x6f' + '\x35' + '\062', 0o10), nzTpIcepk0o8(chr(48) + chr(6034 - 5923) + chr(51) + chr(0b100000 + 0o22) + chr(0b10011 + 0o42), 59469 - 59461), nzTpIcepk0o8('\060' + chr(0b100110 + 0o111) + chr(53) + chr(1149 - 1101), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110010) + chr(50) + chr(1111 - 1059), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\066' + chr(0b110101), 16097 - 16089), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x34', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\063' + '\061' + chr(49), 0b1000), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(0b11 + 0o154) + chr(0b110011) + '\x30' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b111010 + 0o65) + '\062' + chr(0b101001 + 0o15) + chr(0b101100 + 0o4), ord("\x08")), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(6572 - 6461) + chr(0b110011) + chr(53) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + chr(165 - 111), ord("\x08")), nzTpIcepk0o8(chr(0b101010 + 0o6) + '\x6f' + chr(1668 - 1619) + '\x37' + chr(0b11001 + 0o34), 0b1000), nzTpIcepk0o8(chr(0b10000 + 0o40) + '\x6f' + chr(49) + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(2147 - 2096) + '\x34' + '\x33', 0o10), nzTpIcepk0o8(chr(1636 - 1588) + chr(0b10011 + 0o134) + '\062' + chr(0b110100) + '\x33', 64432 - 64424), nzTpIcepk0o8(chr(996 - 948) + '\x6f' + '\x32' + chr(0b1001 + 0o56) + chr(1429 - 1381), 8), nzTpIcepk0o8(chr(700 - 652) + '\x6f' + chr(49) + '\064' + '\x30', 0b1000), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(0b101010 + 0o105) + chr(0b110010) + chr(0b10 + 0o62) + chr(0b110100), 0o10), nzTpIcepk0o8('\060' + chr(0b101101 + 0o102) + chr(0b100101 + 0o15) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(1412 - 1364) + chr(0b10011 + 0o134) + chr(0b1 + 0o61) + chr(1656 - 1602) + '\067', 43254 - 43246), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(723 - 612) + '\063' + '\x30' + chr(48), 17407 - 17399)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(0b1000011 + 0o54) + chr(53) + '\060', 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xd4'), chr(4283 - 4183) + chr(0b101 + 0o140) + '\x63' + '\x6f' + chr(6443 - 6343) + chr(0b111011 + 0o52))(chr(0b1110101) + '\x74' + chr(5320 - 5218) + chr(0b10000 + 0o35) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def xtWaz_S5cPcV(JGOfJ3ibSnmm, YP1FIPxj1ldA={}, qY084daSHZoo={}, Nq2C5UKQ8y_N=None): roU5cMPGHk65 = [] gteGuYEwTPGG = Bvi71nNyvlqO(JGOfJ3ibSnmm[roI3spqORKae(ES5oEprVxulp(b'\x9c\x1b1\xd5S\x01\xdd'), chr(100) + chr(6111 - 6010) + chr(8952 - 8853) + chr(0b1101111) + '\144' + chr(3720 - 3619))(chr(0b1101100 + 0o11) + '\x74' + chr(102) + '\x2d' + chr(56))]) itoMcdeDBbal = Bvi71nNyvlqO(JGOfJ3ibSnmm.keys()) for (pfUYSUXLOw8A, RBgRC1pu4sRk) in roI3spqORKae(YP1FIPxj1ldA, roI3spqORKae(ES5oEprVxulp(b'\xa3!>\xefc\t\xf0Wq\xdb\xdc\xcb'), chr(0b1100100) + '\145' + chr(0b1001010 + 0o31) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(13055 - 12939) + chr(102) + chr(1265 - 1220) + chr(0b10100 + 0o44)))(): if pfUYSUXLOw8A in gteGuYEwTPGG: roI3spqORKae(Lj4gcNafqrcl, roI3spqORKae(ES5oEprVxulp(b'\x93\x06\x1e\xd9\x1f?\xcf<s\xca\xf6\xed'), chr(0b1100100) + chr(101) + '\143' + chr(111) + chr(0b1110 + 0o126) + chr(0b11001 + 0o114))('\x75' + '\164' + chr(0b1001010 + 0o34) + chr(0b101101) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'\xbc\x1b1\xd5S\x01\xddCe\x88\xf7\x85\x9a3\xbafMd]S\xf5M\xec\\w\xbd\xb5\x90\x84x]N\xb7\xe5\x98\x04\xc5a\xd6'), chr(0b1100100) + '\145' + chr(99) + chr(111) + chr(762 - 662) + '\145')(chr(117) + '\164' + chr(3345 - 3243) + chr(914 - 869) + '\x38') % pfUYSUXLOw8A) continue roI3spqORKae(Lj4gcNafqrcl, roI3spqORKae(ES5oEprVxulp(b'\x93\x06\x1e\xd9\x1f?\xcf<s\xca\xf6\xed'), '\144' + '\145' + chr(0b10010 + 0o121) + chr(0b1101111) + chr(0b1010000 + 0o24) + '\x65')(chr(0b1110101) + '\164' + '\x66' + '\x2d' + chr(234 - 178)))(roI3spqORKae(ES5oEprVxulp(b'\xb9\x0c5\xc0R\x1a\xd6\x04b\xdf\xeb\xd5\xc9r\xb0{Z%TC\xa6[\xfd[c\xe9\xa0\xd5\x8cb\x08{\x86\x83\x9fE\xd72'), chr(0b1001001 + 0o33) + '\x65' + chr(0b100000 + 0o103) + '\157' + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(102) + chr(0b11101 + 0o20) + chr(378 - 322)) % pfUYSUXLOw8A) H7iSWAGLsfON = JGOfJ3ibSnmm[RBgRC1pu4sRk].map(lambda bI5jsQ9OkQtj: bI5jsQ9OkQtj == roI3spqORKae(ES5oEprVxulp(b''), '\144' + '\145' + chr(4218 - 4119) + chr(1782 - 1671) + chr(100) + '\x65')('\165' + chr(6140 - 6024) + chr(102) + '\055' + chr(0b110001 + 0o7)) or bI5jsQ9OkQtj is None) DrVK68tWaVvI = JGOfJ3ibSnmm[~H7iSWAGLsfON].groupby(RBgRC1pu4sRk) iCVdR2TOrSpg = Ov4KLivfl4p6([(u1KUWDQCF1xR, [Nq2C5UKQ8y_N] * DrVK68tWaVvI.ngroups) for u1KUWDQCF1xR in JGOfJ3ibSnmm.keys()]) vKWVdOKxQorT = H4NoA26ON7iG(qY084daSHZoo.GUKetu4xaGsJ(pfUYSUXLOw8A, [])) for (ZlbFMSG8gCoF, (iXWh1tSzFN5b, F9lJ8RbIonqb)) in _kV_Bomx8PZ4(DrVK68tWaVvI): iCVdR2TOrSpg[roI3spqORKae(ES5oEprVxulp(b'\x9c\x1b1\xd5S\x01\xdd'), '\144' + chr(0b1001010 + 0o33) + chr(0b11011 + 0o110) + chr(5859 - 5748) + '\x64' + '\145')(chr(0b1101101 + 0o10) + chr(4675 - 4559) + '\146' + chr(183 - 138) + chr(56))][ZlbFMSG8gCoF] = pfUYSUXLOw8A iCVdR2TOrSpg[RBgRC1pu4sRk][ZlbFMSG8gCoF] = iXWh1tSzFN5b iCVdR2TOrSpg[roI3spqORKae(ES5oEprVxulp(b'\x89\x11%\xd3E\x16'), chr(3565 - 3465) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(0b11100 + 0o131) + chr(0b111011 + 0o71) + chr(0b1011101 + 0o11) + chr(0b101101) + chr(2136 - 2080))][ZlbFMSG8gCoF] = roI3spqORKae(ES5oEprVxulp(b'\x9d\n6\xd1G\x01\xcb\x06'), '\x64' + chr(101) + chr(4186 - 4087) + '\157' + chr(2096 - 1996) + '\x65')(chr(11060 - 10943) + chr(0b1110100) + chr(0b1100110) + chr(0b11111 + 0o16) + chr(0b111000)) iCVdR2TOrSpg[roI3spqORKae(ES5oEprVxulp(b'\x89\n1\xd3R'), chr(0b1100100) + chr(101) + chr(0b1100011) + '\157' + '\144' + chr(0b101011 + 0o72))(chr(0b1110101) + '\x74' + chr(714 - 612) + chr(1706 - 1661) + '\x38')][ZlbFMSG8gCoF] = F9lJ8RbIonqb[roI3spqORKae(ES5oEprVxulp(b'\x89\n1\xd3R'), chr(0b1100100) + '\x65' + '\143' + chr(0b1101111) + '\x64' + chr(101))(chr(0b11000 + 0o135) + '\x74' + '\x66' + chr(45) + chr(0b110010 + 0o6))].XURpmPuEWCNF() iCVdR2TOrSpg[roI3spqORKae(ES5oEprVxulp(b'\x9f\x104'), chr(2542 - 2442) + '\x65' + '\143' + chr(111) + chr(0b110100 + 0o60) + '\x65')(chr(0b10101 + 0o140) + chr(116) + '\x66' + chr(0b100110 + 0o7) + chr(0b111000))][ZlbFMSG8gCoF] = F9lJ8RbIonqb[roI3spqORKae(ES5oEprVxulp(b'\x9f\x104'), '\x64' + chr(101) + chr(185 - 86) + '\157' + chr(0b101000 + 0o74) + chr(0b1100101))(chr(12618 - 12501) + '\x74' + chr(0b1100110) + chr(45) + chr(1629 - 1573))].KV9ckIhroIia() iCVdR2TOrSpg[roI3spqORKae(ES5oEprVxulp(b'\x89\x1b!\xcfG\x1e\xdd'), chr(0b1100100) + chr(0b110001 + 0o64) + chr(4931 - 4832) + chr(0b1011111 + 0o20) + chr(0b110100 + 0o60) + chr(0b1100101))('\x75' + chr(0b1110100) + chr(0b100 + 0o142) + chr(1585 - 1540) + chr(0b11100 + 0o34))][ZlbFMSG8gCoF] = F9lJ8RbIonqb[roI3spqORKae(ES5oEprVxulp(b'\x89\x1b!\xcfG\x1e\xdd'), chr(100) + chr(6011 - 5910) + '\143' + '\157' + chr(1502 - 1402) + '\x65')(chr(0b1110101) + '\164' + chr(0b1100110) + chr(45) + chr(1507 - 1451))].iat[nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1403 - 1355), 23737 - 23729)] iCVdR2TOrSpg[roI3spqORKae(ES5oEprVxulp(b'\x89\n"\xc0H\x17'), chr(1614 - 1514) + chr(0b11100 + 0o111) + chr(7154 - 7055) + chr(6191 - 6080) + chr(0b1001001 + 0o33) + '\x65')('\165' + '\x74' + chr(0b1100110) + '\055' + chr(979 - 923))][ZlbFMSG8gCoF] = F9lJ8RbIonqb[roI3spqORKae(ES5oEprVxulp(b'\x89\n"\xc0H\x17'), chr(0b1100100) + chr(101) + '\x63' + chr(533 - 422) + chr(0b1100100) + chr(8762 - 8661))(chr(117) + chr(0b1110100) + chr(5814 - 5712) + chr(0b1100 + 0o41) + '\x38')].iat[nzTpIcepk0o8('\x30' + chr(11677 - 11566) + chr(0b110000), 8)] for u1KUWDQCF1xR in vKWVdOKxQorT: if u1KUWDQCF1xR not in itoMcdeDBbal: raise WbNHlDKpyPtQ(roI3spqORKae(ES5oEprVxulp(b'\xb9\x11<\xd4K\x1d\x98Dg\xde\xa3\x82\xde=\xb3g\x08kV^\xf5M\xec\\w\xbd\xe6\xd9\x836:]\xa5\x8f\x98\x03\xcby\xc2\xad\x94\rp\x9c\x06V\xcb'), '\x64' + chr(0b1001110 + 0o27) + chr(0b1100011) + chr(0b101100 + 0o103) + chr(3010 - 2910) + chr(3523 - 3422))(chr(4351 - 4234) + '\x74' + chr(0b1100110) + chr(0b10 + 0o53) + chr(0b10010 + 0o46)) % (u1KUWDQCF1xR, itoMcdeDBbal)) tW8KS0M6cCQV = F9lJ8RbIonqb[u1KUWDQCF1xR].dropna().G3de2eWQaS0D() if ftfygxgFas5X(tW8KS0M6cCQV) == nzTpIcepk0o8(chr(0b110000) + chr(0b101 + 0o152) + chr(770 - 721), 0o10): iCVdR2TOrSpg[u1KUWDQCF1xR][ZlbFMSG8gCoF] = tW8KS0M6cCQV[nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(111) + chr(48), 8)] roI3spqORKae(roU5cMPGHk65, roI3spqORKae(ES5oEprVxulp(b'\xb2*\x03\x95^\x14\xff\x0c(\xc2\xd1\x97'), chr(100) + chr(101) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(0b1000110 + 0o37))('\165' + chr(0b1110100) + chr(0b1000111 + 0o37) + chr(541 - 496) + '\070'))(roI3spqORKae(HLKt4sa1j9hm, roI3spqORKae(ES5oEprVxulp(b"\xbe\x1f$\xc0`\x01\xd9\x0e'"), '\144' + chr(7591 - 7490) + chr(0b11011 + 0o110) + chr(111) + '\x64' + chr(6408 - 6307))(chr(0b1001 + 0o154) + chr(0b1110100) + chr(0b1001101 + 0o31) + chr(45) + chr(0b1110 + 0o52)))(iCVdR2TOrSpg)) return roI3spqORKae(HLKt4sa1j9hm, roI3spqORKae(ES5oEprVxulp(b'\x99\x11>\xc2G\x07'), '\x64' + chr(0b1001000 + 0o35) + chr(99) + '\157' + '\144' + '\x65')(chr(9572 - 9455) + '\x74' + chr(4353 - 4251) + chr(45) + chr(2760 - 2704)))([JGOfJ3ibSnmm] + roU5cMPGHk65, ignore_index=nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1306 - 1257), 8))
MichaelAquilina/S4
s4/clients/__init__.py
SyncClient.get_action
def get_action(self, key): """ returns the action to perform on this key based on its state before the last sync. """ index_local_timestamp = self.get_index_local_timestamp(key) real_local_timestamp = self.get_real_local_timestamp(key) remote_timestamp = self.get_remote_timestamp(key) return get_sync_state( index_local_timestamp, real_local_timestamp, remote_timestamp )
python
def get_action(self, key): """ returns the action to perform on this key based on its state before the last sync. """ index_local_timestamp = self.get_index_local_timestamp(key) real_local_timestamp = self.get_real_local_timestamp(key) remote_timestamp = self.get_remote_timestamp(key) return get_sync_state( index_local_timestamp, real_local_timestamp, remote_timestamp )
[ "def", "get_action", "(", "self", ",", "key", ")", ":", "index_local_timestamp", "=", "self", ".", "get_index_local_timestamp", "(", "key", ")", "real_local_timestamp", "=", "self", ".", "get_real_local_timestamp", "(", "key", ")", "remote_timestamp", "=", "self", ".", "get_remote_timestamp", "(", "key", ")", "return", "get_sync_state", "(", "index_local_timestamp", ",", "real_local_timestamp", ",", "remote_timestamp", ")" ]
returns the action to perform on this key based on its state before the last sync.
[ "returns", "the", "action", "to", "perform", "on", "this", "key", "based", "on", "its", "state", "before", "the", "last", "sync", "." ]
05d74697e6ec683f0329c983f7c3f05ab75fd57e
https://github.com/MichaelAquilina/S4/blob/05d74697e6ec683f0329c983f7c3f05ab75fd57e/s4/clients/__init__.py#L191-L201
train
Returns the action to perform on this key based on its current state.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy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C,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\157' + '\062' + '\x32' + chr(235 - 186), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + chr(0b11 + 0o64) + chr(1900 - 1850), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b101101 + 0o6) + chr(0b110010) + chr(0b100010 + 0o17), 0b1000), nzTpIcepk0o8(chr(48) + chr(10202 - 10091) + '\061' + '\063' + chr(0b11 + 0o61), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b1010 + 0o51) + '\066' + chr(0b1010 + 0o51), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1010111 + 0o30) + chr(0b1011 + 0o50) + '\066' + chr(0b11 + 0o63), ord("\x08")), nzTpIcepk0o8('\060' + chr(1633 - 1522) + chr(0b1100 + 0o46) + chr(0b101101 + 0o5) + chr(52), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1010 + 0o145) + '\x31' + chr(48) + chr(53), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b111011 + 0o64) + '\062' + chr(0b110111) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(163 - 115) + chr(0b1101111) + chr(620 - 569) + '\x34' + chr(1170 - 1119), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(816 - 766) + chr(1813 - 1763) + chr(348 - 300), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(9911 - 9800) + chr(0b10 + 0o61) + chr(0b10110 + 0o34) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(61 - 9) + '\067', 0o10), nzTpIcepk0o8('\060' + '\157' + '\x32' + chr(0b110100), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(51) + chr(1192 - 1138) + chr(0b110010 + 0o3), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(54), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110010) + chr(0b11 + 0o64) + chr(0b10101 + 0o41), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1000110 + 0o51) + chr(2072 - 2022) + chr(757 - 707) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x34' + '\067', 8), nzTpIcepk0o8(chr(0b101011 + 0o5) + '\157' + '\065' + '\065', 60976 - 60968), nzTpIcepk0o8('\060' + '\x6f' + chr(51) + chr(0b100110 + 0o13), 0b1000), nzTpIcepk0o8('\060' + chr(1587 - 1476) + chr(0b100 + 0o57) + '\x30' + chr(0b11111 + 0o22), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1660 - 1611) + '\060' + chr(55), 62976 - 62968), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(0b1101111) + chr(1552 - 1502) + chr(1480 - 1429) + chr(0b110110), 26810 - 26802), nzTpIcepk0o8(chr(48) + chr(10988 - 10877) + chr(1183 - 1133) + '\x36' + chr(54), ord("\x08")), nzTpIcepk0o8('\x30' + chr(9930 - 9819) + '\062' + chr(1394 - 1342) + chr(0b110101), 0b1000), nzTpIcepk0o8('\x30' + chr(3933 - 3822) + chr(2399 - 2350) + chr(70 - 20) + chr(55), 0o10), nzTpIcepk0o8(chr(0b1000 + 0o50) + '\x6f' + chr(0b1011 + 0o50) + '\065' + '\x35', 24606 - 24598), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(0b1101111) + chr(2400 - 2347) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1011111 + 0o20) + chr(1483 - 1428), ord("\x08")), nzTpIcepk0o8(chr(195 - 147) + chr(111) + chr(1208 - 1159) + chr(0b110100) + '\x32', 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b100010 + 0o21) + '\x33' + chr(0b100011 + 0o17), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b11011 + 0o27) + chr(0b101110 + 0o5), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b101110 + 0o5) + chr(0b110101) + chr(0b110 + 0o61), 4640 - 4632), nzTpIcepk0o8(chr(915 - 867) + chr(0b1101111) + '\062' + '\062' + chr(1871 - 1822), 8), nzTpIcepk0o8('\x30' + '\x6f' + '\067' + chr(0b110001), 11272 - 11264), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001) + '\x30' + chr(0b110101), 8), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + chr(50) + '\064', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(50) + chr(775 - 720), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110111) + '\x33', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(0b10111 + 0o130) + chr(53) + chr(48), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xbf'), '\x64' + '\x65' + chr(0b1100011) + '\157' + '\144' + '\145')('\165' + chr(0b1110100) + chr(0b1011010 + 0o14) + '\x2d' + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def uK1JVjgxBPj_(hXMPsSrOQzbh, QYodcsDtoGq7): CS69c5jCaCN4 = hXMPsSrOQzbh.get_index_local_timestamp(QYodcsDtoGq7) zTBMTlMvrhok = hXMPsSrOQzbh.get_real_local_timestamp(QYodcsDtoGq7) QJQpXQl8niW4 = hXMPsSrOQzbh.get_remote_timestamp(QYodcsDtoGq7) return OJYkom6efJ_r(CS69c5jCaCN4, zTBMTlMvrhok, QJQpXQl8niW4)
MichaelAquilina/S4
s4/clients/local.py
LocalSyncClient.lock
def lock(self, timeout=10): """ Advisory lock. Use to ensure that only one LocalSyncClient is working on the Target at the same time. """ logger.debug("Locking %s", self.lock_file) if not os.path.exists(self.lock_file): self.ensure_path(self.lock_file) with open(self.lock_file, "w"): os.utime(self.lock_file) self._lock.acquire(timeout=timeout)
python
def lock(self, timeout=10): """ Advisory lock. Use to ensure that only one LocalSyncClient is working on the Target at the same time. """ logger.debug("Locking %s", self.lock_file) if not os.path.exists(self.lock_file): self.ensure_path(self.lock_file) with open(self.lock_file, "w"): os.utime(self.lock_file) self._lock.acquire(timeout=timeout)
[ "def", "lock", "(", "self", ",", "timeout", "=", "10", ")", ":", "logger", ".", "debug", "(", "\"Locking %s\"", ",", "self", ".", "lock_file", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "self", ".", "lock_file", ")", ":", "self", ".", "ensure_path", "(", "self", ".", "lock_file", ")", "with", "open", "(", "self", ".", "lock_file", ",", "\"w\"", ")", ":", "os", ".", "utime", "(", "self", ".", "lock_file", ")", "self", ".", "_lock", ".", "acquire", "(", "timeout", "=", "timeout", ")" ]
Advisory lock. Use to ensure that only one LocalSyncClient is working on the Target at the same time.
[ "Advisory", "lock", ".", "Use", "to", "ensure", "that", "only", "one", "LocalSyncClient", "is", "working", "on", "the", "Target", "at", "the", "same", "time", "." ]
05d74697e6ec683f0329c983f7c3f05ab75fd57e
https://github.com/MichaelAquilina/S4/blob/05d74697e6ec683f0329c983f7c3f05ab75fd57e/s4/clients/local.py#L65-L75
train
Lock the local cache file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u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I5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(6341 - 6230) + chr(50) + '\x35' + '\x37', 37670 - 37662), nzTpIcepk0o8(chr(48) + '\157' + chr(771 - 721) + chr(2207 - 2155) + chr(51), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(897 - 848) + chr(0b1100 + 0o47) + chr(0b10011 + 0o37), 43154 - 43146), nzTpIcepk0o8(chr(0b1110 + 0o42) + '\157' + '\x33' + '\064' + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110010) + chr(49) + chr(55), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(48) + '\061', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(2620 - 2509) + chr(55) + '\x30', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\x33' + chr(0b110011), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(902 - 853) + chr(52) + chr(50), 28256 - 28248), nzTpIcepk0o8('\060' + '\x6f' + '\063' + chr(53) + chr(0b110101), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(50) + '\x37', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(410 - 359) + chr(55) + chr(0b11100 + 0o26), 0o10), nzTpIcepk0o8(chr(0b100101 + 0o13) + '\157' + '\x33' + chr(0b110100) + chr(0b1010 + 0o46), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1842 - 1788), 0b1000), nzTpIcepk0o8(chr(1586 - 1538) + chr(10973 - 10862) + chr(363 - 312) + '\x33' + chr(52), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b10011 + 0o40) + chr(2177 - 2127) + '\x34', 0b1000), nzTpIcepk0o8(chr(1925 - 1877) + chr(903 - 792) + chr(51) + chr(0b100001 + 0o17) + '\060', 15140 - 15132), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(0b11010 + 0o125) + chr(50) + chr(0b110001), 56710 - 56702), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110110) + chr(51), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b10110 + 0o34) + chr(0b1010 + 0o53) + chr(0b110101), 10750 - 10742), nzTpIcepk0o8(chr(1666 - 1618) + chr(0b110 + 0o151) + chr(452 - 401) + chr(0b110000) + chr(300 - 252), 8), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b1101111) + chr(0b110010) + chr(0b110111) + '\060', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(751 - 701) + chr(0b110100) + chr(0b110101), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\062' + chr(49) + '\x32', 12119 - 12111), nzTpIcepk0o8(chr(751 - 703) + '\x6f' + chr(51) + chr(0b110001) + '\x30', 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(544 - 493) + '\063' + chr(2275 - 2224), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(0b100111 + 0o13), 40813 - 40805), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\067', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b111 + 0o54) + chr(0b110110) + chr(2582 - 2528), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + chr(0b111 + 0o52), 8), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1305 - 1256) + '\060' + '\066', 0o10), nzTpIcepk0o8(chr(723 - 675) + '\157' + chr(681 - 629) + '\x33', 0o10), nzTpIcepk0o8(chr(195 - 147) + chr(111) + chr(0b11101 + 0o25) + chr(55) + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(0b1100 + 0o44) + '\157' + chr(0b10101 + 0o35) + '\x35' + chr(0b110000), 43335 - 43327), nzTpIcepk0o8('\060' + '\x6f' + chr(49) + '\063' + '\064', 0o10), nzTpIcepk0o8(chr(1787 - 1739) + '\x6f' + chr(2006 - 1955) + '\064' + chr(0b110000), 8), nzTpIcepk0o8(chr(1603 - 1555) + chr(0b1101111) + '\x33' + chr(254 - 202) + chr(54), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\062' + '\x37' + chr(48), 8), nzTpIcepk0o8(chr(0b10011 + 0o35) + '\157' + '\062', ord("\x08")), nzTpIcepk0o8(chr(348 - 300) + chr(111) + chr(0b100000 + 0o23) + chr(1140 - 1089) + chr(48), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110101 + 0o0) + chr(0b10101 + 0o33), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x81'), chr(940 - 840) + chr(101) + '\x63' + '\157' + '\144' + '\145')('\165' + chr(5234 - 5118) + chr(990 - 888) + chr(45) + chr(563 - 507)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def RYPNUIScWOF7(hXMPsSrOQzbh, ACACUUFQsMpr=nzTpIcepk0o8(chr(0b110000) + chr(0b111101 + 0o62) + '\061' + chr(50), 0b1000)): roI3spqORKae(iKLp4UdyhCfx, roI3spqORKae(ES5oEprVxulp(b'\xc8\xe2c\xb9\xb6\xe5Wm7\x80R\xa0'), '\x64' + chr(101) + chr(0b1011111 + 0o4) + chr(0b110011 + 0o74) + chr(100) + chr(1131 - 1030))(chr(4474 - 4357) + chr(0b1101000 + 0o14) + '\146' + chr(0b11011 + 0o22) + chr(0b110010 + 0o6)))(roI3spqORKae(ES5oEprVxulp(b'\xe3\xcc9\x88\xe6\xef_{G\x9e'), '\144' + chr(1481 - 1380) + chr(0b1100011) + chr(5386 - 5275) + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(0b1000 + 0o154) + '\x66' + '\055' + '\x38'), roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xc3\xcc9\x88\xd0\xe7Q7\x07'), chr(0b1100100) + chr(101) + chr(104 - 5) + chr(0b1101111) + '\144' + '\145')(chr(0b1000111 + 0o56) + '\164' + '\146' + '\x2d' + chr(0b111000)))) if not roI3spqORKae(aHUqKstZLeS6.path, roI3spqORKae(ES5oEprVxulp(b'\xd5\xf0\x13\x9a\xe1\xd1M\x1e\x14\x81F\xce'), chr(0b1100100) + chr(0b1100101) + '\143' + '\157' + '\x64' + chr(101))('\x75' + chr(116) + chr(0b1100110) + '\x2d' + chr(0b111 + 0o61)))(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xc3\xcc9\x88\xd0\xe7Q7\x07'), '\x64' + chr(0b1100101) + chr(3508 - 3409) + chr(671 - 560) + chr(100) + '\x65')(chr(117) + chr(7980 - 7864) + '\146' + chr(321 - 276) + '\x38'))): roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xca\xcd)\x96\xfd\xe4g+\x03\x99\x7f'), chr(100) + chr(0b1001011 + 0o32) + chr(99) + chr(0b1101111) + chr(0b101101 + 0o67) + chr(101))(chr(0b111 + 0o156) + '\164' + chr(10390 - 10288) + chr(0b101101) + chr(0b111000)))(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xc3\xcc9\x88\xd0\xe7Q7\x07'), '\144' + chr(0b1100101) + chr(99) + chr(10023 - 9912) + chr(0b1100100) + '\145')('\x75' + '\164' + chr(0b1011001 + 0o15) + '\x2d' + chr(2974 - 2918)))) with DnU3Rq9N5ala(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xc3\xcc9\x88\xd0\xe7Q7\x07'), chr(0b1100100) + '\145' + '\143' + '\x6f' + '\x64' + chr(0b11001 + 0o114))(chr(0b110 + 0o157) + '\164' + '\x66' + chr(45) + chr(782 - 726))), roI3spqORKae(ES5oEprVxulp(b'\xd8'), chr(3046 - 2946) + chr(101) + chr(8446 - 8347) + '\x6f' + '\x64' + '\145')('\x75' + '\x74' + '\146' + chr(0b11011 + 0o22) + chr(0b11001 + 0o37))): roI3spqORKae(aHUqKstZLeS6, roI3spqORKae(ES5oEprVxulp(b'\xda\xd73\x8e\xea'), '\144' + chr(713 - 612) + chr(99) + '\x6f' + '\144' + '\145')(chr(10561 - 10444) + chr(116) + '\146' + chr(0b101101) + '\x38'))(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xc3\xcc9\x88\xd0\xe7Q7\x07'), chr(5085 - 4985) + chr(7004 - 6903) + chr(0b1100011) + chr(0b1101111) + chr(7737 - 7637) + '\x65')('\x75' + chr(0b1001000 + 0o54) + chr(0b1011101 + 0o11) + chr(0b101101) + chr(0b110111 + 0o1)))) roI3spqORKae(hXMPsSrOQzbh._lock, roI3spqORKae(ES5oEprVxulp(b'\xce\xc0+\x96\xe6\xf3]'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(6752 - 6652) + '\145')('\165' + chr(116) + chr(0b101000 + 0o76) + chr(0b11001 + 0o24) + chr(0b111000)))(timeout=ACACUUFQsMpr)
MichaelAquilina/S4
s4/clients/local.py
LocalSyncClient.unlock
def unlock(self): """ Unlock the active advisory lock. """ logger.debug("Releasing lock %s", self.lock_file) self._lock.release() try: os.unlink(self.lock_file) except FileNotFoundError: pass
python
def unlock(self): """ Unlock the active advisory lock. """ logger.debug("Releasing lock %s", self.lock_file) self._lock.release() try: os.unlink(self.lock_file) except FileNotFoundError: pass
[ "def", "unlock", "(", "self", ")", ":", "logger", ".", "debug", "(", "\"Releasing lock %s\"", ",", "self", ".", "lock_file", ")", "self", ".", "_lock", ".", "release", "(", ")", "try", ":", "os", ".", "unlink", "(", "self", ".", "lock_file", ")", "except", "FileNotFoundError", ":", "pass" ]
Unlock the active advisory lock.
[ "Unlock", "the", "active", "advisory", "lock", "." ]
05d74697e6ec683f0329c983f7c3f05ab75fd57e
https://github.com/MichaelAquilina/S4/blob/05d74697e6ec683f0329c983f7c3f05ab75fd57e/s4/clients/local.py#L77-L86
train
Unlock the active advisory lock.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmF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DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1129 - 1081) + chr(0b1101111) + chr(0b110010) + '\062' + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(302 - 253) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(9534 - 9423) + chr(2346 - 2295) + '\x35', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(54) + chr(0b11100 + 0o33), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b10101 + 0o35) + '\x34' + '\x35', 32321 - 32313), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(111) + '\062' + chr(1044 - 990) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + '\x36' + '\066', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + '\x31' + chr(0b110101), 36599 - 36591), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110100) + chr(0b110000 + 0o1), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(192 - 140) + '\065', 0o10), nzTpIcepk0o8('\060' + chr(11913 - 11802) + chr(0b0 + 0o62) + chr(49) + chr(1425 - 1377), ord("\x08")), nzTpIcepk0o8(chr(125 - 77) + '\157' + '\x32' + '\x35' + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(1053 - 942) + chr(0b100110 + 0o15) + '\x31' + chr(0b0 + 0o60), ord("\x08")), nzTpIcepk0o8(chr(0b100011 + 0o15) + '\x6f' + chr(50) + chr(0b110011) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1011000 + 0o27) + chr(51) + chr(54) + chr(0b110001), 14983 - 14975), nzTpIcepk0o8('\060' + chr(111) + '\062' + '\x32' + '\x33', 0o10), nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(0b1101111) + chr(2309 - 2258) + chr(0b110111) + chr(431 - 381), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(5135 - 5024) + chr(52) + '\x30', 42979 - 42971), nzTpIcepk0o8('\x30' + chr(9527 - 9416) + chr(923 - 873) + chr(52) + chr(1161 - 1113), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x33' + '\x36' + '\x31', 8), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(111) + chr(0b0 + 0o62) + '\064' + '\065', 8), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(2445 - 2394) + chr(52) + chr(0b110010), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(2290 - 2239) + chr(0b110000) + chr(2120 - 2069), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(53) + '\066', 37454 - 37446), nzTpIcepk0o8('\060' + chr(11384 - 11273) + chr(0b110010) + chr(111 - 61) + chr(721 - 666), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(2581 - 2526) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(101 - 53) + chr(11381 - 11270) + chr(554 - 503) + '\x31' + chr(0b110111), 0o10), nzTpIcepk0o8(chr(1596 - 1548) + '\157' + chr(0b11010 + 0o31) + '\x32' + '\065', ord("\x08")), nzTpIcepk0o8('\060' + chr(9306 - 9195) + '\062' + '\x31' + chr(0b11010 + 0o31), 64756 - 64748), nzTpIcepk0o8('\060' + '\x6f' + '\062', 16094 - 16086), nzTpIcepk0o8('\060' + chr(0b111000 + 0o67) + '\x33' + chr(625 - 576) + chr(0b110111), 8), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(111) + chr(1940 - 1887) + '\061', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\x32' + chr(0b110100) + '\063', ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001) + '\061' + chr(0b100010 + 0o24), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b1011 + 0o46) + chr(0b110111 + 0o0), 34647 - 34639), nzTpIcepk0o8(chr(48) + '\x6f' + chr(673 - 622) + '\x32' + '\x35', 8), nzTpIcepk0o8('\x30' + chr(473 - 362) + chr(1531 - 1480) + chr(1218 - 1167) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(671 - 618) + '\x36', 8), nzTpIcepk0o8(chr(1386 - 1338) + '\157' + '\x33' + '\x33' + chr(0b110010), ord("\x08")), nzTpIcepk0o8('\x30' + chr(2127 - 2016) + chr(1416 - 1367) + '\067' + chr(53), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1811 - 1758) + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xb8'), '\144' + '\x65' + chr(0b1100011) + chr(10234 - 10123) + '\144' + chr(505 - 404))(chr(117) + chr(3997 - 3881) + chr(0b1100110) + chr(672 - 627) + '\x38') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def NxvmohC5VCXS(hXMPsSrOQzbh): roI3spqORKae(iKLp4UdyhCfx, roI3spqORKae(ES5oEprVxulp(b'\xf1\x88$m\x9c\xd4\xd9\xbbtH\xcd\xf7'), chr(1400 - 1300) + chr(0b1100101) + chr(0b1100011) + chr(0b100000 + 0o117) + '\144' + chr(0b1100101))('\165' + chr(0b1110100) + chr(5415 - 5313) + '\055' + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'\xc4\xacqR\xc4\xc3\xdf\xe3F\x05\xe4\xc2\xab\xf1\xd1\xb6\x89'), '\144' + '\145' + chr(0b1100011) + '\157' + '\x64' + '\x65')(chr(5850 - 5733) + chr(0b1110100) + chr(0b101101 + 0o71) + '\055' + chr(56)), roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xfa\xa6~\\\xfa\xd6\xdf\xe1D'), chr(100) + chr(0b1100101) + chr(99) + chr(111) + chr(0b1001100 + 0o30) + chr(101))(chr(117) + chr(0b1011010 + 0o32) + chr(0b1100110) + chr(0b101101) + chr(56)))) roI3spqORKae(hXMPsSrOQzbh._lock, roI3spqORKae(ES5oEprVxulp(b'\xf7\x9cU]\x90\xf2\xdd\xcf@\x1c\xc7\xe3'), '\x64' + chr(101) + chr(99) + chr(111) + chr(0b1100100) + chr(101))(chr(0b1101000 + 0o15) + chr(0b1011011 + 0o31) + '\146' + chr(0b11010 + 0o23) + '\x38'))() try: roI3spqORKae(aHUqKstZLeS6, roI3spqORKae(ES5oEprVxulp(b'\xe3\xa7q^\xcb\xdb'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(8048 - 7947))(chr(0b101011 + 0o112) + chr(4811 - 4695) + chr(883 - 781) + '\x2d' + chr(56)))(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xfa\xa6~\\\xfa\xd6\xdf\xe1D'), chr(100) + chr(0b1001001 + 0o34) + '\x63' + chr(0b1101111) + chr(0b1011110 + 0o6) + chr(0b1100101))(chr(10890 - 10773) + chr(116) + '\x66' + chr(1394 - 1349) + chr(0b1101 + 0o53)))) except znAfcqx_89tO: pass
MichaelAquilina/S4
s4/utils.py
get_input
def get_input(*args, secret=False, required=False, blank=False, **kwargs): """ secret: Don't show user input when they are typing. required: Keep prompting if the user enters an empty value. blank: turn all empty strings into None. """ while True: if secret: value = getpass.getpass(*args, **kwargs) else: value = input(*args, **kwargs) if blank: value = value if value else None if not required or value: break return value
python
def get_input(*args, secret=False, required=False, blank=False, **kwargs): """ secret: Don't show user input when they are typing. required: Keep prompting if the user enters an empty value. blank: turn all empty strings into None. """ while True: if secret: value = getpass.getpass(*args, **kwargs) else: value = input(*args, **kwargs) if blank: value = value if value else None if not required or value: break return value
[ "def", "get_input", "(", "*", "args", ",", "secret", "=", "False", ",", "required", "=", "False", ",", "blank", "=", "False", ",", "*", "*", "kwargs", ")", ":", "while", "True", ":", "if", "secret", ":", "value", "=", "getpass", ".", "getpass", "(", "*", "args", ",", "*", "*", "kwargs", ")", "else", ":", "value", "=", "input", "(", "*", "args", ",", "*", "*", "kwargs", ")", "if", "blank", ":", "value", "=", "value", "if", "value", "else", "None", "if", "not", "required", "or", "value", ":", "break", "return", "value" ]
secret: Don't show user input when they are typing. required: Keep prompting if the user enters an empty value. blank: turn all empty strings into None.
[ "secret", ":", "Don", "t", "show", "user", "input", "when", "they", "are", "typing", ".", "required", ":", "Keep", "prompting", "if", "the", "user", "enters", "an", "empty", "value", ".", "blank", ":", "turn", "all", "empty", "strings", "into", "None", "." ]
05d74697e6ec683f0329c983f7c3f05ab75fd57e
https://github.com/MichaelAquilina/S4/blob/05d74697e6ec683f0329c983f7c3f05ab75fd57e/s4/utils.py#L17-L36
train
Get user input from the user.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h6aCn31dg,oxjHmq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07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(0b100001 + 0o116) + '\061' + '\063' + chr(0b110001), 50766 - 50758), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(0b1000111 + 0o50) + chr(2847 - 2792) + chr(0b11011 + 0o32), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(0b11101 + 0o25) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(0b10100 + 0o34) + '\x6f' + chr(1291 - 1237) + chr(0b110110), 16762 - 16754), nzTpIcepk0o8(chr(688 - 640) + chr(0b1101111) + '\x31' + '\061' + chr(51), 35862 - 35854), nzTpIcepk0o8('\x30' + '\x6f' + chr(50) + '\061' + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(8530 - 8419) + chr(0b11001 + 0o34) + chr(54), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(236 - 185) + '\x37', 37872 - 37864), nzTpIcepk0o8('\x30' + chr(0b11010 + 0o125) + chr(0b101 + 0o61) + '\061', 56135 - 56127), nzTpIcepk0o8('\060' + chr(111) + chr(1919 - 1869) + chr(54) + '\060', ord("\x08")), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(111) + chr(50) + '\x33' + chr(142 - 91), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x33' + '\x30' + chr(0b100 + 0o55), 53633 - 53625), nzTpIcepk0o8(chr(48) + chr(0b111001 + 0o66) + '\062' + chr(0b110010) + '\x36', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b100000 + 0o117) + chr(1295 - 1241) + chr(0b11110 + 0o23), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b1010 + 0o51) + chr(0b110100) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31' + chr(0b1000 + 0o52) + chr(1633 - 1580), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(51) + '\x37' + '\x36', 0b1000), nzTpIcepk0o8('\060' + '\157' + '\x31' + chr(2293 - 2243) + chr(1774 - 1721), 8), nzTpIcepk0o8(chr(48) + chr(8080 - 7969) + chr(957 - 903) + chr(0b110010), 16360 - 16352), nzTpIcepk0o8(chr(48) + chr(0b11100 + 0o123) + chr(2415 - 2365) + chr(53) + '\060', 39395 - 39387), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b10011 + 0o36) + chr(0b110001) + chr(1408 - 1354), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\061' + '\x36' + '\061', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + '\x32' + chr(811 - 758), 8), nzTpIcepk0o8(chr(48) + chr(0b1100100 + 0o13) + '\061' + chr(1065 - 1014) + chr(49), 8), nzTpIcepk0o8('\x30' + '\157' + chr(1961 - 1912) + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110010) + chr(0b101010 + 0o14) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(111) + chr(0b1000 + 0o52) + '\x31' + chr(2207 - 2153), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(1132 - 1082), 19187 - 19179), nzTpIcepk0o8('\060' + chr(184 - 73) + '\066' + chr(0b110100), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\065' + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(111) + chr(0b110001) + chr(1997 - 1945) + '\x35', 0o10), nzTpIcepk0o8(chr(48) + chr(0b11000 + 0o127) + chr(0b10010 + 0o40) + chr(0b110 + 0o57) + chr(2288 - 2236), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b100000 + 0o23) + chr(1800 - 1750) + chr(50), 0b1000), nzTpIcepk0o8('\060' + '\157' + '\061' + chr(0b110 + 0o61) + '\x33', 38041 - 38033), nzTpIcepk0o8('\060' + chr(10645 - 10534) + '\062' + chr(0b110001), 23830 - 23822), nzTpIcepk0o8(chr(1730 - 1682) + chr(111) + chr(50) + chr(51) + '\062', 36796 - 36788), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b10101 + 0o35) + chr(697 - 643) + chr(0b110 + 0o54), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(53) + '\x30', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + '\x37' + chr(0b1101 + 0o46), 0o10), nzTpIcepk0o8(chr(128 - 80) + '\x6f' + chr(49) + '\060' + '\065', 22692 - 22684)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(0b1000111 + 0o50) + chr(635 - 582) + chr(0b100111 + 0o11), 34746 - 34738)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'w'), '\x64' + chr(101) + chr(0b111010 + 0o51) + '\157' + '\144' + chr(0b11110 + 0o107))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def x0gdAWqTamMg(*eemPYp2vtTSr, _9ox6JQizR7a=nzTpIcepk0o8(chr(0b110000) + chr(111) + '\060', 0b1000), eXn9UCMDSCqp=nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x30', 8), pddVeaT6wWZR=nzTpIcepk0o8(chr(0b11010 + 0o26) + '\x6f' + chr(0b11110 + 0o22), 8), **q5n0sHDDTy90): while nzTpIcepk0o8('\060' + chr(0b1101111) + '\x31', 0b1000): if _9ox6JQizR7a: uV9iBiw0y_Mp = pGekAC70NLX0.getpass(*eemPYp2vtTSr, **q5n0sHDDTy90) else: uV9iBiw0y_Mp = QnTXOd5N96r1(*eemPYp2vtTSr, **q5n0sHDDTy90) if pddVeaT6wWZR: uV9iBiw0y_Mp = uV9iBiw0y_Mp if uV9iBiw0y_Mp else None if not eXn9UCMDSCqp or uV9iBiw0y_Mp: break return uV9iBiw0y_Mp
gazpachoking/jsonref
proxytypes.py
ProxyMetaClass._no_proxy
def _no_proxy(method): """ Returns a wrapped version of `method`, such that proxying is turned off during the method call. """ @wraps(method) def wrapper(self, *args, **kwargs): notproxied = _oga(self, "__notproxied__") _osa(self, "__notproxied__", True) try: return method(self, *args, **kwargs) finally: _osa(self, "__notproxied__", notproxied) return wrapper
python
def _no_proxy(method): """ Returns a wrapped version of `method`, such that proxying is turned off during the method call. """ @wraps(method) def wrapper(self, *args, **kwargs): notproxied = _oga(self, "__notproxied__") _osa(self, "__notproxied__", True) try: return method(self, *args, **kwargs) finally: _osa(self, "__notproxied__", notproxied) return wrapper
[ "def", "_no_proxy", "(", "method", ")", ":", "@", "wraps", "(", "method", ")", "def", "wrapper", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "notproxied", "=", "_oga", "(", "self", ",", "\"__notproxied__\"", ")", "_osa", "(", "self", ",", "\"__notproxied__\"", ",", "True", ")", "try", ":", "return", "method", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", "finally", ":", "_osa", "(", "self", ",", "\"__notproxied__\"", ",", "notproxied", ")", "return", "wrapper" ]
Returns a wrapped version of `method`, such that proxying is turned off during the method call.
[ "Returns", "a", "wrapped", "version", "of", "method", "such", "that", "proxying", "is", "turned", "off", "during", "the", "method", "call", "." ]
066132e527f8115f75bcadfd0eca12f8973a6309
https://github.com/gazpachoking/jsonref/blob/066132e527f8115f75bcadfd0eca12f8973a6309/proxytypes.py#L122-L138
train
Returns a wrapped version of the given method that does not proxy the current object s entry set.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPT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eYozM,MdkNqd1bagO6,QNQS9e6tJqMV,typojWN5Phrq,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(0b1010000 + 0o37) + '\061' + chr(55), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b100110 + 0o15) + chr(51) + chr(0b101011 + 0o14), 0o10), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b1100000 + 0o17) + chr(49) + '\067' + '\x36', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(50) + chr(701 - 650) + '\x33', 0o10), nzTpIcepk0o8('\x30' + chr(1003 - 892) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(111) + chr(0b110010) + chr(2063 - 2013) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(8361 - 8250) + '\066' + chr(0b110011 + 0o3), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(1760 - 1709) + '\x35' + chr(0b110110), 61033 - 61025), nzTpIcepk0o8(chr(0b100010 + 0o16) + '\x6f' + '\063' + chr(1693 - 1644) + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b100011 + 0o17) + chr(0b110000) + '\x37', 28220 - 28212), nzTpIcepk0o8(chr(48) + '\x6f' + chr(55) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b101110 + 0o7) + chr(0b1100 + 0o47), 64205 - 64197), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b110000) + '\060', 0b1000), nzTpIcepk0o8('\060' + chr(4060 - 3949) + chr(0b110010) + '\062' + chr(0b100011 + 0o17), 2167 - 2159), nzTpIcepk0o8(chr(472 - 424) + chr(0b1101111) + '\062' + chr(0b110111) + chr(0b110011), 37177 - 37169), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(111) + chr(0b11011 + 0o26) + chr(0b110110) + chr(0b1 + 0o60), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b10011 + 0o134) + chr(0b110000), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(50) + '\x30' + chr(0b110100), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(48), 8), nzTpIcepk0o8(chr(1085 - 1037) + chr(0b1101111) + '\x31' + chr(428 - 379) + chr(0b110001), 61829 - 61821), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + chr(0b110 + 0o54) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1559 - 1508) + '\065' + chr(49), 32966 - 32958), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(0b101100 + 0o103) + '\062' + chr(49), 32533 - 32525), nzTpIcepk0o8('\x30' + chr(111) + '\061' + chr(0b110001) + chr(0b101101 + 0o4), 8), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(50) + chr(0b110000), 8), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + '\x32' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(2273 - 2225) + '\157' + chr(51) + chr(0b110010) + '\064', 37598 - 37590), nzTpIcepk0o8('\060' + '\157' + chr(365 - 316) + chr(50) + chr(0b1101 + 0o47), 0b1000), nzTpIcepk0o8(chr(266 - 218) + '\157' + chr(50) + '\x34' + '\x35', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\063' + '\x30' + chr(1809 - 1760), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110000 + 0o5) + chr(1332 - 1283), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + chr(976 - 927) + '\060', 0b1000), nzTpIcepk0o8(chr(170 - 122) + chr(0b1101111) + chr(50) + chr(0b100010 + 0o23) + '\x31', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b111010 + 0o65) + chr(0b110011) + chr(535 - 480) + '\x34', 55772 - 55764), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + '\067', 0b1000), nzTpIcepk0o8(chr(0b110 + 0o52) + '\x6f' + chr(49) + chr(2011 - 1957) + chr(0b110001), 8), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(50) + chr(53), 37552 - 37544), nzTpIcepk0o8(chr(48) + '\x6f' + chr(52) + chr(53), 59566 - 59558), nzTpIcepk0o8(chr(48) + '\x6f' + '\x35' + chr(55), ord("\x08")), nzTpIcepk0o8('\x30' + chr(1817 - 1706) + chr(50) + chr(48) + chr(0b11 + 0o61), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(6445 - 6334) + chr(53) + '\x30', ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'!'), chr(0b1001011 + 0o31) + '\145' + '\x63' + chr(1296 - 1185) + chr(7059 - 6959) + '\x65')(chr(7443 - 7326) + chr(0b1110100) + '\146' + chr(0b101101) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def PQ_Oq3P8RXyO(e5rcHW8hR5dL): @pyQaWxg2ZDJP(e5rcHW8hR5dL) def uN64ftXQVLOv(hXMPsSrOQzbh, *eemPYp2vtTSr, **q5n0sHDDTy90): UWRoGyvOXivF = MXUbosceR0Xr(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'P\x80\x10\xf4s\xe0D\x81\xb3\xee]O\x1f\xcd'), chr(100) + chr(101) + chr(6164 - 6065) + chr(291 - 180) + '\x64' + chr(0b1101 + 0o130))('\165' + chr(4778 - 4662) + chr(676 - 574) + chr(0b111 + 0o46) + chr(0b11 + 0o65))) MnjYs2Q8rH6Z(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'P\x80\x10\xf4s\xe0D\x81\xb3\xee]O\x1f\xcd'), chr(100) + chr(101) + chr(99) + '\157' + chr(100) + chr(168 - 67))(chr(6878 - 6761) + '\x74' + chr(102) + chr(0b101101) + chr(0b111000)), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b1010 + 0o47), 0o10)) try: return e5rcHW8hR5dL(hXMPsSrOQzbh, *eemPYp2vtTSr, **q5n0sHDDTy90) finally: MnjYs2Q8rH6Z(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'P\x80\x10\xf4s\xe0D\x81\xb3\xee]O\x1f\xcd'), '\x64' + chr(0b100011 + 0o102) + chr(99) + chr(0b1010010 + 0o35) + chr(100) + '\145')(chr(0b1110101) + chr(0b1110100) + '\146' + '\x2d' + chr(0b11011 + 0o35)), UWRoGyvOXivF) return uN64ftXQVLOv
gazpachoking/jsonref
proxytypes.py
Proxy._should_proxy
def _should_proxy(self, attr): """ Determines whether `attr` should be looked up on the proxied object, or the proxy itself. """ if attr in type(self).__notproxied__: return False if _oga(self, "__notproxied__") is True: return False return True
python
def _should_proxy(self, attr): """ Determines whether `attr` should be looked up on the proxied object, or the proxy itself. """ if attr in type(self).__notproxied__: return False if _oga(self, "__notproxied__") is True: return False return True
[ "def", "_should_proxy", "(", "self", ",", "attr", ")", ":", "if", "attr", "in", "type", "(", "self", ")", ".", "__notproxied__", ":", "return", "False", "if", "_oga", "(", "self", ",", "\"__notproxied__\"", ")", "is", "True", ":", "return", "False", "return", "True" ]
Determines whether `attr` should be looked up on the proxied object, or the proxy itself.
[ "Determines", "whether", "attr", "should", "be", "looked", "up", "on", "the", "proxied", "object", "or", "the", "proxy", "itself", "." ]
066132e527f8115f75bcadfd0eca12f8973a6309
https://github.com/gazpachoking/jsonref/blob/066132e527f8115f75bcadfd0eca12f8973a6309/proxytypes.py#L161-L171
train
Determines whether the attribute attr should be looked up on the proxied object or not.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV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aRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b100000 + 0o117) + chr(1334 - 1279) + chr(1201 - 1153), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(0b110001) + chr(0b110110) + chr(0b110110), 0o10), nzTpIcepk0o8('\x30' + '\157' + '\x33' + chr(0b1101 + 0o44) + chr(1078 - 1028), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + chr(0b1010 + 0o55) + '\063', 0b1000), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(111) + chr(0b110001) + chr(0b110001) + '\x35', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(8510 - 8399) + chr(0b110010) + chr(0b111 + 0o52) + '\x33', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(51) + chr(0b110001) + chr(53), 40912 - 40904), nzTpIcepk0o8(chr(0b110000) + chr(3815 - 3704) + '\061' + chr(0b110011) + chr(146 - 97), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(54) + chr(764 - 709), 0b1000), nzTpIcepk0o8(chr(0b101 + 0o53) + '\157' + chr(0b1001 + 0o51) + chr(2267 - 2216), 18734 - 18726), nzTpIcepk0o8('\060' + chr(111) + chr(0b110001) + chr(0b1100 + 0o52) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x33' + chr(49) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1908 - 1853) + chr(149 - 98), 0o10), nzTpIcepk0o8('\060' + chr(0b101 + 0o152) + chr(1119 - 1068) + '\060' + chr(49), 283 - 275), nzTpIcepk0o8('\x30' + chr(11336 - 11225) + '\x31' + chr(51) + '\x36', 0b1000), nzTpIcepk0o8('\x30' + chr(3716 - 3605) + chr(0b101101 + 0o5) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1001000 + 0o47) + '\x33' + '\062' + '\x31', 0b1000), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(111) + chr(0b110011) + '\061' + '\x31', 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(50) + chr(0b1101 + 0o50) + '\060', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(2782 - 2729) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(2725 - 2614) + chr(50) + chr(48) + chr(0b110001 + 0o3), 13519 - 13511), nzTpIcepk0o8(chr(1822 - 1774) + chr(0b1011001 + 0o26) + chr(0b1 + 0o63) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110010) + '\x31' + '\x37', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + chr(0b110101) + chr(0b101100 + 0o4), 34979 - 34971), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(0b1000001 + 0o56) + '\x33' + chr(0b110101) + '\x31', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x33', 18137 - 18129), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(111) + chr(2011 - 1960) + '\063' + chr(0b110100), 0b1000), nzTpIcepk0o8('\060' + '\157' + '\063' + chr(1412 - 1357) + chr(53), 0b1000), nzTpIcepk0o8(chr(2169 - 2121) + chr(0b1101111) + chr(0b111 + 0o53) + chr(0b111 + 0o55) + chr(54), 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\063' + chr(0b101111 + 0o3) + chr(54), 0o10), nzTpIcepk0o8(chr(48) + chr(3894 - 3783) + '\062' + '\x37', 0b1000), nzTpIcepk0o8(chr(504 - 456) + '\x6f' + chr(515 - 464) + chr(1281 - 1231) + chr(0b110001), 8), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + '\x33' + chr(54), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(51) + '\x31' + '\063', 0b1000), nzTpIcepk0o8('\060' + chr(9641 - 9530) + chr(0b10 + 0o61) + chr(0b110100) + chr(914 - 861), 45327 - 45319), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b101110 + 0o7) + '\063', 33206 - 33198), nzTpIcepk0o8(chr(0b110000) + chr(0b111011 + 0o64) + chr(0b110010) + '\063' + chr(0b101010 + 0o15), 0b1000), nzTpIcepk0o8(chr(48) + chr(9707 - 9596) + chr(1920 - 1872), 13765 - 13757), nzTpIcepk0o8('\x30' + chr(0b101010 + 0o105) + chr(1607 - 1557) + '\x33' + chr(0b110100), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(0b1101 + 0o142) + chr(0b110101) + chr(2041 - 1993), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x16'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(2494 - 2383) + chr(0b1010110 + 0o16) + chr(0b1100101))(chr(4734 - 4617) + '\x74' + chr(2399 - 2297) + chr(0b101101) + chr(0b10111 + 0o41)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def B6J9V9evX_io(hXMPsSrOQzbh, H7gzb3fKphmE): if H7gzb3fKphmE in roI3spqORKae(MJ07XsN5uFgW(hXMPsSrOQzbh), roI3spqORKae(ES5oEprVxulp(b'g)\xa4\x949\xfb\xbf6Oz\x11\xabd\x9e'), chr(0b1100100) + chr(0b1100101) + chr(5332 - 5233) + chr(0b1101111) + chr(8797 - 8697) + chr(0b111001 + 0o54))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(635 - 579))): return nzTpIcepk0o8(chr(2111 - 2063) + '\157' + chr(48), 8) if MXUbosceR0Xr(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'g)\xa4\x949\xfb\xbf6Oz\x11\xabd\x9e'), '\144' + chr(0b1000001 + 0o44) + chr(0b100101 + 0o76) + chr(0b1101111) + chr(100) + chr(101))('\165' + chr(116) + chr(0b101001 + 0o75) + '\055' + chr(0b111000))) is nzTpIcepk0o8('\x30' + chr(0b10011 + 0o134) + chr(0b10110 + 0o33), 0b1000): return nzTpIcepk0o8(chr(0b101111 + 0o1) + '\x6f' + '\060', 8) return nzTpIcepk0o8(chr(0b101011 + 0o5) + '\x6f' + '\x31', 8)
gazpachoking/jsonref
proxytypes.py
Proxy.add_proxy_meth
def add_proxy_meth(cls, name, func, arg_pos=0): """ Add a method `name` to the class, which returns the value of `func`, called with the proxied value inserted at `arg_pos` """ @wraps(func) def proxied(self, *args, **kwargs): args = list(args) args.insert(arg_pos, self.__subject__) result = func(*args, **kwargs) return result setattr(cls, name, proxied)
python
def add_proxy_meth(cls, name, func, arg_pos=0): """ Add a method `name` to the class, which returns the value of `func`, called with the proxied value inserted at `arg_pos` """ @wraps(func) def proxied(self, *args, **kwargs): args = list(args) args.insert(arg_pos, self.__subject__) result = func(*args, **kwargs) return result setattr(cls, name, proxied)
[ "def", "add_proxy_meth", "(", "cls", ",", "name", ",", "func", ",", "arg_pos", "=", "0", ")", ":", "@", "wraps", "(", "func", ")", "def", "proxied", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "args", "=", "list", "(", "args", ")", "args", ".", "insert", "(", "arg_pos", ",", "self", ".", "__subject__", ")", "result", "=", "func", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "result", "setattr", "(", "cls", ",", "name", ",", "proxied", ")" ]
Add a method `name` to the class, which returns the value of `func`, called with the proxied value inserted at `arg_pos`
[ "Add", "a", "method", "name", "to", "the", "class", "which", "returns", "the", "value", "of", "func", "called", "with", "the", "proxied", "value", "inserted", "at", "arg_pos" ]
066132e527f8115f75bcadfd0eca12f8973a6309
https://github.com/gazpachoking/jsonref/blob/066132e527f8115f75bcadfd0eca12f8973a6309/proxytypes.py#L192-L206
train
Add a method name to the class which returns the value of func called at arg_pos.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT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r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + '\x6f' + chr(51) + chr(0b100101 + 0o17) + chr(49), 13270 - 13262), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + chr(0b101111 + 0o5) + '\063', 0o10), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(0b1101111) + chr(0b100111 + 0o13) + '\065' + '\x35', 0o10), nzTpIcepk0o8('\060' + chr(0b101100 + 0o103) + '\063' + '\065' + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(678 - 629) + '\062' + chr(0b100010 + 0o22), 0o10), nzTpIcepk0o8(chr(1610 - 1562) + '\x6f' + chr(0b1110 + 0o46) + chr(144 - 96), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(471 - 420) + '\064' + chr(0b110111), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101110 + 0o1) + chr(0b101001 + 0o12) + '\x36' + chr(0b110101), 0o10), nzTpIcepk0o8(chr(1314 - 1266) + '\157' + chr(50) + '\065' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(216 - 168) + chr(0b1010 + 0o145) + '\061' + '\x33' + '\065', 51424 - 51416), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b10001 + 0o40) + '\x31', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1001001 + 0o46) + chr(50) + chr(475 - 421) + '\067', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\x32' + '\x30' + chr(0b100111 + 0o17), ord("\x08")), nzTpIcepk0o8('\x30' + chr(1506 - 1395) + chr(0b11000 + 0o33) + chr(2569 - 2514), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(50) + chr(48) + chr(1884 - 1829), 57650 - 57642), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + '\064' + chr(0b110 + 0o56), 48496 - 48488), nzTpIcepk0o8('\060' + chr(12075 - 11964) + '\x31' + '\066' + chr(0b1011 + 0o51), 63216 - 63208), nzTpIcepk0o8(chr(1736 - 1688) + chr(0b1111 + 0o140) + chr(49) + '\060' + chr(0b10110 + 0o41), 54984 - 54976), nzTpIcepk0o8(chr(2083 - 2035) + chr(0b1101111) + '\063' + chr(0b110110), 0o10), nzTpIcepk0o8('\060' + chr(3298 - 3187) + '\x32' + chr(49) + chr(52), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\062' + chr(52) + chr(799 - 744), 0o10), nzTpIcepk0o8('\060' + chr(5847 - 5736) + chr(0b11111 + 0o23) + chr(0b110011) + chr(0b11000 + 0o32), 0o10), nzTpIcepk0o8('\x30' + chr(0b100010 + 0o115) + '\x32' + chr(0b110011 + 0o4) + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(0b110100) + '\064', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(51) + chr(0b110100) + '\x30', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1010110 + 0o31) + chr(50) + '\x36' + '\x30', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(2839 - 2728) + chr(50) + chr(48), ord("\x08")), nzTpIcepk0o8('\x30' + chr(5823 - 5712) + '\061' + '\x31' + chr(0b1111 + 0o50), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1903 - 1849) + '\x36', ord("\x08")), nzTpIcepk0o8('\060' + chr(4382 - 4271) + '\063' + '\x30' + chr(0b110100), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\x31' + chr(0b110100) + chr(432 - 378), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b101000 + 0o11), 47096 - 47088), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(111) + '\x33' + '\061' + chr(53), 40031 - 40023), nzTpIcepk0o8('\x30' + chr(9948 - 9837) + '\x32' + chr(1750 - 1700) + '\063', 54032 - 54024), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b10011 + 0o40) + chr(1390 - 1339) + '\065', 42083 - 42075), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b101111 + 0o10) + '\064', 22987 - 22979), nzTpIcepk0o8('\060' + '\x6f' + chr(0b101100 + 0o7) + chr(0b110010) + '\061', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b101001 + 0o106) + chr(929 - 878) + '\066' + chr(49), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + '\066' + chr(0b110101 + 0o0), 8), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b11 + 0o60) + chr(0b11110 + 0o27) + chr(0b110110), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(2641 - 2588) + '\060', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xcf'), chr(8804 - 8704) + chr(0b101110 + 0o67) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(5466 - 5365))('\x75' + '\x74' + chr(102) + '\x2d' + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def hRAATuMEILvC(_1vzISbJ_R2i, SLVB2BPA_mIe, h0klhChk4Vv6, ShegThOYVtOs=nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(419 - 371), ord("\x08"))): @pyQaWxg2ZDJP(h0klhChk4Vv6) def W39_bgnlersL(hXMPsSrOQzbh, *eemPYp2vtTSr, **q5n0sHDDTy90): eemPYp2vtTSr = H4NoA26ON7iG(eemPYp2vtTSr) roI3spqORKae(eemPYp2vtTSr, roI3spqORKae(ES5oEprVxulp(b'\x88\xcd\xde\x89&T'), chr(0b1010001 + 0o23) + chr(0b100 + 0o141) + chr(8465 - 8366) + chr(0b1101111) + '\x64' + chr(101))(chr(0b1110101) + chr(1982 - 1866) + '\x66' + chr(1564 - 1519) + '\x38'))(ShegThOYVtOs, roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xbe\xfc\xde\x996J\x82\x96\xdc\x02V'), chr(100) + chr(1386 - 1285) + '\143' + chr(0b1001000 + 0o47) + chr(0b1100100) + chr(101))('\x75' + '\164' + chr(0b1100110) + '\055' + chr(0b111000)))) POx95m7SPOVy = h0klhChk4Vv6(*eemPYp2vtTSr, **q5n0sHDDTy90) return POx95m7SPOVy lCf1uzpaIUMv(_1vzISbJ_R2i, SLVB2BPA_mIe, W39_bgnlersL)
gazpachoking/jsonref
jsonref.py
load
def load(fp, base_uri="", loader=None, jsonschema=False, load_on_repr=True, **kwargs): """ Drop in replacement for :func:`json.load`, where JSON references are proxied to their referent data. :param fp: File-like object containing JSON document :param kwargs: This function takes any of the keyword arguments from :meth:`JsonRef.replace_refs`. Any other keyword arguments will be passed to :func:`json.load` """ if loader is None: loader = functools.partial(jsonloader, **kwargs) return JsonRef.replace_refs( json.load(fp, **kwargs), base_uri=base_uri, loader=loader, jsonschema=jsonschema, load_on_repr=load_on_repr, )
python
def load(fp, base_uri="", loader=None, jsonschema=False, load_on_repr=True, **kwargs): """ Drop in replacement for :func:`json.load`, where JSON references are proxied to their referent data. :param fp: File-like object containing JSON document :param kwargs: This function takes any of the keyword arguments from :meth:`JsonRef.replace_refs`. Any other keyword arguments will be passed to :func:`json.load` """ if loader is None: loader = functools.partial(jsonloader, **kwargs) return JsonRef.replace_refs( json.load(fp, **kwargs), base_uri=base_uri, loader=loader, jsonschema=jsonschema, load_on_repr=load_on_repr, )
[ "def", "load", "(", "fp", ",", "base_uri", "=", "\"\"", ",", "loader", "=", "None", ",", "jsonschema", "=", "False", ",", "load_on_repr", "=", "True", ",", "*", "*", "kwargs", ")", ":", "if", "loader", "is", "None", ":", "loader", "=", "functools", ".", "partial", "(", "jsonloader", ",", "*", "*", "kwargs", ")", "return", "JsonRef", ".", "replace_refs", "(", "json", ".", "load", "(", "fp", ",", "*", "*", "kwargs", ")", ",", "base_uri", "=", "base_uri", ",", "loader", "=", "loader", ",", "jsonschema", "=", "jsonschema", ",", "load_on_repr", "=", "load_on_repr", ",", ")" ]
Drop in replacement for :func:`json.load`, where JSON references are proxied to their referent data. :param fp: File-like object containing JSON document :param kwargs: This function takes any of the keyword arguments from :meth:`JsonRef.replace_refs`. Any other keyword arguments will be passed to :func:`json.load`
[ "Drop", "in", "replacement", "for", ":", "func", ":", "json", ".", "load", "where", "JSON", "references", "are", "proxied", "to", "their", "referent", "data", "." ]
066132e527f8115f75bcadfd0eca12f8973a6309
https://github.com/gazpachoking/jsonref/blob/066132e527f8115f75bcadfd0eca12f8973a6309/jsonref.py#L324-L345
train
Load a JSON document into a new object.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23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oXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(0b100 + 0o153) + chr(50) + chr(351 - 299) + chr(53), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\x32' + chr(605 - 554) + chr(51), 0b1000), nzTpIcepk0o8(chr(0b10010 + 0o36) + '\157' + '\x32' + '\062' + chr(0b11100 + 0o26), 0o10), nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(0b1000101 + 0o52) + chr(0b101101 + 0o5) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(6602 - 6491) + '\061' + '\x31' + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(1366 - 1318) + '\x6f' + chr(50) + chr(0b110010), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + chr(51) + chr(777 - 728), 0o10), nzTpIcepk0o8('\x30' + '\157' + '\x32', 0b1000), nzTpIcepk0o8(chr(0b100 + 0o54) + '\157' + '\x33' + chr(0b11001 + 0o31) + chr(0b110110), 14562 - 14554), nzTpIcepk0o8(chr(0b110000) + chr(7053 - 6942) + '\063' + '\x35' + '\x31', 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\x32' + chr(0b110011) + '\x37', 45126 - 45118), nzTpIcepk0o8(chr(0b10000 + 0o40) + '\157' + '\067' + '\062', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b11111 + 0o22) + chr(0b10000 + 0o41) + chr(0b110100), 12181 - 12173), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(1942 - 1892) + chr(0b100010 + 0o17), 1315 - 1307), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(111) + '\x31' + '\064' + '\x30', 47789 - 47781), nzTpIcepk0o8(chr(122 - 74) + chr(0b1101111) + '\061' + chr(0b100 + 0o61), 42947 - 42939), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + '\060' + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(8347 - 8236) + chr(0b110001) + '\x32' + chr(106 - 55), 7078 - 7070), nzTpIcepk0o8(chr(833 - 785) + chr(0b1101111) + chr(0b110010) + chr(0b0 + 0o60) + chr(0b101101 + 0o5), 0b1000), nzTpIcepk0o8(chr(1941 - 1893) + chr(111) + chr(52) + '\062', 5311 - 5303), nzTpIcepk0o8('\x30' + chr(6467 - 6356) + chr(1584 - 1535) + chr(0b110110) + chr(1101 - 1046), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + '\x33' + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(6218 - 6107) + chr(943 - 894) + chr(0b110001) + '\x30', 5068 - 5060), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b1101111) + chr(0b110010) + chr(0b10 + 0o65) + chr(0b100100 + 0o22), 0o10), nzTpIcepk0o8('\x30' + chr(10231 - 10120) + chr(50) + chr(0b110111) + chr(0b110100 + 0o3), 0b1000), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(111) + chr(50) + '\x30' + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(1531 - 1483) + '\x6f' + '\061' + '\064' + '\x32', ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\x32' + '\x31' + '\x35', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x33' + '\x33' + chr(0b11101 + 0o23), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(49) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(1065 - 1017) + '\x6f' + '\061' + chr(51) + chr(52), 0b1000), nzTpIcepk0o8(chr(989 - 941) + chr(111) + chr(0b11101 + 0o26) + chr(427 - 378) + chr(0b110101), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\061' + '\x32' + '\x35', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1074 - 1022) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(8538 - 8427) + '\062' + '\x32' + chr(54), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(55) + '\x37', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(51) + '\x37' + chr(2005 - 1951), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(51) + chr(0b110100) + '\065', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\062' + chr(1494 - 1443) + '\064', 49408 - 49400), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011) + chr(0b110100) + chr(49), 8101 - 8093)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b10 + 0o63) + chr(941 - 893), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x8b'), '\x64' + chr(9762 - 9661) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(0b1011100 + 0o31) + chr(3047 - 2931) + '\146' + '\055' + chr(0b110000 + 0o10)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def ZERsdc7c1d8E(KhXPEIWBXQzE, hR_RmTaH7vOp=roI3spqORKae(ES5oEprVxulp(b''), '\x64' + '\145' + chr(99) + chr(111) + '\x64' + '\x65')(chr(143 - 26) + '\164' + '\146' + '\x2d' + chr(2260 - 2204)), lZ5890bTFMci=None, NaZezbzRqEZa=nzTpIcepk0o8('\060' + chr(111) + chr(960 - 912), 0b1000), Kv4an4SEKtxD=nzTpIcepk0o8(chr(48) + chr(8669 - 8558) + chr(49), 0o10), **q5n0sHDDTy90): if lZ5890bTFMci is None: lZ5890bTFMci = NveCASsculZA.v_5JLGL_2DSR(cxBgC2Hxdi7L, **q5n0sHDDTy90) return roI3spqORKae(cfqH2Mfd6h3I, roI3spqORKae(ES5oEprVxulp(b'\xd7\xfe\xe2{*q<]\xa4\x8c\xf9I'), chr(0b1010111 + 0o15) + chr(0b1100101) + chr(99) + '\157' + chr(0b1100100) + '\145')('\165' + '\164' + '\146' + chr(45) + chr(56)))(roI3spqORKae(LNUKEwZDIbyb, roI3spqORKae(ES5oEprVxulp(b'\xff\xde\xc0d/qna\xe7\x8d\xa7\x7f'), '\x64' + chr(101) + chr(99) + chr(111) + chr(100) + '\x65')(chr(0b1101101 + 0o10) + chr(116) + '\146' + chr(45) + chr(0b111000)))(KhXPEIWBXQzE, **q5n0sHDDTy90), base_uri=hR_RmTaH7vOp, loader=lZ5890bTFMci, jsonschema=NaZezbzRqEZa, load_on_repr=Kv4an4SEKtxD)
gazpachoking/jsonref
jsonref.py
loads
def loads(s, base_uri="", loader=None, jsonschema=False, load_on_repr=True, **kwargs): """ Drop in replacement for :func:`json.loads`, where JSON references are proxied to their referent data. :param s: String containing JSON document :param kwargs: This function takes any of the keyword arguments from :meth:`JsonRef.replace_refs`. Any other keyword arguments will be passed to :func:`json.loads` """ if loader is None: loader = functools.partial(jsonloader, **kwargs) return JsonRef.replace_refs( json.loads(s, **kwargs), base_uri=base_uri, loader=loader, jsonschema=jsonschema, load_on_repr=load_on_repr, )
python
def loads(s, base_uri="", loader=None, jsonschema=False, load_on_repr=True, **kwargs): """ Drop in replacement for :func:`json.loads`, where JSON references are proxied to their referent data. :param s: String containing JSON document :param kwargs: This function takes any of the keyword arguments from :meth:`JsonRef.replace_refs`. Any other keyword arguments will be passed to :func:`json.loads` """ if loader is None: loader = functools.partial(jsonloader, **kwargs) return JsonRef.replace_refs( json.loads(s, **kwargs), base_uri=base_uri, loader=loader, jsonschema=jsonschema, load_on_repr=load_on_repr, )
[ "def", "loads", "(", "s", ",", "base_uri", "=", "\"\"", ",", "loader", "=", "None", ",", "jsonschema", "=", "False", ",", "load_on_repr", "=", "True", ",", "*", "*", "kwargs", ")", ":", "if", "loader", "is", "None", ":", "loader", "=", "functools", ".", "partial", "(", "jsonloader", ",", "*", "*", "kwargs", ")", "return", "JsonRef", ".", "replace_refs", "(", "json", ".", "loads", "(", "s", ",", "*", "*", "kwargs", ")", ",", "base_uri", "=", "base_uri", ",", "loader", "=", "loader", ",", "jsonschema", "=", "jsonschema", ",", "load_on_repr", "=", "load_on_repr", ",", ")" ]
Drop in replacement for :func:`json.loads`, where JSON references are proxied to their referent data. :param s: String containing JSON document :param kwargs: This function takes any of the keyword arguments from :meth:`JsonRef.replace_refs`. Any other keyword arguments will be passed to :func:`json.loads`
[ "Drop", "in", "replacement", "for", ":", "func", ":", "json", ".", "loads", "where", "JSON", "references", "are", "proxied", "to", "their", "referent", "data", "." ]
066132e527f8115f75bcadfd0eca12f8973a6309
https://github.com/gazpachoking/jsonref/blob/066132e527f8115f75bcadfd0eca12f8973a6309/jsonref.py#L348-L369
train
Returns a new JSON document from the given string.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h6aCn31dg,oxjHmqoBrCHG,GA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W,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(3700 - 3589) + chr(1786 - 1736) + '\064' + chr(1385 - 1337), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + chr(52) + '\063', ord("\x08")), nzTpIcepk0o8(chr(1601 - 1553) + '\157' + chr(0b10111 + 0o37), 9576 - 9568), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(2200 - 2151) + chr(1721 - 1671) + '\066', 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\062' + chr(0b110111) + chr(0b110011), 48919 - 48911), nzTpIcepk0o8('\x30' + '\157' + chr(1895 - 1844) + chr(0b110000 + 0o1) + '\x33', 0b1000), nzTpIcepk0o8(chr(1257 - 1209) + chr(111) + chr(1906 - 1857) + '\067' + chr(0b101010 + 0o12), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b101011 + 0o10) + chr(0b100110 + 0o15) + '\x31', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + '\x36' + '\x37', 0b1000), nzTpIcepk0o8('\060' + '\157' + '\062' + '\x37' + chr(2610 - 2555), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + chr(0b100111 + 0o20) + '\062', ord("\x08")), nzTpIcepk0o8(chr(1625 - 1577) + chr(111) + chr(50) + '\060' + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(0b1111 + 0o140) + chr(0b100 + 0o56) + chr(0b100011 + 0o17) + '\067', ord("\x08")), nzTpIcepk0o8(chr(345 - 297) + '\x6f' + '\x32' + '\x31' + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + chr(49) + chr(0b100111 + 0o12), 0b1000), nzTpIcepk0o8(chr(1515 - 1467) + chr(111) + chr(2236 - 2185) + chr(0b110101 + 0o0) + chr(0b1 + 0o57), 0b1000), nzTpIcepk0o8(chr(1134 - 1086) + chr(0b1101111) + '\x32' + '\065' + chr(485 - 434), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\x34' + '\066', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1001000 + 0o47) + chr(2144 - 2094) + chr(0b110111) + chr(1557 - 1509), 0o10), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\x6f' + chr(1321 - 1272) + chr(661 - 612) + '\x32', 57812 - 57804), nzTpIcepk0o8('\x30' + '\x6f' + chr(50) + '\060' + chr(413 - 360), ord("\x08")), nzTpIcepk0o8(chr(2243 - 2195) + chr(4359 - 4248) + '\061' + chr(700 - 648) + '\x34', 31584 - 31576), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(2554 - 2503) + chr(0b110100) + chr(0b110010), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x31' + '\064' + '\x37', 0o10), nzTpIcepk0o8(chr(0b100110 + 0o12) + '\x6f' + '\x33' + '\064' + chr(1630 - 1579), ord("\x08")), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b1101111) + '\x31' + chr(0b110110) + chr(52), 19431 - 19423), nzTpIcepk0o8(chr(48) + chr(111) + chr(1852 - 1801) + chr(1908 - 1860) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b101100 + 0o11) + chr(52), 0o10), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b100 + 0o153) + chr(0b110001) + chr(48) + chr(0b10100 + 0o35), 0o10), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(0b1101111) + '\x31' + chr(50) + chr(54), 8), nzTpIcepk0o8(chr(2073 - 2025) + chr(111) + chr(0b110101) + chr(0b101101 + 0o3), 5887 - 5879), nzTpIcepk0o8(chr(0b110000) + chr(0b100011 + 0o114) + chr(0b110001) + chr(49) + chr(508 - 457), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(620 - 570) + chr(2235 - 2181) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1025 - 974) + chr(1219 - 1170) + chr(0b110011), 8), nzTpIcepk0o8(chr(48) + chr(4012 - 3901) + chr(0b101011 + 0o7) + '\x33' + chr(974 - 924), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110100 + 0o0) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(730 - 682) + chr(7034 - 6923) + chr(1293 - 1243) + chr(52) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(1753 - 1705) + chr(0b1101111) + chr(1522 - 1473) + chr(2702 - 2649) + chr(0b101110 + 0o7), 4711 - 4703), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110001) + '\x36', 0o10), nzTpIcepk0o8('\x30' + chr(0b111010 + 0o65) + chr(0b10100 + 0o35) + '\x36' + chr(0b10011 + 0o36), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(111) + '\065' + chr(0b1100 + 0o44), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x8e'), chr(0b11100 + 0o110) + chr(101) + '\143' + chr(0b1101111) + chr(100) + chr(6739 - 6638))('\x75' + chr(116) + chr(0b1010111 + 0o17) + '\x2d' + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def OiapAM4bM0Ea(PmE5_h409JAA, hR_RmTaH7vOp=roI3spqORKae(ES5oEprVxulp(b''), chr(3083 - 2983) + chr(0b1100101) + '\143' + chr(111) + chr(0b1100100) + '\x65')('\x75' + '\x74' + chr(0b1100110) + '\055' + chr(0b10000 + 0o50)), lZ5890bTFMci=None, NaZezbzRqEZa=nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b10001 + 0o37), 0o10), Kv4an4SEKtxD=nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(49), 8922 - 8914), **q5n0sHDDTy90): if lZ5890bTFMci is None: lZ5890bTFMci = NveCASsculZA.v_5JLGL_2DSR(cxBgC2Hxdi7L, **q5n0sHDDTy90) return roI3spqORKae(cfqH2Mfd6h3I, roI3spqORKae(ES5oEprVxulp(b'\xd2\x06v:\xda\xa8\x19\x86\x05\xda\x9c\xf4'), chr(0b1000111 + 0o35) + '\145' + chr(0b1010010 + 0o21) + chr(0b1101111) + chr(0b1100100) + chr(8999 - 8898))(chr(0b1110101) + chr(0b10 + 0o162) + chr(0b1011110 + 0o10) + chr(0b101 + 0o50) + '\x38'))(roI3spqORKae(LNUKEwZDIbyb, roI3spqORKae(ES5oEprVxulp(b'\xef\ng&\xfa\x86H\xbb:\x8f\xbf\xe6'), chr(0b1001001 + 0o33) + chr(0b1100101) + chr(0b10000 + 0o123) + chr(0b1101111) + chr(100) + chr(0b1100101))('\165' + chr(116) + chr(0b1100110) + '\055' + '\x38'))(PmE5_h409JAA, **q5n0sHDDTy90), base_uri=hR_RmTaH7vOp, loader=lZ5890bTFMci, jsonschema=NaZezbzRqEZa, load_on_repr=Kv4an4SEKtxD)
gazpachoking/jsonref
jsonref.py
load_uri
def load_uri(uri, base_uri=None, loader=None, jsonschema=False, load_on_repr=True): """ Load JSON data from ``uri`` with JSON references proxied to their referent data. :param uri: URI to fetch the JSON from :param kwargs: This function takes any of the keyword arguments from :meth:`JsonRef.replace_refs` """ if loader is None: loader = jsonloader if base_uri is None: base_uri = uri return JsonRef.replace_refs( loader(uri), base_uri=base_uri, loader=loader, jsonschema=jsonschema, load_on_repr=load_on_repr, )
python
def load_uri(uri, base_uri=None, loader=None, jsonschema=False, load_on_repr=True): """ Load JSON data from ``uri`` with JSON references proxied to their referent data. :param uri: URI to fetch the JSON from :param kwargs: This function takes any of the keyword arguments from :meth:`JsonRef.replace_refs` """ if loader is None: loader = jsonloader if base_uri is None: base_uri = uri return JsonRef.replace_refs( loader(uri), base_uri=base_uri, loader=loader, jsonschema=jsonschema, load_on_repr=load_on_repr, )
[ "def", "load_uri", "(", "uri", ",", "base_uri", "=", "None", ",", "loader", "=", "None", ",", "jsonschema", "=", "False", ",", "load_on_repr", "=", "True", ")", ":", "if", "loader", "is", "None", ":", "loader", "=", "jsonloader", "if", "base_uri", "is", "None", ":", "base_uri", "=", "uri", "return", "JsonRef", ".", "replace_refs", "(", "loader", "(", "uri", ")", ",", "base_uri", "=", "base_uri", ",", "loader", "=", "loader", ",", "jsonschema", "=", "jsonschema", ",", "load_on_repr", "=", "load_on_repr", ",", ")" ]
Load JSON data from ``uri`` with JSON references proxied to their referent data. :param uri: URI to fetch the JSON from :param kwargs: This function takes any of the keyword arguments from :meth:`JsonRef.replace_refs`
[ "Load", "JSON", "data", "from", "uri", "with", "JSON", "references", "proxied", "to", "their", "referent", "data", "." ]
066132e527f8115f75bcadfd0eca12f8973a6309
https://github.com/gazpachoking/jsonref/blob/066132e527f8115f75bcadfd0eca12f8973a6309/jsonref.py#L372-L394
train
Load JSON data from URI with JSON references proxied to their referent data.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJp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S24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1100111 + 0o10) + chr(604 - 554) + chr(0b10010 + 0o43) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110101) + chr(2490 - 2435), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\x32' + chr(0b110 + 0o61) + '\x37', 0b1000), nzTpIcepk0o8(chr(1766 - 1718) + chr(0b1101111) + chr(0b11001 + 0o32) + chr(723 - 671) + chr(0b100011 + 0o21), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110001) + chr(0b110111) + chr(0b1 + 0o63), 45580 - 45572), nzTpIcepk0o8('\x30' + chr(111) + '\061' + '\x37' + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(10445 - 10334) + chr(645 - 594) + chr(1633 - 1578) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b100101 + 0o112) + chr(0b110010) + '\x30' + '\061', 37193 - 37185), nzTpIcepk0o8(chr(48) + chr(6730 - 6619) + chr(51) + chr(254 - 204) + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(0b10000 + 0o137) + chr(1247 - 1192) + '\060', ord("\x08")), nzTpIcepk0o8('\060' + chr(7987 - 7876) + chr(0b1101 + 0o45) + '\x32' + chr(55), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b111010 + 0o65) + chr(848 - 799) + chr(640 - 586) + chr(0b110001), 0o10), nzTpIcepk0o8(chr(1902 - 1854) + '\157' + chr(0b110010) + chr(0b110001), 39089 - 39081), nzTpIcepk0o8(chr(694 - 646) + '\157' + chr(0b110011) + chr(0b111 + 0o60) + chr(50), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(952 - 903) + chr(49) + '\066', 6665 - 6657), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(910 - 860) + chr(0b110011) + '\067', 0b1000), nzTpIcepk0o8('\060' + chr(0b1011 + 0o144) + chr(1313 - 1263) + '\064' + '\060', 3932 - 3924), nzTpIcepk0o8(chr(48) + chr(111) + chr(1063 - 1013) + chr(751 - 703) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(2083 - 2035) + chr(111) + '\x31' + chr(0b110 + 0o57) + chr(311 - 261), 0o10), nzTpIcepk0o8(chr(0b0 + 0o60) + '\x6f' + chr(0b110011) + chr(0b110 + 0o53) + chr(0b110011 + 0o3), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\062' + chr(0b110001) + '\066', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(4211 - 4100) + chr(0b0 + 0o63) + '\x31' + chr(0b110011 + 0o4), 13753 - 13745), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x32' + chr(941 - 893), 45389 - 45381), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(0b1101111) + chr(0b110 + 0o54) + chr(0b101011 + 0o6) + chr(0b110010), 53584 - 53576), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(0b10111 + 0o130) + chr(0b0 + 0o61) + chr(0b110101) + chr(1488 - 1438), 8), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(50) + chr(2699 - 2646) + chr(1341 - 1286), 8), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + chr(0b110001) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(1111 - 1063) + '\157' + '\x33' + chr(0b110001 + 0o5) + '\066', 38971 - 38963), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(111) + chr(51) + '\x34' + '\x33', 0b1000), nzTpIcepk0o8('\x30' + chr(0b100111 + 0o110) + '\x33' + chr(393 - 342) + chr(50), 30964 - 30956), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(267 - 217) + '\061', 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\062' + chr(49) + chr(48), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(0b110001) + chr(0b101001 + 0o12) + '\063', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(941 - 889) + chr(48), 1158 - 1150), nzTpIcepk0o8('\060' + chr(0b1010100 + 0o33) + chr(172 - 122) + '\x31' + chr(50), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(49) + '\065' + chr(49), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1090 - 1040) + chr(393 - 344) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(911 - 861) + '\x37' + chr(0b1000 + 0o54), ord("\x08")), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b1000000 + 0o57) + chr(0b101100 + 0o6) + chr(0b110001 + 0o3) + chr(300 - 251), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1593 - 1544) + '\x30' + '\062', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(111) + '\065' + '\x30', 33012 - 33004)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x81'), '\x64' + chr(0b1100101) + '\143' + '\x6f' + chr(8869 - 8769) + '\x65')(chr(0b1110101) + '\164' + chr(5601 - 5499) + chr(459 - 414) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def G_JhHMJJp045(Sn_0RxvtUGVB, hR_RmTaH7vOp=None, lZ5890bTFMci=None, NaZezbzRqEZa=nzTpIcepk0o8('\060' + chr(2756 - 2645) + '\x30', 0o10), Kv4an4SEKtxD=nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(49), ord("\x08"))): if lZ5890bTFMci is None: lZ5890bTFMci = cxBgC2Hxdi7L if hR_RmTaH7vOp is None: hR_RmTaH7vOp = Sn_0RxvtUGVB return roI3spqORKae(cfqH2Mfd6h3I, roI3spqORKae(ES5oEprVxulp(b'\xddJ\xcf\x88\x1d\x1e\x99\xde\xa3]\xf1\x02'), chr(6516 - 6416) + chr(7536 - 7435) + '\x63' + chr(111) + chr(0b1100100) + '\145')('\x75' + chr(116) + chr(2488 - 2386) + chr(0b101101) + chr(2280 - 2224)))(lZ5890bTFMci(Sn_0RxvtUGVB), base_uri=hR_RmTaH7vOp, loader=lZ5890bTFMci, jsonschema=NaZezbzRqEZa, load_on_repr=Kv4an4SEKtxD)
gazpachoking/jsonref
jsonref.py
dumps
def dumps(obj, **kwargs): """ Serialize `obj`, which may contain :class:`JsonRef` objects, to a JSON formatted string. `JsonRef` objects will be dumped as the original reference object they were created from. :param obj: Object to serialize :param kwargs: Keyword arguments are the same as to :func:`json.dumps` """ kwargs["cls"] = _ref_encoder_factory(kwargs.get("cls", json.JSONEncoder)) return json.dumps(obj, **kwargs)
python
def dumps(obj, **kwargs): """ Serialize `obj`, which may contain :class:`JsonRef` objects, to a JSON formatted string. `JsonRef` objects will be dumped as the original reference object they were created from. :param obj: Object to serialize :param kwargs: Keyword arguments are the same as to :func:`json.dumps` """ kwargs["cls"] = _ref_encoder_factory(kwargs.get("cls", json.JSONEncoder)) return json.dumps(obj, **kwargs)
[ "def", "dumps", "(", "obj", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "\"cls\"", "]", "=", "_ref_encoder_factory", "(", "kwargs", ".", "get", "(", "\"cls\"", ",", "json", ".", "JSONEncoder", ")", ")", "return", "json", ".", "dumps", "(", "obj", ",", "*", "*", "kwargs", ")" ]
Serialize `obj`, which may contain :class:`JsonRef` objects, to a JSON formatted string. `JsonRef` objects will be dumped as the original reference object they were created from. :param obj: Object to serialize :param kwargs: Keyword arguments are the same as to :func:`json.dumps`
[ "Serialize", "obj", "which", "may", "contain", ":", "class", ":", "JsonRef", "objects", "to", "a", "JSON", "formatted", "string", ".", "JsonRef", "objects", "will", "be", "dumped", "as", "the", "original", "reference", "object", "they", "were", "created", "from", "." ]
066132e527f8115f75bcadfd0eca12f8973a6309
https://github.com/gazpachoking/jsonref/blob/066132e527f8115f75bcadfd0eca12f8973a6309/jsonref.py#L413-L424
train
Serialize obj to a JSON formatted string.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB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,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + '\x6f' + '\065' + chr(1355 - 1303), 34992 - 34984), nzTpIcepk0o8('\x30' + chr(9590 - 9479) + chr(526 - 477) + '\061' + '\065', 0o10), nzTpIcepk0o8('\060' + chr(10587 - 10476) + chr(50) + '\063' + chr(54), 2200 - 2192), nzTpIcepk0o8(chr(0b11101 + 0o23) + '\x6f' + chr(1552 - 1501) + chr(48) + chr(0b110010), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110011) + '\065' + chr(49), 0o10), nzTpIcepk0o8('\060' + chr(3950 - 3839) + chr(0b110011) + chr(1603 - 1553) + chr(48), 0o10), nzTpIcepk0o8(chr(801 - 753) + '\157' + chr(51) + '\061' + chr(1322 - 1270), 60961 - 60953), nzTpIcepk0o8('\060' + chr(0b1101111 + 0o0) + chr(0b101101 + 0o5) + '\x30', 0o10), nzTpIcepk0o8(chr(48) + chr(0b101101 + 0o102) + chr(0b110001) + chr(0b110010) + chr(54), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\x32' + chr(0b110001) + chr(0b110011), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(521 - 472) + chr(0b100001 + 0o24), 0o10), nzTpIcepk0o8(chr(541 - 493) + chr(0b1101111) + chr(911 - 862) + chr(0b110010) + '\x36', 8), nzTpIcepk0o8(chr(1394 - 1346) + chr(0b1101111) + chr(0b100110 + 0o13) + chr(0b110010), 44794 - 44786), nzTpIcepk0o8(chr(1560 - 1512) + '\x6f' + chr(0b110100) + chr(1231 - 1179), 20175 - 20167), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(0b110011) + chr(0b10000 + 0o41), 32525 - 32517), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b110101) + '\062', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110011) + chr(0b110100) + chr(0b110011 + 0o4), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1004 - 955) + chr(48) + chr(2493 - 2439), ord("\x08")), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(10484 - 10373) + '\x31' + chr(0b110110) + chr(2659 - 2605), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b100000 + 0o27) + chr(0b1000 + 0o53), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b100111 + 0o110) + '\061' + chr(1668 - 1615) + chr(0b1110 + 0o42), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110011) + chr(0b1101 + 0o52) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(342 - 294) + chr(0b1101111) + '\x31' + chr(0b0 + 0o65) + chr(0b10000 + 0o45), 46172 - 46164), nzTpIcepk0o8(chr(0b110000) + chr(0b1111 + 0o140) + chr(0b110011) + chr(1757 - 1709) + chr(0b100 + 0o60), 0o10), nzTpIcepk0o8(chr(568 - 520) + '\x6f' + chr(1502 - 1449) + '\x32', 0o10), nzTpIcepk0o8(chr(0b1011 + 0o45) + '\157' + '\062' + chr(53) + '\064', ord("\x08")), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b11100 + 0o123) + chr(51) + chr(50) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(1978 - 1930) + chr(111) + '\061' + '\060' + '\066', 8), nzTpIcepk0o8(chr(0b110 + 0o52) + '\x6f' + chr(486 - 437) + chr(0b101000 + 0o16) + '\x31', 27742 - 27734), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(11323 - 11212) + '\062' + chr(0b110101) + chr(0b11011 + 0o33), 0o10), nzTpIcepk0o8(chr(48) + chr(4400 - 4289) + '\062' + chr(49) + chr(1178 - 1130), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(1217 - 1166) + chr(460 - 407) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31' + '\064' + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(0b1101111) + '\062' + chr(0b1010 + 0o52) + chr(2077 - 2022), 0o10), nzTpIcepk0o8(chr(0b10 + 0o56) + '\x6f' + '\x33' + chr(51) + chr(67 - 12), 28600 - 28592), nzTpIcepk0o8(chr(1237 - 1189) + chr(111) + chr(51) + chr(0b110110), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + chr(0b11010 + 0o30) + '\066', 8), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\061' + '\065' + chr(2842 - 2788), 0b1000), nzTpIcepk0o8(chr(1242 - 1194) + '\x6f' + '\062' + '\061' + '\x33', 8), nzTpIcepk0o8('\060' + chr(0b100 + 0o153) + chr(1183 - 1132) + '\x32' + chr(0b100 + 0o56), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(9043 - 8932) + chr(0b100 + 0o61) + '\x30', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x02'), chr(100) + '\x65' + '\x63' + chr(111) + chr(100) + chr(0b1100101))(chr(7905 - 7788) + '\164' + chr(317 - 215) + '\x2d' + '\x38') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Zjglmm8uenkC(kIMfkyypPTcC, **q5n0sHDDTy90): q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b'O!\xed'), chr(0b1100100) + '\145' + chr(0b110000 + 0o63) + chr(0b1101111) + '\144' + '\x65')(chr(117) + chr(0b1000011 + 0o61) + chr(102) + '\055' + '\x38')] = RdJbQqVOcETx(q5n0sHDDTy90.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'O!\xed'), chr(0b1001110 + 0o26) + '\145' + '\143' + '\157' + chr(0b1100000 + 0o4) + '\145')(chr(0b11101 + 0o130) + chr(116) + chr(102) + chr(45) + chr(1097 - 1041)), LNUKEwZDIbyb.JSONEncoder)) return roI3spqORKae(LNUKEwZDIbyb, roI3spqORKae(ES5oEprVxulp(b"v'\xf9\xae\x84\xbd\xf4e3\xe5f\x15"), '\144' + chr(4642 - 4541) + '\x63' + '\157' + chr(1471 - 1371) + chr(0b1100101))('\x75' + '\164' + '\x66' + chr(967 - 922) + '\x38'))(kIMfkyypPTcC, **q5n0sHDDTy90)
gazpachoking/jsonref
jsonref.py
JsonRef.replace_refs
def replace_refs(cls, obj, _recursive=False, **kwargs): """ Returns a deep copy of `obj` with all contained JSON reference objects replaced with :class:`JsonRef` instances. :param obj: If this is a JSON reference object, a :class:`JsonRef` instance will be created. If `obj` is not a JSON reference object, a deep copy of it will be created with all contained JSON reference objects replaced by :class:`JsonRef` instances :param base_uri: URI to resolve relative references against :param loader: Callable that takes a URI and returns the parsed JSON (defaults to global ``jsonloader``, a :class:`JsonLoader` instance) :param jsonschema: Flag to turn on `JSON Schema mode <http://json-schema.org/latest/json-schema-core.html#anchor25>`_. 'id' keyword changes the `base_uri` for references contained within the object :param load_on_repr: If set to ``False``, :func:`repr` call on a :class:`JsonRef` object will not cause the reference to be loaded if it hasn't already. (defaults to ``True``) """ store = kwargs.setdefault("_store", _URIDict()) base_uri, frag = urlparse.urldefrag(kwargs.get("base_uri", "")) store_uri = None # If this does not get set, we won't store the result if not frag and not _recursive: store_uri = base_uri try: if kwargs.get("jsonschema") and isinstance(obj["id"], basestring): kwargs["base_uri"] = urlparse.urljoin( kwargs.get("base_uri", ""), obj["id"] ) store_uri = kwargs["base_uri"] except (TypeError, LookupError): pass try: if not isinstance(obj["$ref"], basestring): raise TypeError except (TypeError, LookupError): pass else: return cls(obj, **kwargs) # If our obj was not a json reference object, iterate through it, # replacing children with JsonRefs kwargs["_recursive"] = True path = list(kwargs.pop("_path", ())) if isinstance(obj, Mapping): obj = type(obj)( (k, cls.replace_refs(v, _path=path + [k], **kwargs)) for k, v in iteritems(obj) ) elif isinstance(obj, Sequence) and not isinstance(obj, basestring): obj = type(obj)( cls.replace_refs(v, _path=path + [i], **kwargs) for i, v in enumerate(obj) ) if store_uri is not None: store[store_uri] = obj return obj
python
def replace_refs(cls, obj, _recursive=False, **kwargs): """ Returns a deep copy of `obj` with all contained JSON reference objects replaced with :class:`JsonRef` instances. :param obj: If this is a JSON reference object, a :class:`JsonRef` instance will be created. If `obj` is not a JSON reference object, a deep copy of it will be created with all contained JSON reference objects replaced by :class:`JsonRef` instances :param base_uri: URI to resolve relative references against :param loader: Callable that takes a URI and returns the parsed JSON (defaults to global ``jsonloader``, a :class:`JsonLoader` instance) :param jsonschema: Flag to turn on `JSON Schema mode <http://json-schema.org/latest/json-schema-core.html#anchor25>`_. 'id' keyword changes the `base_uri` for references contained within the object :param load_on_repr: If set to ``False``, :func:`repr` call on a :class:`JsonRef` object will not cause the reference to be loaded if it hasn't already. (defaults to ``True``) """ store = kwargs.setdefault("_store", _URIDict()) base_uri, frag = urlparse.urldefrag(kwargs.get("base_uri", "")) store_uri = None # If this does not get set, we won't store the result if not frag and not _recursive: store_uri = base_uri try: if kwargs.get("jsonschema") and isinstance(obj["id"], basestring): kwargs["base_uri"] = urlparse.urljoin( kwargs.get("base_uri", ""), obj["id"] ) store_uri = kwargs["base_uri"] except (TypeError, LookupError): pass try: if not isinstance(obj["$ref"], basestring): raise TypeError except (TypeError, LookupError): pass else: return cls(obj, **kwargs) # If our obj was not a json reference object, iterate through it, # replacing children with JsonRefs kwargs["_recursive"] = True path = list(kwargs.pop("_path", ())) if isinstance(obj, Mapping): obj = type(obj)( (k, cls.replace_refs(v, _path=path + [k], **kwargs)) for k, v in iteritems(obj) ) elif isinstance(obj, Sequence) and not isinstance(obj, basestring): obj = type(obj)( cls.replace_refs(v, _path=path + [i], **kwargs) for i, v in enumerate(obj) ) if store_uri is not None: store[store_uri] = obj return obj
[ "def", "replace_refs", "(", "cls", ",", "obj", ",", "_recursive", "=", "False", ",", "*", "*", "kwargs", ")", ":", "store", "=", "kwargs", ".", "setdefault", "(", "\"_store\"", ",", "_URIDict", "(", ")", ")", "base_uri", ",", "frag", "=", "urlparse", ".", "urldefrag", "(", "kwargs", ".", "get", "(", "\"base_uri\"", ",", "\"\"", ")", ")", "store_uri", "=", "None", "# If this does not get set, we won't store the result", "if", "not", "frag", "and", "not", "_recursive", ":", "store_uri", "=", "base_uri", "try", ":", "if", "kwargs", ".", "get", "(", "\"jsonschema\"", ")", "and", "isinstance", "(", "obj", "[", "\"id\"", "]", ",", "basestring", ")", ":", "kwargs", "[", "\"base_uri\"", "]", "=", "urlparse", ".", "urljoin", "(", "kwargs", ".", "get", "(", "\"base_uri\"", ",", "\"\"", ")", ",", "obj", "[", "\"id\"", "]", ")", "store_uri", "=", "kwargs", "[", "\"base_uri\"", "]", "except", "(", "TypeError", ",", "LookupError", ")", ":", "pass", "try", ":", "if", "not", "isinstance", "(", "obj", "[", "\"$ref\"", "]", ",", "basestring", ")", ":", "raise", "TypeError", "except", "(", "TypeError", ",", "LookupError", ")", ":", "pass", "else", ":", "return", "cls", "(", "obj", ",", "*", "*", "kwargs", ")", "# If our obj was not a json reference object, iterate through it,", "# replacing children with JsonRefs", "kwargs", "[", "\"_recursive\"", "]", "=", "True", "path", "=", "list", "(", "kwargs", ".", "pop", "(", "\"_path\"", ",", "(", ")", ")", ")", "if", "isinstance", "(", "obj", ",", "Mapping", ")", ":", "obj", "=", "type", "(", "obj", ")", "(", "(", "k", ",", "cls", ".", "replace_refs", "(", "v", ",", "_path", "=", "path", "+", "[", "k", "]", ",", "*", "*", "kwargs", ")", ")", "for", "k", ",", "v", "in", "iteritems", "(", "obj", ")", ")", "elif", "isinstance", "(", "obj", ",", "Sequence", ")", "and", "not", "isinstance", "(", "obj", ",", "basestring", ")", ":", "obj", "=", "type", "(", "obj", ")", "(", "cls", ".", "replace_refs", "(", "v", ",", "_path", "=", "path", "+", "[", "i", "]", ",", "*", "*", "kwargs", ")", "for", "i", ",", "v", "in", "enumerate", "(", "obj", ")", ")", "if", "store_uri", "is", "not", "None", ":", "store", "[", "store_uri", "]", "=", "obj", "return", "obj" ]
Returns a deep copy of `obj` with all contained JSON reference objects replaced with :class:`JsonRef` instances. :param obj: If this is a JSON reference object, a :class:`JsonRef` instance will be created. If `obj` is not a JSON reference object, a deep copy of it will be created with all contained JSON reference objects replaced by :class:`JsonRef` instances :param base_uri: URI to resolve relative references against :param loader: Callable that takes a URI and returns the parsed JSON (defaults to global ``jsonloader``, a :class:`JsonLoader` instance) :param jsonschema: Flag to turn on `JSON Schema mode <http://json-schema.org/latest/json-schema-core.html#anchor25>`_. 'id' keyword changes the `base_uri` for references contained within the object :param load_on_repr: If set to ``False``, :func:`repr` call on a :class:`JsonRef` object will not cause the reference to be loaded if it hasn't already. (defaults to ``True``)
[ "Returns", "a", "deep", "copy", "of", "obj", "with", "all", "contained", "JSON", "reference", "objects", "replaced", "with", ":", "class", ":", "JsonRef", "instances", "." ]
066132e527f8115f75bcadfd0eca12f8973a6309
https://github.com/gazpachoking/jsonref/blob/066132e527f8115f75bcadfd0eca12f8973a6309/jsonref.py#L70-L130
train
Returns a deep copy of obj with all contained JSON reference objects replaced with JSONRefs.
GiP5xwVCF98Z,B3LV8Eo811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ithmeticError,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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + '\x6f' + chr(2272 - 2223) + chr(49) + chr(51), ord("\x08")), nzTpIcepk0o8('\x30' + chr(1942 - 1831) + chr(0b1001 + 0o54) + chr(386 - 332), 1830 - 1822), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(0b1101111) + '\x32' + '\x32' + '\x37', 5768 - 5760), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(53) + '\060', ord("\x08")), nzTpIcepk0o8(chr(302 - 254) + chr(0b1101111) + chr(0b110010 + 0o3) + '\x31', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110011) + chr(1544 - 1494) + chr(632 - 583), 39874 - 39866), nzTpIcepk0o8('\x30' + chr(111) + chr(2108 - 2057) + chr(0b1011 + 0o45) + chr(48), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b1110 + 0o45) + chr(0b110100) + chr(0b1110 + 0o46), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1 + 0o156) + chr(2459 - 2408) + chr(50) + chr(49), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b101110 + 0o4) + chr(49) + chr(1309 - 1255), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(51) + chr(0b110110) + chr(0b10010 + 0o42), 39286 - 39278), nzTpIcepk0o8(chr(1575 - 1527) + chr(0b1101111) + '\x33' + chr(0b1001 + 0o52) + chr(0b100111 + 0o16), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(51) + chr(53) + chr(0b100111 + 0o12), 0o10), nzTpIcepk0o8('\060' + chr(0b1000001 + 0o56) + chr(377 - 326) + chr(0b110000) + '\x32', 0b1000), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(111) + '\062' + chr(1757 - 1702) + '\062', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(49) + chr(0b110001) + '\x33', 8), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(54) + chr(0b110000), 59470 - 59462), nzTpIcepk0o8(chr(0b110000) + chr(0b1100010 + 0o15) + chr(0b1110 + 0o44) + '\062' + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(3876 - 3765) + chr(51) + chr(0b11 + 0o63), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110000 + 0o7), 22856 - 22848), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(111) + chr(0b110001) + chr(0b110000) + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x36', 1460 - 1452), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\061' + chr(365 - 315) + chr(1973 - 1920), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(0b10010 + 0o41) + chr(0b110110) + chr(0b110100), 8), nzTpIcepk0o8('\060' + chr(0b1101 + 0o142) + '\x32' + chr(0b110110) + '\060', 8), nzTpIcepk0o8(chr(363 - 315) + chr(0b1101111) + chr(0b110101) + '\x31', 8), nzTpIcepk0o8(chr(414 - 366) + chr(111) + chr(1910 - 1860) + '\x36' + chr(215 - 164), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + '\062' + chr(0b110010), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\065' + '\064', 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b101111 + 0o4) + chr(2516 - 2464), 28041 - 28033), nzTpIcepk0o8('\x30' + chr(1407 - 1296) + chr(51) + '\x30', 39626 - 39618), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1014 - 964) + chr(0b110110) + chr(48), 8), nzTpIcepk0o8('\060' + chr(0b101010 + 0o105) + chr(52) + chr(0b11110 + 0o30), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\066' + '\x37', ord("\x08")), nzTpIcepk0o8(chr(2224 - 2176) + chr(0b1101100 + 0o3) + chr(0b100000 + 0o23) + '\x37' + chr(0b110010), 6012 - 6004), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b100011 + 0o17) + '\x34', 0b1000), nzTpIcepk0o8('\060' + '\157' + '\067' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(7560 - 7449) + chr(51) + chr(0b11011 + 0o31) + chr(0b110100 + 0o1), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001) + chr(53), 18968 - 18960), nzTpIcepk0o8(chr(145 - 97) + '\157' + chr(279 - 228) + chr(0b110010) + chr(0b10011 + 0o44), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1261 - 1213) + chr(8028 - 7917) + '\x35' + chr(48), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'e'), '\144' + chr(0b11000 + 0o115) + '\143' + chr(111) + '\x64' + chr(0b10101 + 0o120))(chr(117) + '\164' + chr(0b1000100 + 0o42) + chr(0b1001 + 0o44) + chr(0b110110 + 0o2)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def w2wfGg0Y1GGW(_1vzISbJ_R2i, kIMfkyypPTcC, bufjs3gixVAZ=nzTpIcepk0o8(chr(255 - 207) + chr(3441 - 3330) + chr(0b110000), ord("\x08")), **q5n0sHDDTy90): Yws2kZcdmcdB = q5n0sHDDTy90.ze0JMuK9roWS(roI3spqORKae(ES5oEprVxulp(b'\x14]\xe3G[\xb4'), '\x64' + chr(9024 - 8923) + '\x63' + chr(111) + '\x64' + '\145')(chr(0b1110101) + chr(116) + chr(0b1100110 + 0o0) + '\055' + chr(56)), SLja2fGNRqmT()) (hR_RmTaH7vOp, F4ljoJlieSbN) = cBkYfihkXwhl.urldefrag(q5n0sHDDTy90.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b')O\xe4Mv\xa4\xb2\x8d'), '\x64' + '\145' + chr(0b1100011) + chr(0b1011011 + 0o24) + chr(0b1100100) + chr(0b1000010 + 0o43))('\x75' + chr(0b100001 + 0o123) + chr(0b1010000 + 0o26) + '\x2d' + '\070'), roI3spqORKae(ES5oEprVxulp(b''), '\144' + '\x65' + '\x63' + chr(0b1000100 + 0o53) + '\x64' + chr(0b111000 + 0o55))('\165' + chr(0b1110100) + chr(0b1011001 + 0o15) + chr(45) + '\x38'))) jmjWrArEYcAX = None if not F4ljoJlieSbN and (not bufjs3gixVAZ): jmjWrArEYcAX = hR_RmTaH7vOp try: if roI3spqORKae(q5n0sHDDTy90, roI3spqORKae(ES5oEprVxulp(b'\x0c{\xdcM]\xa4\xf4\x9c\xb0\xc9\x87\x97'), chr(100) + '\145' + '\x63' + chr(8047 - 7936) + chr(531 - 431) + chr(0b1000010 + 0o43))(chr(10091 - 9974) + chr(116) + '\x66' + chr(0b101101) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'!]\xf8FZ\xb2\xa8\x81\xbc\xef'), chr(6580 - 6480) + chr(0b1100101) + '\x63' + chr(2138 - 2027) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(0b11011 + 0o22) + chr(56))) and suIjIS24Zkqw(kIMfkyypPTcC[roI3spqORKae(ES5oEprVxulp(b'"J'), '\x64' + chr(9614 - 9513) + chr(0b1100011) + chr(0b1101111) + chr(9204 - 9104) + '\x65')(chr(0b101010 + 0o113) + chr(116) + chr(0b1100011 + 0o3) + chr(0b101101) + '\x38')], JaQstSroDWOP): q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b')O\xe4Mv\xa4\xb2\x8d'), '\x64' + '\x65' + chr(99) + '\157' + '\x64' + chr(0b1100101))(chr(10240 - 10123) + chr(116) + chr(7645 - 7543) + chr(45) + chr(0b111000))] = cBkYfihkXwhl.urljoin(q5n0sHDDTy90.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b')O\xe4Mv\xa4\xb2\x8d'), '\x64' + chr(0b111010 + 0o53) + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(0b100101 + 0o100))(chr(117) + chr(11170 - 11054) + chr(549 - 447) + chr(0b10010 + 0o33) + chr(1161 - 1105)), roI3spqORKae(ES5oEprVxulp(b''), '\144' + '\145' + '\143' + '\157' + chr(100) + chr(101))('\165' + chr(116) + '\x66' + chr(0b101101 + 0o0) + '\070')), kIMfkyypPTcC[roI3spqORKae(ES5oEprVxulp(b'"J'), chr(3829 - 3729) + '\x65' + '\x63' + '\157' + chr(0b111100 + 0o50) + '\145')('\165' + chr(0b1110010 + 0o2) + '\146' + chr(45) + '\070')]) jmjWrArEYcAX = q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b')O\xe4Mv\xa4\xb2\x8d'), chr(100) + '\x65' + chr(0b1100011) + chr(597 - 486) + chr(1351 - 1251) + chr(9828 - 9727))(chr(9060 - 8943) + chr(0b11011 + 0o131) + chr(0b1100 + 0o132) + chr(0b11111 + 0o16) + chr(0b111000))] except (jZIjKu8IFANs, KSw3AkHkJy1a): pass try: if not suIjIS24Zkqw(kIMfkyypPTcC[roI3spqORKae(ES5oEprVxulp(b'o\\\xf2N'), chr(100) + '\x65' + '\143' + '\x6f' + '\144' + chr(0b1010100 + 0o21))('\x75' + chr(0b1101111 + 0o5) + chr(102) + '\055' + chr(0b111000))], JaQstSroDWOP): raise jZIjKu8IFANs except (jZIjKu8IFANs, KSw3AkHkJy1a): pass else: return _1vzISbJ_R2i(kIMfkyypPTcC, **q5n0sHDDTy90) q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b'\x14\\\xf2K\\\xa3\xb3\x8d\xa7\xeb'), '\x64' + '\x65' + chr(99) + chr(0b1101111) + chr(100) + chr(0b1001 + 0o134))(chr(0b1110101) + '\164' + chr(102) + '\x2d' + chr(56))] = nzTpIcepk0o8('\060' + chr(0b1101111) + chr(49), 19415 - 19407) _pSYqrosNb95 = H4NoA26ON7iG(q5n0sHDDTy90.uC_Yoybx7J0I(roI3spqORKae(ES5oEprVxulp(b'\x14^\xf6\\A'), '\144' + '\x65' + chr(99) + chr(2608 - 2497) + '\144' + chr(0b11010 + 0o113))(chr(0b1110101) + chr(0b1011011 + 0o31) + '\x66' + chr(1393 - 1348) + chr(0b101 + 0o63)), ())) if suIjIS24Zkqw(kIMfkyypPTcC, _xzUTrSL3J7B): kIMfkyypPTcC = MJ07XsN5uFgW(kIMfkyypPTcC)(((B6UAF1zReOyJ, _1vzISbJ_R2i.replace_refs(r7AA1pbLjb44, _path=_pSYqrosNb95 + [B6UAF1zReOyJ], **q5n0sHDDTy90)) for (B6UAF1zReOyJ, r7AA1pbLjb44) in tcSkjcrLksk1(kIMfkyypPTcC))) elif suIjIS24Zkqw(kIMfkyypPTcC, yvggQM2NUxB4) and (not suIjIS24Zkqw(kIMfkyypPTcC, JaQstSroDWOP)): kIMfkyypPTcC = MJ07XsN5uFgW(kIMfkyypPTcC)((_1vzISbJ_R2i.replace_refs(r7AA1pbLjb44, _path=_pSYqrosNb95 + [ZlbFMSG8gCoF], **q5n0sHDDTy90) for (ZlbFMSG8gCoF, r7AA1pbLjb44) in _kV_Bomx8PZ4(kIMfkyypPTcC))) if jmjWrArEYcAX is not None: Yws2kZcdmcdB[jmjWrArEYcAX] = kIMfkyypPTcC return kIMfkyypPTcC
gazpachoking/jsonref
jsonref.py
JsonRef.resolve_pointer
def resolve_pointer(self, document, pointer): """ Resolve a json pointer ``pointer`` within the referenced ``document``. :argument document: the referent document :argument str pointer: a json pointer URI fragment to resolve within it """ # Do only split at single forward slashes which are not prefixed by a caret parts = re.split(r"(?<!\^)/", unquote(pointer.lstrip("/"))) if pointer else [] for part in parts: # Restore escaped slashes and carets replacements = {r"^/": r"/", r"^^": r"^"} part = re.sub( "|".join(re.escape(key) for key in replacements.keys()), lambda k: replacements[k.group(0)], part, ) if isinstance(document, Sequence): # Try to turn an array index to an int try: part = int(part) except ValueError: pass try: document = document[part] except (TypeError, LookupError) as e: self._error("Unresolvable JSON pointer: %r" % pointer, cause=e) return document
python
def resolve_pointer(self, document, pointer): """ Resolve a json pointer ``pointer`` within the referenced ``document``. :argument document: the referent document :argument str pointer: a json pointer URI fragment to resolve within it """ # Do only split at single forward slashes which are not prefixed by a caret parts = re.split(r"(?<!\^)/", unquote(pointer.lstrip("/"))) if pointer else [] for part in parts: # Restore escaped slashes and carets replacements = {r"^/": r"/", r"^^": r"^"} part = re.sub( "|".join(re.escape(key) for key in replacements.keys()), lambda k: replacements[k.group(0)], part, ) if isinstance(document, Sequence): # Try to turn an array index to an int try: part = int(part) except ValueError: pass try: document = document[part] except (TypeError, LookupError) as e: self._error("Unresolvable JSON pointer: %r" % pointer, cause=e) return document
[ "def", "resolve_pointer", "(", "self", ",", "document", ",", "pointer", ")", ":", "# Do only split at single forward slashes which are not prefixed by a caret", "parts", "=", "re", ".", "split", "(", "r\"(?<!\\^)/\"", ",", "unquote", "(", "pointer", ".", "lstrip", "(", "\"/\"", ")", ")", ")", "if", "pointer", "else", "[", "]", "for", "part", "in", "parts", ":", "# Restore escaped slashes and carets", "replacements", "=", "{", "r\"^/\"", ":", "r\"/\"", ",", "r\"^^\"", ":", "r\"^\"", "}", "part", "=", "re", ".", "sub", "(", "\"|\"", ".", "join", "(", "re", ".", "escape", "(", "key", ")", "for", "key", "in", "replacements", ".", "keys", "(", ")", ")", ",", "lambda", "k", ":", "replacements", "[", "k", ".", "group", "(", "0", ")", "]", ",", "part", ",", ")", "if", "isinstance", "(", "document", ",", "Sequence", ")", ":", "# Try to turn an array index to an int", "try", ":", "part", "=", "int", "(", "part", ")", "except", "ValueError", ":", "pass", "try", ":", "document", "=", "document", "[", "part", "]", "except", "(", "TypeError", ",", "LookupError", ")", "as", "e", ":", "self", ".", "_error", "(", "\"Unresolvable JSON pointer: %r\"", "%", "pointer", ",", "cause", "=", "e", ")", "return", "document" ]
Resolve a json pointer ``pointer`` within the referenced ``document``. :argument document: the referent document :argument str pointer: a json pointer URI fragment to resolve within it
[ "Resolve", "a", "json", "pointer", "pointer", "within", "the", "referenced", "document", "." ]
066132e527f8115f75bcadfd0eca12f8973a6309
https://github.com/gazpachoking/jsonref/blob/066132e527f8115f75bcadfd0eca12f8973a6309/jsonref.py#L191-L220
train
Resolve a json pointer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qeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b111101 + 0o62) + chr(0b1 + 0o61) + chr(0b101010 + 0o14) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + '\060' + '\x32', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(267 - 217) + chr(850 - 795) + chr(0b110000 + 0o7), 612 - 604), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(111) + chr(0b1101 + 0o45) + '\060' + chr(2740 - 2687), 40481 - 40473), nzTpIcepk0o8(chr(0b110000) + chr(8865 - 8754) + '\x32' + chr(2086 - 2035) + '\x30', 0o10), nzTpIcepk0o8('\x30' + chr(0b111001 + 0o66) + chr(0b110010) + chr(156 - 104) + '\x35', 0o10), nzTpIcepk0o8(chr(0b10000 + 0o40) + '\157' + '\x33' + '\062' + chr(2314 - 2264), 0b1000), nzTpIcepk0o8(chr(176 - 128) + '\157' + '\063' + '\066' + '\060', 0o10), nzTpIcepk0o8(chr(2232 - 2184) + chr(111) + '\061' + chr(0b110011) + '\x31', 61133 - 61125), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(0b1101111) + '\067' + chr(0b1010 + 0o54), 54811 - 54803), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011) + chr(54) + '\066', 47041 - 47033), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\064' + chr(51), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(55) + chr(55), 20330 - 20322), nzTpIcepk0o8('\060' + chr(0b11001 + 0o126) + '\x33' + chr(0b110000 + 0o2) + '\065', 0b1000), nzTpIcepk0o8('\x30' + chr(7748 - 7637) + '\x36' + chr(2348 - 2296), 0b1000), nzTpIcepk0o8('\060' + chr(0b100000 + 0o117) + chr(0b11011 + 0o33) + '\063', 60802 - 60794), nzTpIcepk0o8(chr(519 - 471) + chr(0b1000101 + 0o52) + '\x33' + '\064' + chr(48), 0o10), nzTpIcepk0o8(chr(452 - 404) + chr(7416 - 7305) + chr(576 - 525) + chr(856 - 805) + '\x36', 1903 - 1895), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110101) + '\x30', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(55) + chr(0b110111), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1455 - 1404) + chr(0b1010 + 0o51) + chr(0b110011 + 0o1), 33567 - 33559), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + chr(2782 - 2729) + '\060', 0o10), nzTpIcepk0o8(chr(387 - 339) + '\157' + chr(51) + chr(0b110010) + chr(48), 48726 - 48718), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1890 - 1841) + chr(0b110111) + chr(523 - 472), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110001) + chr(48) + '\067', 16407 - 16399), nzTpIcepk0o8(chr(0b110000) + chr(0b100110 + 0o111) + chr(49) + chr(0b110010) + '\x32', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(10091 - 9980) + chr(51) + '\x30' + chr(901 - 847), 0b1000), nzTpIcepk0o8(chr(990 - 942) + chr(0b1101111) + '\x32' + chr(2254 - 2202) + chr(51), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + chr(449 - 398), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b110001) + chr(2244 - 2195) + chr(51), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + chr(0b110010) + chr(54), 1940 - 1932), nzTpIcepk0o8('\060' + '\x6f' + '\x33' + chr(51) + chr(0b11000 + 0o37), 47194 - 47186), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1697 - 1648) + chr(0b10 + 0o62) + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b110 + 0o52) + '\157' + chr(0b101 + 0o54) + chr(0b110111) + chr(0b101011 + 0o7), ord("\x08")), nzTpIcepk0o8(chr(0b11101 + 0o23) + '\157' + chr(1723 - 1674) + chr(0b11010 + 0o33) + chr(54), 0b1000), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(0b11010 + 0o125) + '\063' + chr(0b100101 + 0o14) + chr(2435 - 2383), 50735 - 50727), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + chr(0b110011) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b100001 + 0o17) + '\157' + chr(49) + chr(53) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(670 - 622) + chr(111) + chr(0b110 + 0o54) + '\x35' + chr(49), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101110 + 0o1) + chr(666 - 612), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + '\157' + '\x35' + '\060', 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x9e'), '\144' + chr(101) + chr(1305 - 1206) + '\157' + '\x64' + '\x65')('\x75' + chr(116) + chr(102) + '\x2d' + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Tv31BTs5r8w8(hXMPsSrOQzbh, K6an18Ylsl3S, VpexCJyQNp0O): ws_9aXBYp0Zv = aoTc4YA2bs2R.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'\x98\xfd\x83\xa4\xc4\xfb\xfb\xdf'), '\144' + '\145' + chr(0b1100011) + '\x6f' + chr(0b111101 + 0o47) + chr(0b1100101))(chr(117) + '\x74' + '\146' + '\055' + '\x38'), fFc36kWm4mWn(VpexCJyQNp0O.lstrip(roI3spqORKae(ES5oEprVxulp(b'\x9f'), chr(100) + '\145' + '\x63' + chr(111) + '\x64' + '\x65')('\165' + '\164' + chr(1709 - 1607) + '\x2d' + chr(0b110100 + 0o4))))) if VpexCJyQNp0O else [] for vBy4LaCHhegz in ws_9aXBYp0Zv: Z5xAf1iiOaP3 = {roI3spqORKae(ES5oEprVxulp(b'\xee\xed'), '\x64' + chr(0b1100101) + chr(2904 - 2805) + '\157' + chr(0b1100100) + chr(0b1100101))('\x75' + '\x74' + chr(102) + '\x2d' + chr(0b111000)): roI3spqORKae(ES5oEprVxulp(b'\x9f'), chr(0b100101 + 0o77) + chr(0b1100101) + chr(4903 - 4804) + chr(0b1101111) + chr(9679 - 9579) + chr(101))('\x75' + chr(0b1011111 + 0o25) + chr(10323 - 10221) + chr(813 - 768) + chr(0b100001 + 0o27)), roI3spqORKae(ES5oEprVxulp(b'\xee\x9c'), chr(0b10001 + 0o123) + chr(101) + chr(0b10111 + 0o114) + '\x6f' + chr(0b1100100) + chr(0b101 + 0o140))(chr(7682 - 7565) + '\164' + chr(8005 - 7903) + '\x2d' + chr(0b111000)): roI3spqORKae(ES5oEprVxulp(b'\xee'), chr(163 - 63) + chr(0b1100101) + chr(0b1100011) + chr(0b1101101 + 0o2) + chr(0b1100100) + chr(0b100111 + 0o76))(chr(0b1100 + 0o151) + '\164' + '\x66' + chr(0b101101) + chr(0b111000))} vBy4LaCHhegz = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'\xcc'), chr(0b10000 + 0o124) + chr(0b1100101) + chr(99) + '\x6f' + chr(4458 - 4358) + chr(0b111110 + 0o47))(chr(0b111101 + 0o70) + '\164' + chr(0b1100110) + chr(784 - 739) + chr(0b111000)).Y4yM9BcfTCNq((aoTc4YA2bs2R.lfFf1I73PDZv(QYodcsDtoGq7) for QYodcsDtoGq7 in Z5xAf1iiOaP3.keys())), lambda B6UAF1zReOyJ: Z5xAf1iiOaP3[B6UAF1zReOyJ.F9lJ8RbIonqb(nzTpIcepk0o8('\x30' + chr(9244 - 9133) + '\060', 0b1000))], vBy4LaCHhegz) if suIjIS24Zkqw(K6an18Ylsl3S, yvggQM2NUxB4): try: vBy4LaCHhegz = nzTpIcepk0o8(vBy4LaCHhegz) except WbNHlDKpyPtQ: pass try: K6an18Ylsl3S = K6an18Ylsl3S[vBy4LaCHhegz] except (jZIjKu8IFANs, KSw3AkHkJy1a) as wgf0sgcu_xPL: roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xff\xf0\xf2\xef\xeb\xd5\xe4\x99\x14P\xc0\x11'), chr(100) + chr(0b1001001 + 0o34) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(0b11010 + 0o113))('\165' + '\x74' + '\146' + chr(0b10101 + 0o30) + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'\xe5\xac\xcd\xe0\xeb\xca\xbe\x868\\\x9aF\x1f\x9fg|\xae\xfeXP\xb5\x06\xa4\x1e5h\xe6\x86i'), chr(0b1100100) + chr(0b1100101) + '\x63' + '\x6f' + chr(6763 - 6663) + '\145')('\x75' + '\164' + chr(0b1100110) + chr(0b101010 + 0o3) + chr(610 - 554)) % VpexCJyQNp0O, cause=wgf0sgcu_xPL) return K6an18Ylsl3S
Iotic-Labs/py-ubjson
ubjson/encoder.py
dump
def dump(obj, fp, container_count=False, sort_keys=False, no_float32=True, default=None): """Writes the given object as UBJSON to the provided file-like object Args: obj: The object to encode fp: write([size])-able object container_count (bool): Specify length for container types (including for empty ones). This can aid decoding speed depending on implementation but requires a bit more space and encoding speed could be reduced if getting length of any of the containers is expensive. sort_keys (bool): Sort keys of mappings no_float32 (bool): Never use float32 to store float numbers (other than for zero). Disabling this might save space at the loss of precision. default (callable): Called for objects which cannot be serialised. Should return a UBJSON-encodable version of the object or raise an EncoderException. Raises: EncoderException: If an encoding failure occured. The following Python types and interfaces (ABCs) are supported (as are any subclasses): +------------------------------+-----------------------------------+ | Python | UBJSON | +==============================+===================================+ | (3) str | string | | (2) unicode | | +------------------------------+-----------------------------------+ | None | null | +------------------------------+-----------------------------------+ | bool | true, false | +------------------------------+-----------------------------------+ | (3) int | uint8, int8, int16, int32, int64, | | (2) int, long | high_precision | +------------------------------+-----------------------------------+ | float | float32, float64, high_precision | +------------------------------+-----------------------------------+ | Decimal | high_precision | +------------------------------+-----------------------------------+ | (3) bytes, bytearray | array (type, uint8) | | (2) str | array (type, uint8) | +------------------------------+-----------------------------------+ | (3) collections.abc.Mapping | object | | (2) collections.Mapping | | +------------------------------+-----------------------------------+ | (3) collections.abc.Sequence | array | | (2) collections.Sequence | | +------------------------------+-----------------------------------+ Notes: - Items are resolved in the order of this table, e.g. if the item implements both Mapping and Sequence interfaces, it will be encoded as a mapping. - None and bool do not use an isinstance check - Numbers in brackets denote Python version. - Only unicode strings in Python 2 are encoded as strings, i.e. for compatibility with e.g. Python 3 one MUST NOT use str in Python 2 (as that will be interpreted as a byte array). - Mapping keys have to be strings: str for Python3 and unicode or str in Python 2. - float conversion rules (depending on no_float32 setting): float32: 1.18e-38 <= abs(value) <= 3.4e38 or value == 0 float64: 2.23e-308 <= abs(value) < 1.8e308 For other values Decimal is used. """ if not callable(fp.write): raise TypeError('fp.write not callable') fp_write = fp.write __encode_value(fp_write, obj, {}, container_count, sort_keys, no_float32, default)
python
def dump(obj, fp, container_count=False, sort_keys=False, no_float32=True, default=None): """Writes the given object as UBJSON to the provided file-like object Args: obj: The object to encode fp: write([size])-able object container_count (bool): Specify length for container types (including for empty ones). This can aid decoding speed depending on implementation but requires a bit more space and encoding speed could be reduced if getting length of any of the containers is expensive. sort_keys (bool): Sort keys of mappings no_float32 (bool): Never use float32 to store float numbers (other than for zero). Disabling this might save space at the loss of precision. default (callable): Called for objects which cannot be serialised. Should return a UBJSON-encodable version of the object or raise an EncoderException. Raises: EncoderException: If an encoding failure occured. The following Python types and interfaces (ABCs) are supported (as are any subclasses): +------------------------------+-----------------------------------+ | Python | UBJSON | +==============================+===================================+ | (3) str | string | | (2) unicode | | +------------------------------+-----------------------------------+ | None | null | +------------------------------+-----------------------------------+ | bool | true, false | +------------------------------+-----------------------------------+ | (3) int | uint8, int8, int16, int32, int64, | | (2) int, long | high_precision | +------------------------------+-----------------------------------+ | float | float32, float64, high_precision | +------------------------------+-----------------------------------+ | Decimal | high_precision | +------------------------------+-----------------------------------+ | (3) bytes, bytearray | array (type, uint8) | | (2) str | array (type, uint8) | +------------------------------+-----------------------------------+ | (3) collections.abc.Mapping | object | | (2) collections.Mapping | | +------------------------------+-----------------------------------+ | (3) collections.abc.Sequence | array | | (2) collections.Sequence | | +------------------------------+-----------------------------------+ Notes: - Items are resolved in the order of this table, e.g. if the item implements both Mapping and Sequence interfaces, it will be encoded as a mapping. - None and bool do not use an isinstance check - Numbers in brackets denote Python version. - Only unicode strings in Python 2 are encoded as strings, i.e. for compatibility with e.g. Python 3 one MUST NOT use str in Python 2 (as that will be interpreted as a byte array). - Mapping keys have to be strings: str for Python3 and unicode or str in Python 2. - float conversion rules (depending on no_float32 setting): float32: 1.18e-38 <= abs(value) <= 3.4e38 or value == 0 float64: 2.23e-308 <= abs(value) < 1.8e308 For other values Decimal is used. """ if not callable(fp.write): raise TypeError('fp.write not callable') fp_write = fp.write __encode_value(fp_write, obj, {}, container_count, sort_keys, no_float32, default)
[ "def", "dump", "(", "obj", ",", "fp", ",", "container_count", "=", "False", ",", "sort_keys", "=", "False", ",", "no_float32", "=", "True", ",", "default", "=", "None", ")", ":", "if", "not", "callable", "(", "fp", ".", "write", ")", ":", "raise", "TypeError", "(", "'fp.write not callable'", ")", "fp_write", "=", "fp", ".", "write", "__encode_value", "(", "fp_write", ",", "obj", ",", "{", "}", ",", "container_count", ",", "sort_keys", ",", "no_float32", ",", "default", ")" ]
Writes the given object as UBJSON to the provided file-like object Args: obj: The object to encode fp: write([size])-able object container_count (bool): Specify length for container types (including for empty ones). This can aid decoding speed depending on implementation but requires a bit more space and encoding speed could be reduced if getting length of any of the containers is expensive. sort_keys (bool): Sort keys of mappings no_float32 (bool): Never use float32 to store float numbers (other than for zero). Disabling this might save space at the loss of precision. default (callable): Called for objects which cannot be serialised. Should return a UBJSON-encodable version of the object or raise an EncoderException. Raises: EncoderException: If an encoding failure occured. The following Python types and interfaces (ABCs) are supported (as are any subclasses): +------------------------------+-----------------------------------+ | Python | UBJSON | +==============================+===================================+ | (3) str | string | | (2) unicode | | +------------------------------+-----------------------------------+ | None | null | +------------------------------+-----------------------------------+ | bool | true, false | +------------------------------+-----------------------------------+ | (3) int | uint8, int8, int16, int32, int64, | | (2) int, long | high_precision | +------------------------------+-----------------------------------+ | float | float32, float64, high_precision | +------------------------------+-----------------------------------+ | Decimal | high_precision | +------------------------------+-----------------------------------+ | (3) bytes, bytearray | array (type, uint8) | | (2) str | array (type, uint8) | +------------------------------+-----------------------------------+ | (3) collections.abc.Mapping | object | | (2) collections.Mapping | | +------------------------------+-----------------------------------+ | (3) collections.abc.Sequence | array | | (2) collections.Sequence | | +------------------------------+-----------------------------------+ Notes: - Items are resolved in the order of this table, e.g. if the item implements both Mapping and Sequence interfaces, it will be encoded as a mapping. - None and bool do not use an isinstance check - Numbers in brackets denote Python version. - Only unicode strings in Python 2 are encoded as strings, i.e. for compatibility with e.g. Python 3 one MUST NOT use str in Python 2 (as that will be interpreted as a byte array). - Mapping keys have to be strings: str for Python3 and unicode or str in Python 2. - float conversion rules (depending on no_float32 setting): float32: 1.18e-38 <= abs(value) <= 3.4e38 or value == 0 float64: 2.23e-308 <= abs(value) < 1.8e308 For other values Decimal is used.
[ "Writes", "the", "given", "object", "as", "UBJSON", "to", "the", "provided", "file", "-", "like", "object" ]
80dcacbc7bba1759c69759fb3109ac1c6574da68
https://github.com/Iotic-Labs/py-ubjson/blob/80dcacbc7bba1759c69759fb3109ac1c6574da68/ubjson/encoder.py#L233-L305
train
Writes the given object as UBJSON to the provided file - like object.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsu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xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(6708 - 6597) + chr(0b110001) + chr(0b110001) + chr(0b1111 + 0o43), 15167 - 15159), nzTpIcepk0o8('\060' + chr(9786 - 9675) + chr(50) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(2070 - 2022) + chr(0b1101111) + chr(53) + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(809 - 758) + '\x36' + '\065', ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(55) + chr(51), 62556 - 62548), nzTpIcepk0o8('\060' + '\x6f' + chr(0b10110 + 0o33) + chr(0b110100) + chr(0b11100 + 0o25), 5675 - 5667), nzTpIcepk0o8('\060' + chr(0b110011 + 0o74) + chr(0b10101 + 0o35) + chr(1941 - 1889) + chr(0b1001 + 0o56), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\061' + '\x32' + chr(0b100111 + 0o12), 0b1000), nzTpIcepk0o8(chr(453 - 405) + chr(0b1101111) + '\x33' + '\061' + chr(48), ord("\x08")), nzTpIcepk0o8(chr(1186 - 1138) + '\157' + '\x35' + '\063', 0b1000), nzTpIcepk0o8(chr(382 - 334) + chr(865 - 754) + chr(2410 - 2359) + '\061' + '\067', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(615 - 565) + chr(0b110000) + chr(0b101 + 0o61), 0b1000), nzTpIcepk0o8(chr(0b100011 + 0o15) + '\157' + chr(0b101011 + 0o10) + '\064', 25063 - 25055), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\x6f' + '\062' + chr(53) + chr(48), ord("\x08")), nzTpIcepk0o8('\060' + chr(10365 - 10254) + chr(0b110011) + chr(1547 - 1499) + '\x37', 0o10), nzTpIcepk0o8(chr(1151 - 1103) + chr(0b110111 + 0o70) + '\x33' + chr(0b11100 + 0o33) + '\x37', 38910 - 38902), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(0b1101111) + '\063' + '\x34' + chr(0b100010 + 0o20), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001) + chr(0b110111) + chr(55), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\063' + chr(2264 - 2212) + '\x33', 37636 - 37628), nzTpIcepk0o8('\x30' + chr(111) + chr(1440 - 1391) + '\x32' + '\066', ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(2072 - 2019) + '\x35', 0o10), nzTpIcepk0o8(chr(1190 - 1142) + chr(111) + '\061' + '\066', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\063' + chr(0b110001) + chr(0b101001 + 0o11), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\063' + chr(0b110010) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(3775 - 3664) + '\061' + chr(0b110111) + chr(200 - 145), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31' + chr(1462 - 1409), 64563 - 64555), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(540 - 490) + '\x33' + '\065', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + chr(1794 - 1746) + '\063', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b11111 + 0o23) + '\x35' + chr(0b110000), 8), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(0b1101111) + '\x33' + chr(0b110110) + '\066', 38095 - 38087), nzTpIcepk0o8(chr(0b1111 + 0o41) + '\157' + '\x32' + '\x35' + chr(51), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b110010) + chr(1109 - 1055) + '\x32', 44152 - 44144), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b101100 + 0o7) + chr(0b110011) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b10100 + 0o34) + '\157' + '\061' + chr(649 - 596) + chr(0b110110), 57117 - 57109), nzTpIcepk0o8('\060' + chr(0b1010 + 0o145) + '\061' + chr(0b101 + 0o54) + chr(49), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(49) + '\063' + chr(0b10000 + 0o42), 40532 - 40524), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b110001) + chr(0b11100 + 0o32), 0b1000), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b1101111) + chr(0b100111 + 0o13) + chr(1640 - 1587) + chr(55), 0o10), nzTpIcepk0o8('\x30' + chr(9573 - 9462) + chr(0b110010) + '\060' + chr(0b110000), 2203 - 2195), nzTpIcepk0o8(chr(0b110000) + chr(0b1100 + 0o143) + '\x32' + chr(0b110000 + 0o3) + '\x35', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(9945 - 9834) + chr(1508 - 1455) + chr(898 - 850), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'd'), '\144' + chr(6852 - 6751) + chr(0b1100011) + '\157' + '\144' + chr(101))(chr(0b1110101) + chr(9760 - 9644) + '\x66' + '\x2d' + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def oClt1iVDbhHa(kIMfkyypPTcC, KhXPEIWBXQzE, xCu4hx6oWD1f=nzTpIcepk0o8('\060' + chr(10353 - 10242) + chr(0b110000), 49611 - 49603), H3s_5fuKHTwz=nzTpIcepk0o8(chr(1227 - 1179) + '\157' + chr(0b110000), 8), GF1sS4pLhZ1b=nzTpIcepk0o8(chr(0b11101 + 0o23) + '\157' + chr(49), 34210 - 34202), WmRBchRTeaDt=None): if not typojWN5Phrq(roI3spqORKae(KhXPEIWBXQzE, roI3spqORKae(ES5oEprVxulp(b"'|\x1f\x9dS\x11\xd1`\x84[\xbe\xb4"), chr(0b1100100) + chr(3529 - 3428) + '\143' + '\157' + chr(0b1000010 + 0o42) + chr(3559 - 3458))(chr(0b1000 + 0o155) + '\x74' + '\146' + chr(0b100110 + 0o7) + chr(56)))): raise jZIjKu8IFANs(roI3spqORKae(ES5oEprVxulp(b',`\x01\x82I\x08\xd34\xe8E\xa0\xf2<\xcb\xa6\x93\x8e\x1e\x81:H'), chr(883 - 783) + '\145' + '\x63' + '\x6f' + chr(100) + chr(101))(chr(0b1111 + 0o146) + '\164' + chr(0b101 + 0o141) + '\055' + chr(0b111000))) Y8jpDCBoiq4p = KhXPEIWBXQzE.ml0hhpv1Lpq2 oqA3xfD9QPQj(Y8jpDCBoiq4p, kIMfkyypPTcC, {}, xCu4hx6oWD1f, H3s_5fuKHTwz, GF1sS4pLhZ1b, WmRBchRTeaDt)
Iotic-Labs/py-ubjson
ubjson/encoder.py
dumpb
def dumpb(obj, container_count=False, sort_keys=False, no_float32=True, default=None): """Returns the given object as UBJSON in a bytes instance. See dump() for available arguments.""" with BytesIO() as fp: dump(obj, fp, container_count=container_count, sort_keys=sort_keys, no_float32=no_float32, default=default) return fp.getvalue()
python
def dumpb(obj, container_count=False, sort_keys=False, no_float32=True, default=None): """Returns the given object as UBJSON in a bytes instance. See dump() for available arguments.""" with BytesIO() as fp: dump(obj, fp, container_count=container_count, sort_keys=sort_keys, no_float32=no_float32, default=default) return fp.getvalue()
[ "def", "dumpb", "(", "obj", ",", "container_count", "=", "False", ",", "sort_keys", "=", "False", ",", "no_float32", "=", "True", ",", "default", "=", "None", ")", ":", "with", "BytesIO", "(", ")", "as", "fp", ":", "dump", "(", "obj", ",", "fp", ",", "container_count", "=", "container_count", ",", "sort_keys", "=", "sort_keys", ",", "no_float32", "=", "no_float32", ",", "default", "=", "default", ")", "return", "fp", ".", "getvalue", "(", ")" ]
Returns the given object as UBJSON in a bytes instance. See dump() for available arguments.
[ "Returns", "the", "given", "object", "as", "UBJSON", "in", "a", "bytes", "instance", ".", "See", "dump", "()", "for", "available", "arguments", "." ]
80dcacbc7bba1759c69759fb3109ac1c6574da68
https://github.com/Iotic-Labs/py-ubjson/blob/80dcacbc7bba1759c69759fb3109ac1c6574da68/ubjson/encoder.py#L308-L313
train
Returns the given object as UBJSON in a bytes instance.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUS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urjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(2049 - 2001) + chr(111) + '\062' + chr(0b110100) + chr(0b1111 + 0o42), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(50) + chr(0b110001) + '\067', 14752 - 14744), nzTpIcepk0o8(chr(48) + chr(0b10110 + 0o131) + chr(147 - 96) + chr(0b100 + 0o56) + chr(2451 - 2400), 0o10), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(655 - 600) + chr(0b100101 + 0o17), 0o10), nzTpIcepk0o8(chr(1926 - 1878) + chr(5194 - 5083) + chr(823 - 774) + chr(1989 - 1937) + chr(51), 3337 - 3329), nzTpIcepk0o8(chr(938 - 890) + chr(111) + chr(1600 - 1551) + chr(2186 - 2135) + chr(54), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + chr(0b110000 + 0o5) + '\x36', 0b1000), nzTpIcepk0o8(chr(349 - 301) + '\157' + '\062' + chr(0b110101) + chr(1673 - 1620), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(790 - 739) + chr(690 - 638) + chr(2057 - 2008), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(54) + '\x35', 0b1000), nzTpIcepk0o8(chr(2261 - 2213) + '\157' + chr(0b101001 + 0o11) + chr(51) + chr(1151 - 1098), 31840 - 31832), nzTpIcepk0o8('\x30' + chr(0b111111 + 0o60) + chr(0b110011) + chr(50) + chr(48), 0o10), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b1001110 + 0o41) + chr(99 - 48) + '\060' + '\061', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101000 + 0o7) + chr(54) + '\x31', 0b1000), nzTpIcepk0o8('\060' + chr(0b10000 + 0o137) + chr(855 - 803) + '\064', 0o10), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(3495 - 3384) + chr(51) + chr(2036 - 1982) + chr(0b110011), 47731 - 47723), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b0 + 0o62) + chr(0b110011) + chr(50), 0b1000), nzTpIcepk0o8('\x30' + chr(11308 - 11197) + chr(0b10001 + 0o44), 30022 - 30014), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1610 - 1561) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(859 - 811) + '\157' + chr(0b110011) + chr(0b101111 + 0o7), 55214 - 55206), nzTpIcepk0o8(chr(0b110000) + chr(5569 - 5458) + chr(0b110011 + 0o4) + '\x36', 28056 - 28048), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + '\065' + '\x31', 0o10), nzTpIcepk0o8('\x30' + chr(0b11000 + 0o127) + chr(49) + chr(50), 0b1000), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(111) + '\x31' + chr(0b1100 + 0o46) + '\x34', 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\x33' + chr(2354 - 2300) + '\x36', 38073 - 38065), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(111) + chr(49) + chr(0b1 + 0o65) + chr(50), 0o10), nzTpIcepk0o8(chr(721 - 673) + chr(0b1101111) + chr(0b110010) + '\065' + '\x32', 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + chr(0b110011) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(1896 - 1848) + chr(111) + chr(1996 - 1945) + chr(0b110110), 8), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + '\x30' + chr(363 - 314), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + '\061' + '\x37', 50717 - 50709), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(343 - 292) + chr(0b110000) + chr(48), 31996 - 31988), nzTpIcepk0o8('\x30' + '\157' + chr(0b110001) + '\x32' + chr(50), 0o10), nzTpIcepk0o8(chr(0b1110 + 0o42) + '\157' + chr(49) + '\x34', 0b1000), nzTpIcepk0o8('\060' + chr(12133 - 12022) + chr(49) + chr(0b110110) + chr(0b11100 + 0o33), 0o10), nzTpIcepk0o8(chr(0b1110 + 0o42) + '\x6f' + chr(1192 - 1140) + chr(0b101111 + 0o10), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(1478 - 1430) + chr(0b1101111) + chr(2281 - 2231) + '\x37' + '\061', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + chr(0b110100) + chr(1379 - 1328), 8), nzTpIcepk0o8('\060' + chr(6540 - 6429) + '\x31' + chr(2246 - 2195) + chr(1061 - 1011), 57089 - 57081)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(9899 - 9788) + chr(2374 - 2321) + '\x30', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x8f'), chr(100) + chr(888 - 787) + chr(0b1001110 + 0o25) + '\157' + chr(881 - 781) + chr(101))(chr(12191 - 12074) + chr(9731 - 9615) + chr(2802 - 2700) + chr(1459 - 1414) + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def F7lgbsv1WTFx(kIMfkyypPTcC, xCu4hx6oWD1f=nzTpIcepk0o8(chr(904 - 856) + chr(0b1010101 + 0o32) + chr(988 - 940), 34134 - 34126), H3s_5fuKHTwz=nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\060', 8), GF1sS4pLhZ1b=nzTpIcepk0o8('\060' + chr(0b1101111) + '\061', 0b1000), WmRBchRTeaDt=None): with BVoKtXpmh0oX() as KhXPEIWBXQzE: oClt1iVDbhHa(kIMfkyypPTcC, KhXPEIWBXQzE, container_count=xCu4hx6oWD1f, sort_keys=H3s_5fuKHTwz, no_float32=GF1sS4pLhZ1b, default=WmRBchRTeaDt) return roI3spqORKae(KhXPEIWBXQzE, roI3spqORKae(ES5oEprVxulp(b'\xc6\xea\xa7\xca\x022\x1b\xc8'), chr(3969 - 3869) + '\x65' + chr(0b1001011 + 0o30) + chr(111) + chr(0b1100100) + '\x65')('\x75' + '\164' + chr(0b1100110) + chr(362 - 317) + chr(0b111000)))()
Iotic-Labs/py-ubjson
ez_setup.py
_resolve_version
def _resolve_version(version): """ Resolve LATEST version """ if version is not LATEST: return version resp = urlopen('https://pypi.python.org/pypi/setuptools/json') with contextlib.closing(resp): try: charset = resp.info().get_content_charset() except Exception: # Python 2 compat; assume UTF-8 charset = 'UTF-8' reader = codecs.getreader(charset) doc = json.load(reader(resp)) return str(doc['info']['version'])
python
def _resolve_version(version): """ Resolve LATEST version """ if version is not LATEST: return version resp = urlopen('https://pypi.python.org/pypi/setuptools/json') with contextlib.closing(resp): try: charset = resp.info().get_content_charset() except Exception: # Python 2 compat; assume UTF-8 charset = 'UTF-8' reader = codecs.getreader(charset) doc = json.load(reader(resp)) return str(doc['info']['version'])
[ "def", "_resolve_version", "(", "version", ")", ":", "if", "version", "is", "not", "LATEST", ":", "return", "version", "resp", "=", "urlopen", "(", "'https://pypi.python.org/pypi/setuptools/json'", ")", "with", "contextlib", ".", "closing", "(", "resp", ")", ":", "try", ":", "charset", "=", "resp", ".", "info", "(", ")", ".", "get_content_charset", "(", ")", "except", "Exception", ":", "# Python 2 compat; assume UTF-8", "charset", "=", "'UTF-8'", "reader", "=", "codecs", ".", "getreader", "(", "charset", ")", "doc", "=", "json", ".", "load", "(", "reader", "(", "resp", ")", ")", "return", "str", "(", "doc", "[", "'info'", "]", "[", "'version'", "]", ")" ]
Resolve LATEST version
[ "Resolve", "LATEST", "version" ]
80dcacbc7bba1759c69759fb3109ac1c6574da68
https://github.com/Iotic-Labs/py-ubjson/blob/80dcacbc7bba1759c69759fb3109ac1c6574da68/ez_setup.py#L340-L357
train
Resolve version from LATEST version
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5D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VxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1011010 + 0o25) + '\x33' + chr(2736 - 2683) + '\x30', 0b1000), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1101111) + '\x35' + chr(661 - 606), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + chr(0b11000 + 0o32) + chr(489 - 436), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\063' + '\061' + chr(51), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(49) + chr(1664 - 1610) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(111) + chr(0b1101 + 0o46) + '\x30', 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + chr(50) + chr(557 - 503), ord("\x08")), nzTpIcepk0o8(chr(57 - 9) + chr(111) + chr(0b11010 + 0o32) + chr(50), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\064' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(1339 - 1291) + '\x6f' + '\x35' + chr(0b110001), 25050 - 25042), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(0b1101111) + '\061' + chr(2229 - 2181) + chr(1068 - 1015), 60133 - 60125), nzTpIcepk0o8(chr(0b110000) + chr(0b1010000 + 0o37) + chr(55) + chr(2288 - 2238), ord("\x08")), nzTpIcepk0o8('\x30' + chr(5639 - 5528) + '\061' + chr(294 - 242), 61821 - 61813), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x32' + '\064' + '\065', 55173 - 55165), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(0b101000 + 0o107) + chr(1543 - 1493) + '\067', ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(371 - 321) + chr(1340 - 1287) + chr(0b10101 + 0o36), 0b1000), nzTpIcepk0o8(chr(365 - 317) + chr(0b111101 + 0o62) + chr(0b110011) + chr(0b110010) + chr(0b110010), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b101010 + 0o11) + '\062' + '\064', 105 - 97), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(0b1101111) + '\061' + chr(0b110100) + chr(55), 0b1000), nzTpIcepk0o8(chr(2105 - 2057) + chr(0b101001 + 0o106) + chr(0b10100 + 0o36) + chr(0b101110 + 0o6) + chr(51), 0o10), nzTpIcepk0o8('\060' + chr(0b11000 + 0o127) + '\x31' + '\067' + '\063', 64697 - 64689), nzTpIcepk0o8(chr(716 - 668) + '\x6f' + chr(0b110010) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b1000 + 0o53) + chr(48) + '\064', 14786 - 14778), nzTpIcepk0o8('\060' + '\157' + chr(0b101010 + 0o11) + chr(0b110011 + 0o0) + chr(53), 14469 - 14461), nzTpIcepk0o8('\x30' + '\x6f' + chr(794 - 744) + chr(0b10100 + 0o34) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b101000 + 0o11) + chr(0b11010 + 0o32) + chr(1587 - 1533), 23265 - 23257), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b11001 + 0o31) + '\x30' + chr(0b110110), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x31' + chr(1193 - 1140), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b100001 + 0o22) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + chr(0b11 + 0o62) + chr(2703 - 2651), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + chr(50) + chr(2031 - 1981), 8), nzTpIcepk0o8(chr(48) + '\157' + chr(0b1011 + 0o46) + '\x32' + chr(0b1110 + 0o51), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\062' + '\x31' + '\066', ord("\x08")), nzTpIcepk0o8(chr(1013 - 965) + chr(0b1101111) + '\061' + chr(0b110010) + chr(0b110010), 5823 - 5815), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110011) + chr(0b10101 + 0o41) + '\x34', 0o10), nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(7722 - 7611) + '\x37' + chr(0b101100 + 0o4), 0o10), nzTpIcepk0o8(chr(48) + chr(3884 - 3773) + '\x31' + chr(53) + chr(1236 - 1185), 0o10), nzTpIcepk0o8('\060' + chr(111) + '\x32' + chr(0b110111) + chr(0b100001 + 0o21), ord("\x08")), nzTpIcepk0o8(chr(1767 - 1719) + '\x6f' + chr(0b110011) + chr(0b100 + 0o62) + '\060', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + chr(2067 - 2019) + chr(1111 - 1056), 52149 - 52141)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b100010 + 0o16) + '\157' + '\x35' + '\x30', ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xc6'), '\144' + '\x65' + '\x63' + chr(0b1101111) + chr(8467 - 8367) + '\x65')('\x75' + chr(116) + '\x66' + chr(0b1001 + 0o44) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def GY8dkJgWBbfm(J4eG487sJbAu): if J4eG487sJbAu is not BwWz95EETMZb: return J4eG487sJbAu xxhWttsUDUCM = _txW603MYaaa(roI3spqORKae(ES5oEprVxulp(b'\x80[\xe1\xbb\x02"\xb9\rQP5S"\xd5n\xdf\xba\xbb\t\x8d\x14a\xa3\xf2\xf1\x1f\xf6d6\x1f\xb7#\xfb"\x80W\x04\xd6\x83h\x82\\\xfa\xa5'), '\x64' + chr(0b1010011 + 0o22) + chr(99) + '\x6f' + chr(0b1100100) + '\x65')(chr(10132 - 10015) + '\x74' + '\146' + chr(0b1010 + 0o43) + chr(73 - 17))) with roI3spqORKae(BB23SiHbVeFU, roI3spqORKae(ES5oEprVxulp(b'\x85_\xe5\x84=S\xafc`A\x1ay'), '\x64' + chr(0b1011111 + 0o6) + '\143' + chr(0b1100101 + 0o12) + chr(100) + '\x65')(chr(0b111010 + 0o73) + chr(0b1110100) + chr(6174 - 6072) + '\055' + '\070'))(xxhWttsUDUCM): try: Y27FgH8hiybQ = xxhWttsUDUCM.info().get_content_charset() except zfo2Sgkz3IVJ: Y27FgH8hiybQ = roI3spqORKae(ES5oEprVxulp(b'\xbd{\xd3\xe6I'), '\x64' + chr(9240 - 9139) + chr(0b100010 + 0o101) + chr(11122 - 11011) + chr(1571 - 1471) + chr(0b110011 + 0o62))('\165' + '\164' + chr(0b1000001 + 0o45) + '\x2d' + '\070') kWvgahJQKTiF = Hj8X5RtMNBIn.getreader(Y27FgH8hiybQ) mPg7tgN9u21K = LNUKEwZDIbyb.ZERsdc7c1d8E(kWvgahJQKTiF(xxhWttsUDUCM)) return N9zlRy29S1SS(mPg7tgN9u21K[roI3spqORKae(ES5oEprVxulp(b'\x81A\xf3\xa4'), '\x64' + chr(7225 - 7124) + '\x63' + chr(3551 - 3440) + '\x64' + chr(101))(chr(0b1110101) + '\x74' + chr(102) + '\x2d' + '\x38')][roI3spqORKae(ES5oEprVxulp(b'\x9eJ\xe7\xb8\x18w\xf8'), '\x64' + chr(101) + chr(0b110001 + 0o62) + chr(5091 - 4980) + chr(8496 - 8396) + chr(101))('\x75' + '\164' + '\x66' + '\x2d' + chr(3047 - 2991))])
Iotic-Labs/py-ubjson
ubjson/decoder.py
load
def load(fp, no_bytes=False, object_hook=None, object_pairs_hook=None, intern_object_keys=False): """Decodes and returns UBJSON from the given file-like object Args: fp: read([size])-able object no_bytes (bool): If set, typed UBJSON arrays (uint8) will not be converted to a bytes instance and instead treated like any other array (i.e. result in a list). object_hook (callable): Called with the result of any object literal decoded (instead of dict). object_pairs_hook (callable): Called with the result of any object literal decoded with an ordered list of pairs (instead of dict). Takes precedence over object_hook. intern_object_keys (bool): If set, object keys are interned which can provide a memory saving when many repeated keys are used. NOTE: This is not supported in Python2 (since interning does not apply to unicode) and wil be ignored. Returns: Decoded object Raises: DecoderException: If an encoding failure occured. UBJSON types are mapped to Python types as follows. Numbers in brackets denote Python version. +----------------------------------+---------------+ | UBJSON | Python | +==================================+===============+ | object | dict | +----------------------------------+---------------+ | array | list | +----------------------------------+---------------+ | string | (3) str | | | (2) unicode | +----------------------------------+---------------+ | uint8, int8, int16, int32, int64 | (3) int | | | (2) int, long | +----------------------------------+---------------+ | float32, float64 | float | +----------------------------------+---------------+ | high_precision | Decimal | +----------------------------------+---------------+ | array (typed, uint8) | (3) bytes | | | (2) str | +----------------------------------+---------------+ | true | True | +----------------------------------+---------------+ | false | False | +----------------------------------+---------------+ | null | None | +----------------------------------+---------------+ """ if object_pairs_hook is None and object_hook is None: object_hook = __object_hook_noop if not callable(fp.read): raise TypeError('fp.read not callable') fp_read = fp.read marker = fp_read(1) try: try: return __METHOD_MAP[marker](fp_read, marker) except KeyError: pass if marker == ARRAY_START: return __decode_array(fp_read, bool(no_bytes), object_hook, object_pairs_hook, intern_object_keys) elif marker == OBJECT_START: return __decode_object(fp_read, bool(no_bytes), object_hook, object_pairs_hook, intern_object_keys) else: raise DecoderException('Invalid marker') except DecoderException as ex: raise_from(DecoderException(ex.args[0], fp), ex)
python
def load(fp, no_bytes=False, object_hook=None, object_pairs_hook=None, intern_object_keys=False): """Decodes and returns UBJSON from the given file-like object Args: fp: read([size])-able object no_bytes (bool): If set, typed UBJSON arrays (uint8) will not be converted to a bytes instance and instead treated like any other array (i.e. result in a list). object_hook (callable): Called with the result of any object literal decoded (instead of dict). object_pairs_hook (callable): Called with the result of any object literal decoded with an ordered list of pairs (instead of dict). Takes precedence over object_hook. intern_object_keys (bool): If set, object keys are interned which can provide a memory saving when many repeated keys are used. NOTE: This is not supported in Python2 (since interning does not apply to unicode) and wil be ignored. Returns: Decoded object Raises: DecoderException: If an encoding failure occured. UBJSON types are mapped to Python types as follows. Numbers in brackets denote Python version. +----------------------------------+---------------+ | UBJSON | Python | +==================================+===============+ | object | dict | +----------------------------------+---------------+ | array | list | +----------------------------------+---------------+ | string | (3) str | | | (2) unicode | +----------------------------------+---------------+ | uint8, int8, int16, int32, int64 | (3) int | | | (2) int, long | +----------------------------------+---------------+ | float32, float64 | float | +----------------------------------+---------------+ | high_precision | Decimal | +----------------------------------+---------------+ | array (typed, uint8) | (3) bytes | | | (2) str | +----------------------------------+---------------+ | true | True | +----------------------------------+---------------+ | false | False | +----------------------------------+---------------+ | null | None | +----------------------------------+---------------+ """ if object_pairs_hook is None and object_hook is None: object_hook = __object_hook_noop if not callable(fp.read): raise TypeError('fp.read not callable') fp_read = fp.read marker = fp_read(1) try: try: return __METHOD_MAP[marker](fp_read, marker) except KeyError: pass if marker == ARRAY_START: return __decode_array(fp_read, bool(no_bytes), object_hook, object_pairs_hook, intern_object_keys) elif marker == OBJECT_START: return __decode_object(fp_read, bool(no_bytes), object_hook, object_pairs_hook, intern_object_keys) else: raise DecoderException('Invalid marker') except DecoderException as ex: raise_from(DecoderException(ex.args[0], fp), ex)
[ "def", "load", "(", "fp", ",", "no_bytes", "=", "False", ",", "object_hook", "=", "None", ",", "object_pairs_hook", "=", "None", ",", "intern_object_keys", "=", "False", ")", ":", "if", "object_pairs_hook", "is", "None", "and", "object_hook", "is", "None", ":", "object_hook", "=", "__object_hook_noop", "if", "not", "callable", "(", "fp", ".", "read", ")", ":", "raise", "TypeError", "(", "'fp.read not callable'", ")", "fp_read", "=", "fp", ".", "read", "marker", "=", "fp_read", "(", "1", ")", "try", ":", "try", ":", "return", "__METHOD_MAP", "[", "marker", "]", "(", "fp_read", ",", "marker", ")", "except", "KeyError", ":", "pass", "if", "marker", "==", "ARRAY_START", ":", "return", "__decode_array", "(", "fp_read", ",", "bool", "(", "no_bytes", ")", ",", "object_hook", ",", "object_pairs_hook", ",", "intern_object_keys", ")", "elif", "marker", "==", "OBJECT_START", ":", "return", "__decode_object", "(", "fp_read", ",", "bool", "(", "no_bytes", ")", ",", "object_hook", ",", "object_pairs_hook", ",", "intern_object_keys", ")", "else", ":", "raise", "DecoderException", "(", "'Invalid marker'", ")", "except", "DecoderException", "as", "ex", ":", "raise_from", "(", "DecoderException", "(", "ex", ".", "args", "[", "0", "]", ",", "fp", ")", ",", "ex", ")" ]
Decodes and returns UBJSON from the given file-like object Args: fp: read([size])-able object no_bytes (bool): If set, typed UBJSON arrays (uint8) will not be converted to a bytes instance and instead treated like any other array (i.e. result in a list). object_hook (callable): Called with the result of any object literal decoded (instead of dict). object_pairs_hook (callable): Called with the result of any object literal decoded with an ordered list of pairs (instead of dict). Takes precedence over object_hook. intern_object_keys (bool): If set, object keys are interned which can provide a memory saving when many repeated keys are used. NOTE: This is not supported in Python2 (since interning does not apply to unicode) and wil be ignored. Returns: Decoded object Raises: DecoderException: If an encoding failure occured. UBJSON types are mapped to Python types as follows. Numbers in brackets denote Python version. +----------------------------------+---------------+ | UBJSON | Python | +==================================+===============+ | object | dict | +----------------------------------+---------------+ | array | list | +----------------------------------+---------------+ | string | (3) str | | | (2) unicode | +----------------------------------+---------------+ | uint8, int8, int16, int32, int64 | (3) int | | | (2) int, long | +----------------------------------+---------------+ | float32, float64 | float | +----------------------------------+---------------+ | high_precision | Decimal | +----------------------------------+---------------+ | array (typed, uint8) | (3) bytes | | | (2) str | +----------------------------------+---------------+ | true | True | +----------------------------------+---------------+ | false | False | +----------------------------------+---------------+ | null | None | +----------------------------------+---------------+
[ "Decodes", "and", "returns", "UBJSON", "from", "the", "given", "file", "-", "like", "object" ]
80dcacbc7bba1759c69759fb3109ac1c6574da68
https://github.com/Iotic-Labs/py-ubjson/blob/80dcacbc7bba1759c69759fb3109ac1c6574da68/ubjson/decoder.py#L307-L383
train
Decodes and returns UBJSON from the given file - like object.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV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uW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\157' + '\x33' + '\x34' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(4973 - 4862) + chr(0b1111 + 0o42) + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + '\x37' + '\060', 0b1000), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b1101111) + chr(343 - 289) + chr(654 - 600), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + chr(1301 - 1247) + '\065', 9799 - 9791), nzTpIcepk0o8('\x30' + chr(0b1011010 + 0o25) + '\x32' + chr(0b100000 + 0o22) + chr(55), 0b1000), nzTpIcepk0o8(chr(2224 - 2176) + chr(0b110000 + 0o77) + chr(0b110001) + chr(0b101111 + 0o4) + chr(1505 - 1457), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1011111 + 0o20) + chr(1785 - 1734) + '\x30' + chr(53), ord("\x08")), nzTpIcepk0o8(chr(480 - 432) + '\x6f' + '\062' + chr(0b110011) + '\x34', 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + '\067' + '\x36', ord("\x08")), nzTpIcepk0o8('\x30' + chr(1811 - 1700) + chr(0b110100) + '\066', 9618 - 9610), nzTpIcepk0o8(chr(48) + chr(0b1010 + 0o145) + '\062' + chr(52) + '\x31', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x32' + chr(0b110111) + chr(48), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + '\063' + chr(53), 65014 - 65006), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b100100 + 0o16) + chr(55) + chr(54), 57719 - 57711), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b101111 + 0o4) + '\064', 8935 - 8927), nzTpIcepk0o8(chr(0b101101 + 0o3) + '\157' + '\x33' + chr(2316 - 2262) + chr(49), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(48) + chr(0b1111 + 0o47), 11503 - 11495), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001) + chr(0b110 + 0o61) + chr(1752 - 1704), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1180 - 1131) + chr(2340 - 2290) + '\x35', 0b1000), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(12130 - 12019) + chr(0b110010) + '\x33' + '\061', ord("\x08")), nzTpIcepk0o8(chr(436 - 388) + chr(111) + chr(1912 - 1862) + '\065' + chr(0b110101), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(766 - 716) + chr(878 - 830) + chr(49), 0o10), nzTpIcepk0o8(chr(280 - 232) + chr(0b1111 + 0o140) + chr(1570 - 1521) + chr(1029 - 980) + '\065', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(117 - 67) + '\x34' + '\x31', 8), nzTpIcepk0o8('\060' + '\157' + chr(0b10110 + 0o33) + chr(2268 - 2214) + chr(430 - 376), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(2573 - 2522) + chr(49) + '\x31', 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(50) + chr(0b110000 + 0o4) + '\x35', 0b1000), nzTpIcepk0o8('\x30' + chr(0b10001 + 0o136) + '\x32' + chr(0b110010) + chr(50), 50637 - 50629), nzTpIcepk0o8('\x30' + '\x6f' + chr(50) + '\x32' + '\x33', 0b1000), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(111) + chr(51) + chr(48) + chr(0b10011 + 0o44), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + '\063' + '\062' + '\067', 0b1000), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b11000 + 0o127) + '\063' + chr(0b101110 + 0o6) + '\x30', 8), nzTpIcepk0o8('\x30' + '\157' + chr(0b11111 + 0o30) + '\065', 4500 - 4492), nzTpIcepk0o8(chr(48) + chr(4454 - 4343) + chr(0b110110), 53268 - 53260), nzTpIcepk0o8('\x30' + '\157' + chr(1818 - 1768) + '\x36' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\x31' + chr(50) + '\x31', 63389 - 63381), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110010) + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b110010 + 0o2) + '\060', ord("\x08")), nzTpIcepk0o8(chr(294 - 246) + chr(0b100110 + 0o111) + '\061' + chr(708 - 658), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(111) + '\065' + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xce'), '\x64' + chr(0b1100101) + '\x63' + '\157' + chr(0b1100100) + chr(0b1100101))(chr(117) + '\x74' + chr(0b1100110) + chr(0b100100 + 0o11) + chr(0b11001 + 0o37)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def ZERsdc7c1d8E(KhXPEIWBXQzE, qpYFL7x8wa8r=nzTpIcepk0o8(chr(0b110000) + chr(0b1101110 + 0o1) + '\x30', 0o10), _K_qgp_3RqWy=None, dKGW0p23hYtL=None, zCf5cPkzCFGO=nzTpIcepk0o8('\x30' + '\157' + '\x30', 8)): if dKGW0p23hYtL is None and _K_qgp_3RqWy is None: _K_qgp_3RqWy = NGfcENRFZlkG if not typojWN5Phrq(roI3spqORKae(KhXPEIWBXQzE, roI3spqORKae(ES5oEprVxulp(b'\x85`\xa0]\xdb\xdfo\x9d\xc9\x90\x11\xcc'), chr(7474 - 7374) + chr(101) + chr(99) + chr(111) + chr(0b1100100) + '\145')('\165' + '\x74' + chr(102) + chr(1482 - 1437) + '\070'))): raise jZIjKu8IFANs(roI3spqORKae(ES5oEprVxulp(b'\x86\x7f\xd6D\xd0\xf6<\xe5\xf2\x91R\x81\xdb\xbc\xd2p\x90\xa4\x140'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(0b1001100 + 0o43) + '\x64' + chr(2436 - 2335))(chr(1522 - 1405) + chr(0b1110100) + chr(7590 - 7488) + '\055' + chr(0b10100 + 0o44))) qznHtSh_d9aw = KhXPEIWBXQzE.eoXknH7XUn7m uic71ZuNaAED = qznHtSh_d9aw(nzTpIcepk0o8(chr(48) + chr(0b1011011 + 0o24) + chr(49), 0b1000)) try: try: return LmtgUwhYpFSu[uic71ZuNaAED](qznHtSh_d9aw, uic71ZuNaAED) except knUxyjfq07F9: pass if uic71ZuNaAED == WHBKS7K2EDT1: return lZolibxOt4Pq(qznHtSh_d9aw, TVUhqOt5_BbS(qpYFL7x8wa8r), _K_qgp_3RqWy, dKGW0p23hYtL, zCf5cPkzCFGO) elif uic71ZuNaAED == SS7hanhKQFss: return DX8e8bp6If09(qznHtSh_d9aw, TVUhqOt5_BbS(qpYFL7x8wa8r), _K_qgp_3RqWy, dKGW0p23hYtL, zCf5cPkzCFGO) else: raise slRd8B8FwpLW(roI3spqORKae(ES5oEprVxulp(b'\xa9a\x8eW\xd9\xfe<\xe5\xf1\x9fT\xca\xdd\xaf'), chr(6756 - 6656) + chr(0b1100101) + '\143' + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1101001 + 0o14) + chr(116) + chr(102) + '\x2d' + chr(0b111000))) except slRd8B8FwpLW as dclkBu6Bdnnh: btxiPW5PQaSD(slRd8B8FwpLW(roI3spqORKae(dclkBu6Bdnnh, roI3spqORKae(ES5oEprVxulp(b'\x85j\x95f\xec\xe7j\xb3\xe8\xaau\xd3'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + chr(11655 - 11544) + chr(3704 - 3604) + chr(4112 - 4011))(chr(9197 - 9080) + chr(0b1110100) + '\x66' + '\x2d' + '\070'))[nzTpIcepk0o8('\x30' + '\157' + chr(1348 - 1300), 8)], KhXPEIWBXQzE), dclkBu6Bdnnh)
Iotic-Labs/py-ubjson
ubjson/decoder.py
loadb
def loadb(chars, no_bytes=False, object_hook=None, object_pairs_hook=None, intern_object_keys=False): """Decodes and returns UBJSON from the given bytes or bytesarray object. See load() for available arguments.""" with BytesIO(chars) as fp: return load(fp, no_bytes=no_bytes, object_hook=object_hook, object_pairs_hook=object_pairs_hook, intern_object_keys=intern_object_keys)
python
def loadb(chars, no_bytes=False, object_hook=None, object_pairs_hook=None, intern_object_keys=False): """Decodes and returns UBJSON from the given bytes or bytesarray object. See load() for available arguments.""" with BytesIO(chars) as fp: return load(fp, no_bytes=no_bytes, object_hook=object_hook, object_pairs_hook=object_pairs_hook, intern_object_keys=intern_object_keys)
[ "def", "loadb", "(", "chars", ",", "no_bytes", "=", "False", ",", "object_hook", "=", "None", ",", "object_pairs_hook", "=", "None", ",", "intern_object_keys", "=", "False", ")", ":", "with", "BytesIO", "(", "chars", ")", "as", "fp", ":", "return", "load", "(", "fp", ",", "no_bytes", "=", "no_bytes", ",", "object_hook", "=", "object_hook", ",", "object_pairs_hook", "=", "object_pairs_hook", ",", "intern_object_keys", "=", "intern_object_keys", ")" ]
Decodes and returns UBJSON from the given bytes or bytesarray object. See load() for available arguments.
[ "Decodes", "and", "returns", "UBJSON", "from", "the", "given", "bytes", "or", "bytesarray", "object", ".", "See", "load", "()", "for", "available", "arguments", "." ]
80dcacbc7bba1759c69759fb3109ac1c6574da68
https://github.com/Iotic-Labs/py-ubjson/blob/80dcacbc7bba1759c69759fb3109ac1c6574da68/ubjson/decoder.py#L386-L391
train
Decodes and returns UBJSON from the given bytes or bytesarray object. See load for available arguments.
GiP5xwVCF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FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + '\063' + chr(54), 0o10), nzTpIcepk0o8(chr(725 - 677) + chr(2419 - 2308) + chr(0b110010) + chr(0b110011) + chr(53), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(1566 - 1516) + chr(0b110010), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b1001 + 0o56) + '\x37', 43739 - 43731), nzTpIcepk0o8('\x30' + chr(10420 - 10309) + chr(0b11111 + 0o22) + chr(809 - 761) + chr(0b11100 + 0o31), 58653 - 58645), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(54), 0b1000), nzTpIcepk0o8(chr(48) + chr(9243 - 9132) + chr(0b100000 + 0o22) + '\060', 0o10), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(111) + chr(49) + chr(0b100110 + 0o17) + chr(52), 0o10), nzTpIcepk0o8(chr(1224 - 1176) + '\x6f' + chr(51) + '\x35' + chr(0b0 + 0o66), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + '\x32', 8), nzTpIcepk0o8('\x30' + chr(10354 - 10243) + chr(0b110010) + chr(55) + chr(54), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + '\062' + '\x32', 0o10), nzTpIcepk0o8(chr(722 - 674) + chr(5544 - 5433) + chr(50) + chr(0b1111 + 0o47), 8), nzTpIcepk0o8(chr(1534 - 1486) + chr(111) + chr(0b110011) + chr(0b110100), 31912 - 31904), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(55) + chr(0b11 + 0o55), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b110000 + 0o1) + chr(0b110101) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(445 - 397) + chr(3221 - 3110) + chr(0b101100 + 0o5) + chr(0b11010 + 0o35) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(4297 - 4186) + chr(0b100110 + 0o17) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\x32' + chr(0b110101) + chr(50), 35440 - 35432), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(0b1101111) + chr(0b110010) + chr(0b110110) + '\063', 47717 - 47709), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110010) + chr(1985 - 1931) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(0b11011 + 0o25) + '\157' + '\x31' + '\060', 11130 - 11122), nzTpIcepk0o8('\x30' + chr(111) + '\063' + '\060' + chr(0b110101), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(49) + chr(0b110010) + '\066', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\x32' + '\x31' + '\063', ord("\x08")), nzTpIcepk0o8(chr(0b101110 + 0o2) + '\x6f' + chr(0b110011) + chr(0b1111 + 0o43) + chr(1247 - 1196), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110011) + chr(55) + '\061', 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(50) + chr(2737 - 2684) + '\060', 19917 - 19909), nzTpIcepk0o8('\x30' + '\157' + chr(0b110010) + chr(0b110001) + chr(0b11001 + 0o33), 0b1000), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(0b1011100 + 0o23) + chr(0b110011) + chr(53) + chr(0b11000 + 0o31), 0b1000), nzTpIcepk0o8('\x30' + chr(0b100111 + 0o110) + chr(0b1 + 0o60) + chr(0b10111 + 0o36) + '\062', 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\061' + chr(0b110011) + chr(0b11 + 0o63), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(290 - 241) + '\060' + '\064', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x33' + chr(0b10000 + 0o46) + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(7114 - 7003) + chr(0b110001) + '\x33', 53813 - 53805), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\061' + '\061' + chr(53), 0b1000), nzTpIcepk0o8(chr(2178 - 2130) + chr(0b1101111) + chr(0b110001) + chr(233 - 181) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(53) + chr(0b1100 + 0o46), 8), nzTpIcepk0o8(chr(48) + '\157' + chr(2517 - 2466) + '\x31' + chr(0b11111 + 0o26), ord("\x08")), nzTpIcepk0o8(chr(1136 - 1088) + '\x6f' + chr(0b100011 + 0o16), 61397 - 61389)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(833 - 785) + chr(10180 - 10069) + '\x35' + chr(996 - 948), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xf0'), chr(0b1100100) + chr(0b1100000 + 0o5) + '\143' + chr(0b1011 + 0o144) + chr(100) + chr(0b1100101))(chr(0b111100 + 0o71) + chr(116) + chr(0b1111 + 0o127) + chr(0b101101) + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def CIzCZeXll6mw(wL3UV5GQm7Iv, qpYFL7x8wa8r=nzTpIcepk0o8('\060' + '\x6f' + '\x30', 0o10), _K_qgp_3RqWy=None, dKGW0p23hYtL=None, zCf5cPkzCFGO=nzTpIcepk0o8('\x30' + chr(0b10101 + 0o132) + chr(0b10111 + 0o31), 8)): with BVoKtXpmh0oX(wL3UV5GQm7Iv) as KhXPEIWBXQzE: return ZERsdc7c1d8E(KhXPEIWBXQzE, no_bytes=qpYFL7x8wa8r, object_hook=_K_qgp_3RqWy, object_pairs_hook=dKGW0p23hYtL, intern_object_keys=zCf5cPkzCFGO)
jborean93/requests-credssp
requests_credssp/asn_structures.py
TSRequest.check_error_code
def check_error_code(self): """ For CredSSP version of 3 or newer, the server can response with an NtStatus error code with details of what error occurred. This method will check if the error code exists and throws an NTStatusException if it is no STATUS_SUCCESS. """ # start off with STATUS_SUCCESS as a baseline status = NtStatusCodes.STATUS_SUCCESS error_code = self['errorCode'] if error_code.isValue: # ASN.1 Integer is stored as an signed integer, we need to # convert it to a unsigned integer status = ctypes.c_uint32(error_code).value if status != NtStatusCodes.STATUS_SUCCESS: raise NTStatusException(status)
python
def check_error_code(self): """ For CredSSP version of 3 or newer, the server can response with an NtStatus error code with details of what error occurred. This method will check if the error code exists and throws an NTStatusException if it is no STATUS_SUCCESS. """ # start off with STATUS_SUCCESS as a baseline status = NtStatusCodes.STATUS_SUCCESS error_code = self['errorCode'] if error_code.isValue: # ASN.1 Integer is stored as an signed integer, we need to # convert it to a unsigned integer status = ctypes.c_uint32(error_code).value if status != NtStatusCodes.STATUS_SUCCESS: raise NTStatusException(status)
[ "def", "check_error_code", "(", "self", ")", ":", "# start off with STATUS_SUCCESS as a baseline", "status", "=", "NtStatusCodes", ".", "STATUS_SUCCESS", "error_code", "=", "self", "[", "'errorCode'", "]", "if", "error_code", ".", "isValue", ":", "# ASN.1 Integer is stored as an signed integer, we need to", "# convert it to a unsigned integer", "status", "=", "ctypes", ".", "c_uint32", "(", "error_code", ")", ".", "value", "if", "status", "!=", "NtStatusCodes", ".", "STATUS_SUCCESS", ":", "raise", "NTStatusException", "(", "status", ")" ]
For CredSSP version of 3 or newer, the server can response with an NtStatus error code with details of what error occurred. This method will check if the error code exists and throws an NTStatusException if it is no STATUS_SUCCESS.
[ "For", "CredSSP", "version", "of", "3", "or", "newer", "the", "server", "can", "response", "with", "an", "NtStatus", "error", "code", "with", "details", "of", "what", "error", "occurred", ".", "This", "method", "will", "check", "if", "the", "error", "code", "exists", "and", "throws", "an", "NTStatusException", "if", "it", "is", "no", "STATUS_SUCCESS", "." ]
470db8d74dff919da67cf382e9ff784d4e8dd053
https://github.com/jborean93/requests-credssp/blob/470db8d74dff919da67cf382e9ff784d4e8dd053/requests_credssp/asn_structures.py#L108-L125
train
Check if the error code exists and if not raise an NTStatusException.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy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ytesWarning,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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\157' + '\x33' + chr(0b110011) + '\063', 0b1000), nzTpIcepk0o8('\060' + chr(1454 - 1343) + chr(674 - 624) + chr(0b110010), 9601 - 9593), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b1101111) + '\x32' + '\064' + '\x37', ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\x32' + chr(0b110001) + chr(52), 0b1000), nzTpIcepk0o8('\060' + chr(0b1001100 + 0o43) + '\x32' + chr(51) + '\x35', 8019 - 8011), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b101000 + 0o12) + chr(1703 - 1652), 0b1000), nzTpIcepk0o8(chr(302 - 254) + chr(6423 - 6312) + chr(0b110110) + chr(0b10 + 0o56), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1011011 + 0o24) + chr(0b110010) + chr(52) + chr(0b110011), 57894 - 57886), nzTpIcepk0o8('\x30' + '\157' + chr(51) + '\066' + chr(0b110100), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1000011 + 0o54) + '\x31' + '\x34' + chr(0b101001 + 0o11), 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\x33' + '\062' + chr(0b110110), 0o10), nzTpIcepk0o8(chr(2068 - 2020) + chr(111) + chr(2501 - 2449) + '\065', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1100101 + 0o12) + chr(0b1 + 0o66) + chr(0b110001 + 0o5), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b1000 + 0o54) + chr(0b110001 + 0o1), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(1272 - 1223) + chr(0b10110 + 0o37) + chr(48), 64013 - 64005), nzTpIcepk0o8(chr(1030 - 982) + '\157' + chr(0b110011) + chr(0b1000 + 0o56) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b10000 + 0o40) + '\x6f' + chr(49) + '\x31' + '\x37', 42633 - 42625), nzTpIcepk0o8('\060' + '\x6f' + chr(376 - 325) + chr(0b110000) + '\x32', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + chr(53) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(693 - 582) + chr(1999 - 1945) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b100010 + 0o23) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(454 - 406) + chr(111) + '\063' + '\060' + '\x32', 8), nzTpIcepk0o8('\060' + chr(0b1000110 + 0o51) + '\061' + '\063' + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1011 + 0o144) + chr(0b110001) + '\061' + '\064', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(7972 - 7861) + chr(0b110101) + chr(1500 - 1452), 36379 - 36371), nzTpIcepk0o8(chr(0b101101 + 0o3) + '\157' + chr(0b110101) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b1101111) + chr(0b110010) + chr(0b110000) + chr(0b110010 + 0o3), 0o10), nzTpIcepk0o8(chr(622 - 574) + '\157' + '\067' + chr(1175 - 1126), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\064' + '\x31', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(49) + chr(0b1110 + 0o47) + chr(0b110110 + 0o0), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + '\x35' + chr(48), 328 - 320), nzTpIcepk0o8(chr(48) + '\157' + '\065', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(2416 - 2365) + '\x30' + '\065', ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b100100 + 0o15) + chr(0b110000) + chr(0b100100 + 0o22), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(237 - 187) + chr(0b110001) + chr(0b110010), 0o10), nzTpIcepk0o8(chr(474 - 426) + '\157' + '\x31' + '\x37' + chr(0b11011 + 0o27), 0b1000), nzTpIcepk0o8(chr(0b11101 + 0o23) + '\157' + chr(1935 - 1885) + chr(0b110000) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b10111 + 0o130) + chr(0b110001) + chr(54) + '\x30', 22336 - 22328), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(111) + chr(0b11 + 0o60) + '\x34' + chr(0b101011 + 0o6), 0b1000), nzTpIcepk0o8('\060' + chr(0b1010111 + 0o30) + chr(0b110011) + chr(0b110110) + chr(1197 - 1146), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\157' + chr(53) + chr(0b11010 + 0o26), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xf5'), chr(100) + chr(101) + chr(7056 - 6957) + chr(0b101100 + 0o103) + chr(0b1100100) + chr(0b1010 + 0o133))('\x75' + chr(116) + '\146' + '\055' + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def may9CTvl3Pri(hXMPsSrOQzbh): TiBiMspMPXEL = _x_acg85utE9.STATUS_SUCCESS DF48qJTBP5Fb = hXMPsSrOQzbh[roI3spqORKae(ES5oEprVxulp(b'\xbe`\xd5\xe3\xef\x10_\xc7\x91'), chr(0b1100100) + chr(101) + chr(1938 - 1839) + '\x6f' + '\144' + chr(101))('\165' + chr(7079 - 6963) + chr(0b1100110) + chr(0b101101) + chr(0b100110 + 0o22))] if roI3spqORKae(DF48qJTBP5Fb, roI3spqORKae(ES5oEprVxulp(b'\xb2a\xf1\xed\xf1&U'), chr(0b1110 + 0o126) + chr(2523 - 2422) + '\143' + chr(0b1101111) + '\144' + chr(101))(chr(4850 - 4733) + chr(0b1110100) + chr(6085 - 5983) + chr(886 - 841) + chr(56))): TiBiMspMPXEL = LQAYBHVg474W.c_uint32(DF48qJTBP5Fb).uV9iBiw0y_Mp if TiBiMspMPXEL != roI3spqORKae(_x_acg85utE9, roI3spqORKae(ES5oEprVxulp(b'\x88F\xe6\xd8\xc8\x00o\xf0\xa1!\x95`mq'), '\x64' + chr(101) + '\143' + '\x6f' + '\x64' + '\145')('\165' + '\x74' + chr(0b1001 + 0o135) + chr(0b101101) + chr(56))): raise vUOqkhTg3AbB(TiBiMspMPXEL)
jborean93/requests-credssp
requests_credssp/spnego.py
get_auth_context
def get_auth_context(hostname, username, password, auth_mech): """ Returns an AuthContext used in the CredSSP authentication process and to wrap/unwrap tokens sent to and from the client. This step get's the context based on the auth_mech configured and what is available on the server. It tries to favour system libraries like SSPI (Windows) or GSSAPI (Unix) if possible but falls back to a Python implementation of NTLM that works on all platforms. While in some cases the system libraries are used and they may not require a password to authenticate, CredSSP requires the password as it is sent to the remote host and so we won't rely on the user's logon tokens. :param hostname: The hostname of the server, this should be the FQDN when kerberos is desired :param username: The username to authenticate with :param password: The password of username :param auth_mech: The authentication mechanism to use; auto: Uses the SPNEGO/Negotiate mechanism which tries Kerberos if possible and then falls back to NTLM kerberos: Only allow authentication with Kerberos ntlm: Only allow authentication with NTLM :return: tuple AuthContext: The authentication context chosen that has been init generator step: The Python generator that takes further input tokens and produces output tokens to send to the server bytes first token: The first output token to send to the server """ if auth_mech not in ["auto", "ntlm", "kerberos"]: raise InvalidConfigurationException("Invalid auth_mech supplied " "%s, must be auto, ntlm, or " "kerberos" % auth_mech) context_init = False out_token = None context_gen = None if HAS_SSPI: # always use SSPI when it is available log.debug("SSPI is available and will be used as auth backend") context = SSPIContext(hostname, username, password, auth_mech) elif HAS_GSSAPI: mechs_available = ["kerberos"] # to save on computing costs we only check the mechs that are available # when auth_mech is auto or ntlm as it doesn't matter when kerberos # is set (Kerberos is always available when python-gssapi is installed if auth_mech != "kerberos": log.debug("GSSAPI is available, determine what mechanism to use " "as auth backend") mechs_available = GSSAPIContext.get_mechs_available() log.debug("GSSAPI mechs available: %s" % ", ".join(mechs_available)) if auth_mech in mechs_available or auth_mech == "kerberos": log.debug("GSSAPI with mech %s is being used as auth backend" % auth_mech) context = GSSAPIContext(hostname, username, password, auth_mech) elif auth_mech == "ntlm": log.debug("GSSAPI is available but does not support NTLM, using " "ntlm-auth as auth backend instead") context = NTLMContext(username, password) else: # make sure we can actually initialise a GSSAPI context in auto, # otherwise fallback to NTLMContext if that fails # we need to explicitly set auth_mech as kerberos if the GSSAPI # implementation does not support NTLM so we know to use NTLM if # GSSAPI fails try: log.debug("Attempting to use GSSAPI Kerberos as auth backend") context = GSSAPIContext(hostname, username, password, "kerberos") context.init_context() context_gen = context.step() out_token = next(context_gen) context_init = True log.info("GSSAPI with mech kerberos is being used as auth " "backend") except gssapi.exceptions.GSSError as err: log.warning("Failed to initialise GSSAPI context, falling " "back to NTLM: %s" % str(err)) context = NTLMContext(username, password) else: log.debug("SSPI or GSSAPI is not available, using ntlm-auth as auth " "backend") if auth_mech == "kerberos": raise InvalidConfigurationException("The auth_mechanism is set " "to kerberos but SSPI or " "GSSAPI is not available") context = NTLMContext(username, password) # we only init the context when HAS_GSSAPI and it doesn't natively offer # SPNEGO that works with Windows, so let's init it here if not context_init: context.init_context() context_gen = context.step() out_token = next(context_gen) return context, context_gen, out_token
python
def get_auth_context(hostname, username, password, auth_mech): """ Returns an AuthContext used in the CredSSP authentication process and to wrap/unwrap tokens sent to and from the client. This step get's the context based on the auth_mech configured and what is available on the server. It tries to favour system libraries like SSPI (Windows) or GSSAPI (Unix) if possible but falls back to a Python implementation of NTLM that works on all platforms. While in some cases the system libraries are used and they may not require a password to authenticate, CredSSP requires the password as it is sent to the remote host and so we won't rely on the user's logon tokens. :param hostname: The hostname of the server, this should be the FQDN when kerberos is desired :param username: The username to authenticate with :param password: The password of username :param auth_mech: The authentication mechanism to use; auto: Uses the SPNEGO/Negotiate mechanism which tries Kerberos if possible and then falls back to NTLM kerberos: Only allow authentication with Kerberos ntlm: Only allow authentication with NTLM :return: tuple AuthContext: The authentication context chosen that has been init generator step: The Python generator that takes further input tokens and produces output tokens to send to the server bytes first token: The first output token to send to the server """ if auth_mech not in ["auto", "ntlm", "kerberos"]: raise InvalidConfigurationException("Invalid auth_mech supplied " "%s, must be auto, ntlm, or " "kerberos" % auth_mech) context_init = False out_token = None context_gen = None if HAS_SSPI: # always use SSPI when it is available log.debug("SSPI is available and will be used as auth backend") context = SSPIContext(hostname, username, password, auth_mech) elif HAS_GSSAPI: mechs_available = ["kerberos"] # to save on computing costs we only check the mechs that are available # when auth_mech is auto or ntlm as it doesn't matter when kerberos # is set (Kerberos is always available when python-gssapi is installed if auth_mech != "kerberos": log.debug("GSSAPI is available, determine what mechanism to use " "as auth backend") mechs_available = GSSAPIContext.get_mechs_available() log.debug("GSSAPI mechs available: %s" % ", ".join(mechs_available)) if auth_mech in mechs_available or auth_mech == "kerberos": log.debug("GSSAPI with mech %s is being used as auth backend" % auth_mech) context = GSSAPIContext(hostname, username, password, auth_mech) elif auth_mech == "ntlm": log.debug("GSSAPI is available but does not support NTLM, using " "ntlm-auth as auth backend instead") context = NTLMContext(username, password) else: # make sure we can actually initialise a GSSAPI context in auto, # otherwise fallback to NTLMContext if that fails # we need to explicitly set auth_mech as kerberos if the GSSAPI # implementation does not support NTLM so we know to use NTLM if # GSSAPI fails try: log.debug("Attempting to use GSSAPI Kerberos as auth backend") context = GSSAPIContext(hostname, username, password, "kerberos") context.init_context() context_gen = context.step() out_token = next(context_gen) context_init = True log.info("GSSAPI with mech kerberos is being used as auth " "backend") except gssapi.exceptions.GSSError as err: log.warning("Failed to initialise GSSAPI context, falling " "back to NTLM: %s" % str(err)) context = NTLMContext(username, password) else: log.debug("SSPI or GSSAPI is not available, using ntlm-auth as auth " "backend") if auth_mech == "kerberos": raise InvalidConfigurationException("The auth_mechanism is set " "to kerberos but SSPI or " "GSSAPI is not available") context = NTLMContext(username, password) # we only init the context when HAS_GSSAPI and it doesn't natively offer # SPNEGO that works with Windows, so let's init it here if not context_init: context.init_context() context_gen = context.step() out_token = next(context_gen) return context, context_gen, out_token
[ "def", "get_auth_context", "(", "hostname", ",", "username", ",", "password", ",", "auth_mech", ")", ":", "if", "auth_mech", "not", "in", "[", "\"auto\"", ",", "\"ntlm\"", ",", "\"kerberos\"", "]", ":", "raise", "InvalidConfigurationException", "(", "\"Invalid auth_mech supplied \"", "\"%s, must be auto, ntlm, or \"", "\"kerberos\"", "%", "auth_mech", ")", "context_init", "=", "False", "out_token", "=", "None", "context_gen", "=", "None", "if", "HAS_SSPI", ":", "# always use SSPI when it is available", "log", ".", "debug", "(", "\"SSPI is available and will be used as auth backend\"", ")", "context", "=", "SSPIContext", "(", "hostname", ",", "username", ",", "password", ",", "auth_mech", ")", "elif", "HAS_GSSAPI", ":", "mechs_available", "=", "[", "\"kerberos\"", "]", "# to save on computing costs we only check the mechs that are available", "# when auth_mech is auto or ntlm as it doesn't matter when kerberos", "# is set (Kerberos is always available when python-gssapi is installed", "if", "auth_mech", "!=", "\"kerberos\"", ":", "log", ".", "debug", "(", "\"GSSAPI is available, determine what mechanism to use \"", "\"as auth backend\"", ")", "mechs_available", "=", "GSSAPIContext", ".", "get_mechs_available", "(", ")", "log", ".", "debug", "(", "\"GSSAPI mechs available: %s\"", "%", "\", \"", ".", "join", "(", "mechs_available", ")", ")", "if", "auth_mech", "in", "mechs_available", "or", "auth_mech", "==", "\"kerberos\"", ":", "log", ".", "debug", "(", "\"GSSAPI with mech %s is being used as auth backend\"", "%", "auth_mech", ")", "context", "=", "GSSAPIContext", "(", "hostname", ",", "username", ",", "password", ",", "auth_mech", ")", "elif", "auth_mech", "==", "\"ntlm\"", ":", "log", ".", "debug", "(", "\"GSSAPI is available but does not support NTLM, using \"", "\"ntlm-auth as auth backend instead\"", ")", "context", "=", "NTLMContext", "(", "username", ",", "password", ")", "else", ":", "# make sure we can actually initialise a GSSAPI context in auto,", "# otherwise fallback to NTLMContext if that fails", "# we need to explicitly set auth_mech as kerberos if the GSSAPI", "# implementation does not support NTLM so we know to use NTLM if", "# GSSAPI fails", "try", ":", "log", ".", "debug", "(", "\"Attempting to use GSSAPI Kerberos as auth backend\"", ")", "context", "=", "GSSAPIContext", "(", "hostname", ",", "username", ",", "password", ",", "\"kerberos\"", ")", "context", ".", "init_context", "(", ")", "context_gen", "=", "context", ".", "step", "(", ")", "out_token", "=", "next", "(", "context_gen", ")", "context_init", "=", "True", "log", ".", "info", "(", "\"GSSAPI with mech kerberos is being used as auth \"", "\"backend\"", ")", "except", "gssapi", ".", "exceptions", ".", "GSSError", "as", "err", ":", "log", ".", "warning", "(", "\"Failed to initialise GSSAPI context, falling \"", "\"back to NTLM: %s\"", "%", "str", "(", "err", ")", ")", "context", "=", "NTLMContext", "(", "username", ",", "password", ")", "else", ":", "log", ".", "debug", "(", "\"SSPI or GSSAPI is not available, using ntlm-auth as auth \"", "\"backend\"", ")", "if", "auth_mech", "==", "\"kerberos\"", ":", "raise", "InvalidConfigurationException", "(", "\"The auth_mechanism is set \"", "\"to kerberos but SSPI or \"", "\"GSSAPI is not available\"", ")", "context", "=", "NTLMContext", "(", "username", ",", "password", ")", "# we only init the context when HAS_GSSAPI and it doesn't natively offer", "# SPNEGO that works with Windows, so let's init it here", "if", "not", "context_init", ":", "context", ".", "init_context", "(", ")", "context_gen", "=", "context", ".", "step", "(", ")", "out_token", "=", "next", "(", "context_gen", ")", "return", "context", ",", "context_gen", ",", "out_token" ]
Returns an AuthContext used in the CredSSP authentication process and to wrap/unwrap tokens sent to and from the client. This step get's the context based on the auth_mech configured and what is available on the server. It tries to favour system libraries like SSPI (Windows) or GSSAPI (Unix) if possible but falls back to a Python implementation of NTLM that works on all platforms. While in some cases the system libraries are used and they may not require a password to authenticate, CredSSP requires the password as it is sent to the remote host and so we won't rely on the user's logon tokens. :param hostname: The hostname of the server, this should be the FQDN when kerberos is desired :param username: The username to authenticate with :param password: The password of username :param auth_mech: The authentication mechanism to use; auto: Uses the SPNEGO/Negotiate mechanism which tries Kerberos if possible and then falls back to NTLM kerberos: Only allow authentication with Kerberos ntlm: Only allow authentication with NTLM :return: tuple AuthContext: The authentication context chosen that has been init generator step: The Python generator that takes further input tokens and produces output tokens to send to the server bytes first token: The first output token to send to the server
[ "Returns", "an", "AuthContext", "used", "in", "the", "CredSSP", "authentication", "process", "and", "to", "wrap", "/", "unwrap", "tokens", "sent", "to", "and", "from", "the", "client", ".", "This", "step", "get", "s", "the", "context", "based", "on", "the", "auth_mech", "configured", "and", "what", "is", "available", "on", "the", "server", ".", "It", "tries", "to", "favour", "system", "libraries", "like", "SSPI", "(", "Windows", ")", "or", "GSSAPI", "(", "Unix", ")", "if", "possible", "but", "falls", "back", "to", "a", "Python", "implementation", "of", "NTLM", "that", "works", "on", "all", "platforms", "." ]
470db8d74dff919da67cf382e9ff784d4e8dd053
https://github.com/jborean93/requests-credssp/blob/470db8d74dff919da67cf382e9ff784d4e8dd053/requests_credssp/spnego.py#L34-L129
train
This function returns an AuthContext used in the CredSSP authentication process and the AuthContext generator used in the CredSSP authentication process.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2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8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1183 - 1135) + chr(0b1101111) + chr(534 - 483) + chr(0b101011 + 0o5) + '\x31', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b1101 + 0o47) + '\062', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1001001 + 0o46) + '\061' + chr(0b1000 + 0o52) + '\x34', 0o10), nzTpIcepk0o8('\060' + chr(0b1011101 + 0o22) + chr(2360 - 2311) + chr(48) + chr(0b101010 + 0o6), 0b1000), nzTpIcepk0o8('\060' + chr(7326 - 7215) + chr(50) + chr(0b110001) + chr(48), 0o10), nzTpIcepk0o8(chr(147 - 99) + '\157' + chr(2289 - 2239) + chr(630 - 575) + chr(48), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(10430 - 10319) + chr(0b110001) + chr(2015 - 1966) + chr(1909 - 1855), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110000 + 0o1) + '\065' + chr(1895 - 1844), 21256 - 21248), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(259 - 210) + chr(810 - 762) + chr(1470 - 1419), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(0b110100) + chr(2833 - 2779), 56241 - 56233), nzTpIcepk0o8('\x30' + '\x6f' + chr(58 - 9), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + chr(0b110101), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\062' + chr(0b100111 + 0o20) + chr(49), 49485 - 49477), nzTpIcepk0o8('\060' + chr(0b10100 + 0o133) + '\x37' + chr(1239 - 1186), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(49) + chr(0b110000) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(1680 - 1632) + chr(0b1010 + 0o145) + chr(0b110011) + '\x32' + '\x37', 60526 - 60518), nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(111) + chr(49) + chr(0b110000), 37780 - 37772), nzTpIcepk0o8(chr(48) + '\157' + chr(52) + chr(50), 20410 - 20402), nzTpIcepk0o8('\060' + chr(111) + chr(0b1010 + 0o51) + '\x34' + chr(0b110001 + 0o4), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(2503 - 2449) + '\x35', 64985 - 64977), nzTpIcepk0o8(chr(1180 - 1132) + '\157' + '\x31' + '\065', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(0b100000 + 0o25) + chr(1551 - 1501), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b11000 + 0o34) + '\x34', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(51) + chr(0b110000) + '\x32', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(1960 - 1911) + chr(50) + '\067', ord("\x08")), nzTpIcepk0o8(chr(2183 - 2135) + '\157' + chr(0b110001) + chr(0b110101), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31' + chr(0b110111) + '\066', 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110000 + 0o2) + chr(0b100010 + 0o17) + chr(0b11010 + 0o34), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b10110 + 0o35) + chr(0b110000) + '\x35', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b101100 + 0o103) + chr(0b110001) + chr(0b10001 + 0o46) + '\061', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1559 - 1508) + chr(48) + '\067', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1106 - 1054) + chr(0b110011), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1100110 + 0o11) + '\061' + chr(0b11100 + 0o32), 0b1000), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(7432 - 7321) + '\063' + chr(0b110001) + chr(52), 10910 - 10902), nzTpIcepk0o8('\060' + chr(111) + '\x32' + chr(53) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(768 - 720) + '\157' + chr(876 - 826) + chr(0b100101 + 0o17) + chr(0b100010 + 0o20), 31151 - 31143), nzTpIcepk0o8(chr(0b10000 + 0o40) + '\157' + '\062' + chr(0b11000 + 0o30) + '\x37', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(50) + chr(55) + chr(0b10110 + 0o40), 30402 - 30394), nzTpIcepk0o8(chr(0b101111 + 0o1) + '\157' + chr(0b1110 + 0o45) + chr(2528 - 2475) + chr(0b1 + 0o64), 0o10), nzTpIcepk0o8(chr(48) + chr(7956 - 7845) + chr(49) + chr(0b110100) + chr(0b110111), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b100001 + 0o24) + '\x30', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xef'), chr(0b10001 + 0o123) + '\145' + '\143' + chr(111) + '\x64' + '\145')('\x75' + '\x74' + chr(5303 - 5201) + chr(0b101101) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def xyTJBYrzCX0U(NGLFNiXb9IZu, fNAasCkJEM0V, CgN2oEkfPaa_, nqA1p1BT164Q): if nqA1p1BT164Q not in [roI3spqORKae(ES5oEprVxulp(b'\xa0\x97 /'), chr(0b1100100) + chr(6858 - 6757) + chr(0b1100011) + chr(0b1101111) + '\144' + chr(2354 - 2253))(chr(0b1110101) + chr(7676 - 7560) + chr(102) + chr(1000 - 955) + chr(0b11010 + 0o36)), roI3spqORKae(ES5oEprVxulp(b'\xaf\x968-'), '\x64' + '\x65' + '\x63' + '\x6f' + chr(1609 - 1509) + chr(0b101000 + 0o75))(chr(7565 - 7448) + '\164' + chr(0b1010 + 0o134) + '\x2d' + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'\xaa\x87&"\xed\xca!\x18'), chr(8938 - 8838) + chr(0b1100101) + chr(99) + '\157' + chr(100) + '\x65')('\165' + '\164' + chr(0b111110 + 0o50) + chr(45) + '\070')]: raise wmSjtIANwrAL(roI3spqORKae(ES5oEprVxulp(b'\x88\x8c"!\xe4\xd1*K"Suu\xe6P$\xb4`\x02\x96@}\x1aH\xab2i^\xab\xb6U\xe7N{\xbf\xd9\x82\xe5\xdb\xcd\x06\xb4\x96;l\xa8\xd6:\x07.\n!r\xcb\x1d*\xb2z@\x80Gb\x19'), chr(0b1100100) + '\x65' + chr(4777 - 4678) + '\157' + '\x64' + '\x65')('\165' + chr(0b1110100) + chr(0b111010 + 0o54) + '\055' + chr(2291 - 2235)) % nqA1p1BT164Q) BHgg4sGZ_FhM = nzTpIcepk0o8(chr(0b110000) + chr(1955 - 1844) + chr(48), 37165 - 37157) _2eD29dXGjLS = None vOFgzCCAo5uf = None if NekXpfQ5VZXK: roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'\xa6\xa3m\x1a\xb1\xdc!]\x16KDG'), chr(0b1100100) + '\145' + chr(99) + '\x6f' + chr(100) + chr(0b110001 + 0o64))(chr(0b1100100 + 0o21) + chr(116) + '\x66' + chr(0b101101) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'\x92\xb1\x04\t\xa8\xd1=K"P`t\xd5\\#\xbbm\x02\x84[iJS\xab;a^\xec\xa0Y\xb2Pk\xa8\x8d\xc3\xf4\x9e\x8c\x12\xb5\x8at"\xe9\xdb%\x0e-B'), chr(0b100001 + 0o103) + chr(4389 - 4288) + chr(5214 - 5115) + chr(111) + chr(7011 - 6911) + chr(0b1100101))('\x75' + '\164' + chr(0b1001100 + 0o32) + chr(45) + chr(0b101111 + 0o11))) xwFiQMStTnzU = cgwYF7rvNFTE(NGLFNiXb9IZu, fNAasCkJEM0V, CgN2oEkfPaa_, nqA1p1BT164Q) elif GEbxbngwT5Yr: MepQzrjl4kLj = [roI3spqORKae(ES5oEprVxulp(b'\xaa\x87&"\xed\xca!\x18'), chr(100) + '\x65' + '\x63' + chr(111) + chr(0b1100100) + chr(5697 - 5596))(chr(0b10011 + 0o142) + chr(0b1110100) + chr(0b1100110) + '\x2d' + chr(0b111000))] if nqA1p1BT164Q != roI3spqORKae(ES5oEprVxulp(b'\xaa\x87&"\xed\xca!\x18'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(10793 - 10682) + '\x64' + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(0b1001010 + 0o34) + '\055' + chr(328 - 272)): roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'\xa6\xa3m\x1a\xb1\xdc!]\x16KDG'), chr(0b1100100) + chr(101) + chr(0b11100 + 0o107) + chr(895 - 784) + chr(100) + chr(1302 - 1201))(chr(117) + chr(0b1110001 + 0o3) + chr(0b11101 + 0o111) + chr(45) + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'\x86\xb1\x07\x01\xd8\xf1n\x020\x06`k\xd8T-\xb6jN\x80\x19-\x0eA\xb62\x7f\x13\xe7\xab\x1c\xe7Tf\xad\xd9\x82\xea\xdb\x8e\x0f\xa0\x8c=3\xe5\x98:\x04cSrx\x99\\2\xf7iW\x91]-\x08E\xa1<h\x10\xea'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(0b111011 + 0o64) + '\x64' + '\x65')(chr(0b1110101) + chr(8649 - 8533) + chr(0b1100110) + '\055' + '\x38')) MepQzrjl4kLj = R2GtVZYJEYoQ.get_mechs_available() roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'\xa6\xa3m\x1a\xb1\xdc!]\x16KDG'), chr(5987 - 5887) + chr(101) + '\x63' + '\157' + chr(100) + chr(0b1100101))('\x75' + '\x74' + chr(102) + '\055' + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'\x86\xb1\x07\x01\xd8\xf1n\x06&Ein\x99\\7\xb6aN\x84Wa\x0f\x1e\xe2r~'), chr(2709 - 2609) + chr(0b10 + 0o143) + chr(0b110110 + 0o55) + chr(0b111011 + 0o64) + '\144' + chr(0b10100 + 0o121))(chr(0b1110101) + chr(0b1101111 + 0o5) + '\146' + chr(0b101101) + chr(56)) % roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xed\xc2'), chr(0b1001110 + 0o26) + chr(101) + chr(1808 - 1709) + chr(0b1101111) + chr(6542 - 6442) + '\145')(chr(2548 - 2431) + chr(0b1110100) + '\x66' + chr(0b101101) + '\070'), roI3spqORKae(ES5oEprVxulp(b'\x98\xd6-\r\xb1\xfa-\r\x17eOl'), chr(100) + chr(8033 - 7932) + chr(0b11011 + 0o110) + chr(111) + chr(0b1100100) + chr(0b10000 + 0o125))(chr(0b1110101) + chr(12119 - 12003) + '\x66' + '\x2d' + chr(0b0 + 0o70)))(MepQzrjl4kLj)) if nqA1p1BT164Q in MepQzrjl4kLj or nqA1p1BT164Q == roI3spqORKae(ES5oEprVxulp(b'\xaa\x87&"\xed\xca!\x18'), chr(1032 - 932) + chr(0b11111 + 0o106) + '\143' + '\157' + chr(0b1100100) + chr(7579 - 7478))(chr(0b1010101 + 0o40) + chr(116) + chr(0b1100110) + chr(45) + chr(964 - 908)): roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'\xa6\xa3m\x1a\xb1\xdc!]\x16KDG'), chr(9080 - 8980) + chr(0b111110 + 0o47) + chr(0b11000 + 0o113) + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(13344 - 13227) + '\x74' + chr(3790 - 3688) + chr(0b101100 + 0o1) + '\070'))(roI3spqORKae(ES5oEprVxulp(b'\x86\xb1\x07\x01\xd8\xf1n\x1c*Ri=\xd4X"\xbf(\x07\x96\x15d\x19\x04\xa02d\x10\xe9\xe5\x0c\xb4Fj\xec\xcc\xd1\xa7\xdf\x98\x13\xa9\xc26!\xeb\xd3+\x05\''), chr(100) + '\145' + '\143' + '\157' + chr(0b1000000 + 0o44) + '\x65')('\165' + chr(0b1110100) + '\x66' + chr(478 - 433) + chr(0b11011 + 0o35)) % nqA1p1BT164Q) xwFiQMStTnzU = R2GtVZYJEYoQ(NGLFNiXb9IZu, fNAasCkJEM0V, CgN2oEkfPaa_, nqA1p1BT164Q) elif nqA1p1BT164Q == roI3spqORKae(ES5oEprVxulp(b'\xaf\x968-'), '\x64' + chr(0b110110 + 0o57) + chr(0b1100011) + '\x6f' + chr(0b1100100) + '\x65')('\165' + '\164' + chr(6338 - 6236) + chr(0b101101) + '\070'): roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'\xa6\xa3m\x1a\xb1\xdc!]\x16KDG'), '\144' + '\145' + chr(0b110001 + 0o62) + chr(0b1011010 + 0o25) + '\144' + chr(10035 - 9934))(chr(0b1110101) + chr(4897 - 4781) + '\146' + chr(0b101101) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'\x86\xb1\x07\x01\xd8\xf1n\x020\x06`k\xd8T-\xb6jN\x80\x15o\x1fP\xe23b\x1b\xfd\xe5\x17\xa8W.\xbf\xd8\xd2\xf7\xd1\x9f\x13\xe1\xac\x00\x0c\xc5\x94n\x1e0Ooz\x99S5\xbbe\x0f\x84@y\x02\x04\xa3$-\x1f\xfb\xb1\x11\xe7Ao\xaf\xc6\xc7\xe9\xda\xcd\x0e\xaf\x91 %\xe9\xdc'), '\x64' + chr(0b10010 + 0o123) + chr(0b1100010 + 0o1) + '\x6f' + chr(0b1100100) + chr(1025 - 924))(chr(117) + '\x74' + '\x66' + chr(0b100111 + 0o6) + chr(0b1 + 0o67))) xwFiQMStTnzU = uqFN6RsoHS2f(fNAasCkJEM0V, CgN2oEkfPaa_) else: try: roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'\xa6\xa3m\x1a\xb1\xdc!]\x16KDG'), chr(0b1100100) + chr(0b1001011 + 0o32) + '\x63' + chr(0b1100101 + 0o12) + chr(935 - 835) + chr(0b1100101))(chr(0b100111 + 0o116) + '\164' + chr(10147 - 10045) + chr(431 - 386) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b"\x80\x96 %\xe5\xc8:\x02-A!i\xd6\x1d4\xa4m\x02\xa2f^+t\x8bwF\x1b\xfc\xa7\x1c\xb5L}\xec\xcc\xd1\xa7\xdf\x98\x13\xa9\xc26!\xeb\xd3+\x05'"), chr(0b11101 + 0o107) + '\x65' + '\x63' + chr(111) + chr(0b1100100) + chr(0b1100101))('\x75' + '\x74' + chr(0b110 + 0o140) + chr(0b1110 + 0o37) + chr(0b111000))) xwFiQMStTnzU = R2GtVZYJEYoQ(NGLFNiXb9IZu, fNAasCkJEM0V, CgN2oEkfPaa_, roI3spqORKae(ES5oEprVxulp(b'\xaa\x87&"\xed\xca!\x18'), '\144' + chr(0b100 + 0o141) + '\x63' + '\x6f' + chr(100) + chr(101))(chr(0b101000 + 0o115) + chr(116) + chr(102) + '\055' + chr(0b101100 + 0o14))) roI3spqORKae(xwFiQMStTnzU, roI3spqORKae(ES5oEprVxulp(b'\xa8\x8c=4\xd7\xdb!\x057Cyi'), '\144' + chr(0b1100101) + chr(5919 - 5820) + chr(6920 - 6809) + chr(100) + '\x65')('\x75' + '\164' + chr(102) + '\055' + '\070'))() vOFgzCCAo5uf = xwFiQMStTnzU.ZiKB99Xs91Lo() _2eD29dXGjLS = ltB3XhPy2rYf(vOFgzCCAo5uf) BHgg4sGZ_FhM = nzTpIcepk0o8(chr(0b110000) + '\157' + '\x31', 8) roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'\xa8\x9a\x1a8\xb1\xf494rAsR'), chr(0b1100100) + chr(121 - 20) + chr(0b1100011) + chr(8903 - 8792) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + '\x74' + '\x66' + '\055' + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'\x86\xb1\x07\x01\xd8\xf1n\x1c*Ri=\xd4X"\xbf(I\x80Go\x0fV\xad$-\x17\xfd\xe5\x1b\xa2J`\xab\x8d\xd7\xf4\xdb\x89G\xa0\x91t!\xfd\xcc&K!Gbv\xdcS%'), '\x64' + chr(101) + chr(99) + '\157' + chr(0b100000 + 0o104) + '\145')('\165' + '\164' + chr(0b1100110) + chr(1990 - 1945) + '\070')) except roI3spqORKae(hjuUzBhdMrmC.exceptions, roI3spqORKae(ES5oEprVxulp(b'\x86\xb1\x07\x05\xfa\xca!\x19'), chr(0b1010011 + 0o21) + chr(1106 - 1005) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(0b1000 + 0o135))('\165' + '\164' + chr(102) + '\055' + chr(1910 - 1854))) as oNU3PevgmWAO: roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'\xb6\x83&.\xe1\xd6)'), '\x64' + chr(101) + chr(99) + '\157' + '\x64' + chr(0b1001011 + 0o32))('\x75' + '\x74' + chr(0b101 + 0o141) + chr(0b100111 + 0o6) + '\070'))(roI3spqORKae(ES5oEprVxulp(b"\x87\x83=,\xed\xdcn\x1f,\x06hs\xd0I(\xb6dK\x96P--w\x91\x16]7\xae\xa6\x16\xa9Wk\xb4\xd9\x8e\xa7\xd8\x8c\x0b\xad\x8b:'\xa8\xda/\x08(\x06ur\x99s\x15\x9bE\x18\xc5\x10~"), chr(0b1100100) + '\x65' + '\143' + chr(0b1101111) + '\x64' + '\145')('\x75' + chr(4031 - 3915) + '\x66' + chr(0b0 + 0o55) + chr(0b101000 + 0o20)) % N9zlRy29S1SS(oNU3PevgmWAO)) xwFiQMStTnzU = uqFN6RsoHS2f(fNAasCkJEM0V, CgN2oEkfPaa_) else: roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'\xa6\xa3m\x1a\xb1\xdc!]\x16KDG'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(3775 - 3664) + chr(1172 - 1072) + '\145')(chr(11550 - 11433) + '\164' + '\146' + chr(0b101101) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'\x92\xb1\x04\t\xa8\xd7<K\x04uR\\\xe9ta\xbe{\x02\x8bZyJE\xb46d\x12\xef\xa7\x15\xa2\x0f.\xb9\xde\xcb\xe9\xd9\xcd\t\xb5\x8e9m\xe9\xcd:\x03cGr=\xd8H5\xbf(@\x84Vf\x0fJ\xa6'), '\x64' + '\x65' + '\143' + chr(111) + chr(100) + chr(101))(chr(117) + chr(0b1110100) + chr(10314 - 10212) + chr(45) + chr(0b1101 + 0o53))) if nqA1p1BT164Q == roI3spqORKae(ES5oEprVxulp(b'\xaa\x87&"\xed\xca!\x18'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(0b11 + 0o141) + chr(0b1100000 + 0o5))(chr(0b1110101) + chr(0b1001100 + 0o50) + chr(0b1010010 + 0o24) + chr(0b101101) + chr(56)): raise wmSjtIANwrAL(roI3spqORKae(ES5oEprVxulp(b'\x95\x8a1`\xe9\xcd:\x03\x1cKd~\xd1\\/\xbe{O\xc5\\~JW\xa7#-\n\xe1\xe5\x12\xa2Ql\xa9\xdf\xcd\xf4\x9e\x8f\x12\xb5\xc2\x07\x13\xd8\xf1n\x041\x06FN\xea|\x11\x9e(K\x96\x15c\x05P\xe26{\x1f\xe7\xa9\x18\xa5Ok'), chr(0b1100100) + chr(101) + chr(2549 - 2450) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(4138 - 4021) + chr(0b1110100) + chr(0b100011 + 0o103) + '\x2d' + chr(0b111000))) xwFiQMStTnzU = uqFN6RsoHS2f(fNAasCkJEM0V, CgN2oEkfPaa_) if not BHgg4sGZ_FhM: roI3spqORKae(xwFiQMStTnzU, roI3spqORKae(ES5oEprVxulp(b'\xa8\x8c=4\xd7\xdb!\x057Cyi'), '\x64' + chr(0b1010011 + 0o22) + chr(1476 - 1377) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b1 + 0o163) + '\146' + chr(0b101101) + chr(0b10111 + 0o41)))() vOFgzCCAo5uf = xwFiQMStTnzU.ZiKB99Xs91Lo() _2eD29dXGjLS = ltB3XhPy2rYf(vOFgzCCAo5uf) return (xwFiQMStTnzU, vOFgzCCAo5uf, _2eD29dXGjLS)
jborean93/requests-credssp
requests_credssp/spnego.py
GSSAPIContext.get_mechs_available
def get_mechs_available(): """ Returns a list of auth mechanisms that are available to the local GSSAPI instance. Because we are interacting with Windows, we only care if SPNEGO, Kerberos and NTLM are available where NTLM is the only wildcard that may not be available by default. The only NTLM implementation that works properly is gss-ntlmssp and part of this test is to verify the gss-ntlmssp OID GSS_NTLMSSP_RESET_CRYPTO_OID_LENGTH is implemented which is required for SPNEGO and NTLM to work properly. :return: list - A list of supported mechs available in the installed version of GSSAPI """ ntlm_oid = GSSAPIContext._AUTH_MECHANISMS['ntlm'] ntlm_mech = gssapi.OID.from_int_seq(ntlm_oid) # GSS_NTLMSSP_RESET_CRYPTO_OID_LENGTH # github.com/simo5/gss-ntlmssp/blob/master/src/gssapi_ntlmssp.h#L68 reset_mech = gssapi.OID.from_int_seq("1.3.6.1.4.1.7165.655.1.3") try: # we don't actually care about the account used here so just use # a random username and password ntlm_context = GSSAPIContext._get_security_context( gssapi.NameType.user, ntlm_mech, "http@server", "username", "password" ) ntlm_context.step() set_sec_context_option(reset_mech, context=ntlm_context, value=b"\x00" * 4) except gssapi.exceptions.GSSError as exc: # failed to init NTLM and verify gss-ntlmssp is available, this # means NTLM is either not available or won't work # (not gss-ntlmssp) so we return kerberos as the only available # mechanism for the GSSAPI Context log.debug("Failed to init test NTLM context with GSSAPI: %s" % str(exc)) return ['kerberos'] else: return ['auto', 'kerberos', 'ntlm']
python
def get_mechs_available(): """ Returns a list of auth mechanisms that are available to the local GSSAPI instance. Because we are interacting with Windows, we only care if SPNEGO, Kerberos and NTLM are available where NTLM is the only wildcard that may not be available by default. The only NTLM implementation that works properly is gss-ntlmssp and part of this test is to verify the gss-ntlmssp OID GSS_NTLMSSP_RESET_CRYPTO_OID_LENGTH is implemented which is required for SPNEGO and NTLM to work properly. :return: list - A list of supported mechs available in the installed version of GSSAPI """ ntlm_oid = GSSAPIContext._AUTH_MECHANISMS['ntlm'] ntlm_mech = gssapi.OID.from_int_seq(ntlm_oid) # GSS_NTLMSSP_RESET_CRYPTO_OID_LENGTH # github.com/simo5/gss-ntlmssp/blob/master/src/gssapi_ntlmssp.h#L68 reset_mech = gssapi.OID.from_int_seq("1.3.6.1.4.1.7165.655.1.3") try: # we don't actually care about the account used here so just use # a random username and password ntlm_context = GSSAPIContext._get_security_context( gssapi.NameType.user, ntlm_mech, "http@server", "username", "password" ) ntlm_context.step() set_sec_context_option(reset_mech, context=ntlm_context, value=b"\x00" * 4) except gssapi.exceptions.GSSError as exc: # failed to init NTLM and verify gss-ntlmssp is available, this # means NTLM is either not available or won't work # (not gss-ntlmssp) so we return kerberos as the only available # mechanism for the GSSAPI Context log.debug("Failed to init test NTLM context with GSSAPI: %s" % str(exc)) return ['kerberos'] else: return ['auto', 'kerberos', 'ntlm']
[ "def", "get_mechs_available", "(", ")", ":", "ntlm_oid", "=", "GSSAPIContext", ".", "_AUTH_MECHANISMS", "[", "'ntlm'", "]", "ntlm_mech", "=", "gssapi", ".", "OID", ".", "from_int_seq", "(", "ntlm_oid", ")", "# GSS_NTLMSSP_RESET_CRYPTO_OID_LENGTH", "# github.com/simo5/gss-ntlmssp/blob/master/src/gssapi_ntlmssp.h#L68", "reset_mech", "=", "gssapi", ".", "OID", ".", "from_int_seq", "(", "\"1.3.6.1.4.1.7165.655.1.3\"", ")", "try", ":", "# we don't actually care about the account used here so just use", "# a random username and password", "ntlm_context", "=", "GSSAPIContext", ".", "_get_security_context", "(", "gssapi", ".", "NameType", ".", "user", ",", "ntlm_mech", ",", "\"http@server\"", ",", "\"username\"", ",", "\"password\"", ")", "ntlm_context", ".", "step", "(", ")", "set_sec_context_option", "(", "reset_mech", ",", "context", "=", "ntlm_context", ",", "value", "=", "b\"\\x00\"", "*", "4", ")", "except", "gssapi", ".", "exceptions", ".", "GSSError", "as", "exc", ":", "# failed to init NTLM and verify gss-ntlmssp is available, this", "# means NTLM is either not available or won't work", "# (not gss-ntlmssp) so we return kerberos as the only available", "# mechanism for the GSSAPI Context", "log", ".", "debug", "(", "\"Failed to init test NTLM context with GSSAPI: %s\"", "%", "str", "(", "exc", ")", ")", "return", "[", "'kerberos'", "]", "else", ":", "return", "[", "'auto'", ",", "'kerberos'", ",", "'ntlm'", "]" ]
Returns a list of auth mechanisms that are available to the local GSSAPI instance. Because we are interacting with Windows, we only care if SPNEGO, Kerberos and NTLM are available where NTLM is the only wildcard that may not be available by default. The only NTLM implementation that works properly is gss-ntlmssp and part of this test is to verify the gss-ntlmssp OID GSS_NTLMSSP_RESET_CRYPTO_OID_LENGTH is implemented which is required for SPNEGO and NTLM to work properly. :return: list - A list of supported mechs available in the installed version of GSSAPI
[ "Returns", "a", "list", "of", "auth", "mechanisms", "that", "are", "available", "to", "the", "local", "GSSAPI", "instance", ".", "Because", "we", "are", "interacting", "with", "Windows", "we", "only", "care", "if", "SPNEGO", "Kerberos", "and", "NTLM", "are", "available", "where", "NTLM", "is", "the", "only", "wildcard", "that", "may", "not", "be", "available", "by", "default", "." ]
470db8d74dff919da67cf382e9ff784d4e8dd053
https://github.com/jborean93/requests-credssp/blob/470db8d74dff919da67cf382e9ff784d4e8dd053/requests_credssp/spnego.py#L397-L440
train
Returns a list of auth mechanisms that are available to the local one.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3b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eError,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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(616 - 505) + chr(0b110010) + chr(48) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b11010 + 0o26) + '\157' + chr(0b110011) + chr(2298 - 2247) + '\065', 53257 - 53249), nzTpIcepk0o8(chr(48) + chr(111) + '\062' + chr(0b110000) + '\x34', 12044 - 12036), nzTpIcepk0o8('\060' + chr(111) + '\x31' + '\x33' + chr(366 - 314), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(0b110010) + '\x36' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\x6f' + chr(0b100101 + 0o15) + chr(52) + '\060', ord("\x08")), nzTpIcepk0o8(chr(2041 - 1993) + chr(0b10110 + 0o131) + '\061' + '\066', 0b1000), nzTpIcepk0o8(chr(1661 - 1613) + '\x6f' + '\061' + chr(55) + chr(1258 - 1210), ord("\x08")), nzTpIcepk0o8(chr(1037 - 989) + '\x6f' + chr(50) + chr(0b110011) + chr(49), 0o10), nzTpIcepk0o8(chr(1435 - 1387) + '\x6f' + chr(50) + '\x33' + chr(2858 - 2804), 0b1000), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\157' + '\x32' + chr(1549 - 1495) + chr(0b11 + 0o55), 33956 - 33948), nzTpIcepk0o8('\x30' + chr(11885 - 11774) + chr(1847 - 1796) + chr(0b1010 + 0o55) + chr(0b110000), 63734 - 63726), nzTpIcepk0o8('\060' + '\157' + chr(50) + chr(0b110111) + '\x36', 63272 - 63264), nzTpIcepk0o8(chr(0b11100 + 0o24) + '\157' + '\x32' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(4669 - 4558) + '\x36' + chr(50), 0b1000), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(0b100010 + 0o115) + chr(0b110111) + '\x36', 32407 - 32399), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110011) + chr(50) + '\x33', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b111000 + 0o67) + chr(0b101110 + 0o3) + chr(2020 - 1968) + chr(49), 0b1000), nzTpIcepk0o8('\060' + chr(12242 - 12131) + '\061' + chr(1882 - 1827) + chr(1718 - 1670), 8), nzTpIcepk0o8('\060' + chr(111) + chr(0b110111) + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(7585 - 7474) + '\065' + chr(48), 0o10), nzTpIcepk0o8(chr(768 - 720) + chr(935 - 824) + '\x32' + chr(0b110001) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b0 + 0o60) + '\x6f' + chr(51) + '\x30' + chr(722 - 672), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b1011 + 0o50) + '\062' + chr(52), 4798 - 4790), nzTpIcepk0o8('\060' + '\157' + chr(54) + '\065', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b10100 + 0o36) + chr(0b110111 + 0o0) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(53) + '\x36', 0b1000), nzTpIcepk0o8('\x30' + chr(0b101000 + 0o107) + chr(0b110011) + chr(0b110100) + chr(52), 0o10), nzTpIcepk0o8(chr(48) + chr(0b101100 + 0o103) + '\061' + chr(1467 - 1416) + chr(1399 - 1345), 0o10), nzTpIcepk0o8(chr(904 - 856) + '\157' + chr(1276 - 1227) + '\061' + '\x33', 27165 - 27157), nzTpIcepk0o8('\060' + '\157' + '\063' + chr(0b110000) + '\x37', 0b1000), nzTpIcepk0o8('\060' + chr(0b111100 + 0o63) + chr(0b11101 + 0o27) + chr(50), 43173 - 43165), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\061' + chr(0b101011 + 0o5) + chr(0b110010 + 0o1), 30340 - 30332), nzTpIcepk0o8('\x30' + chr(0b1001000 + 0o47) + chr(1871 - 1822) + chr(2082 - 2033) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(111) + chr(2384 - 2335) + '\x34' + chr(2282 - 2232), 0o10), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b101100 + 0o103) + '\063' + '\066' + chr(52), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\061' + '\x34' + '\x36', 38255 - 38247), nzTpIcepk0o8(chr(0b110000) + chr(0b110010 + 0o75) + chr(0b1010 + 0o50) + '\065', 47177 - 47169), nzTpIcepk0o8(chr(2090 - 2042) + chr(0b1101111) + chr(1003 - 953) + '\065' + '\067', 10895 - 10887), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b1101111) + '\x31' + chr(49) + chr(55), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\x6f' + chr(53) + chr(0b110000), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xae'), chr(326 - 226) + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\144' + '\x65')(chr(0b1110101) + '\x74' + chr(102) + '\055' + chr(929 - 873)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def nPx23VAWx8nO(): ycJyMwcy30RG = R2GtVZYJEYoQ._AUTH_MECHANISMS[roI3spqORKae(ES5oEprVxulp(b'\xee\xa9\xe81'), chr(100) + '\x65' + chr(0b1011001 + 0o12) + '\157' + chr(0b1100100) + chr(0b1100101))('\165' + chr(116) + chr(102) + '\055' + chr(56))] WhW9qDvkCxE1 = hjuUzBhdMrmC.OID.from_int_seq(ycJyMwcy30RG) HiQ9hql09_Kk = hjuUzBhdMrmC.OID.from_int_seq(roI3spqORKae(ES5oEprVxulp(b"\xb1\xf3\xb7r\x87\x8e?V\xad\xb0\x81\xd6\x89'\x04\x0b\xfdWM\x0e\x06\xb8\xec\xe7"), chr(0b1100100) + chr(0b111100 + 0o51) + chr(0b11101 + 0o106) + chr(0b10010 + 0o135) + chr(100) + '\145')('\x75' + chr(0b1110100) + chr(0b110000 + 0o66) + chr(1833 - 1788) + chr(0b10011 + 0o45))) try: w8kLUuCcZpGl = R2GtVZYJEYoQ._get_security_context(hjuUzBhdMrmC.NameType.E63X9RhwfuOn, WhW9qDvkCxE1, roI3spqORKae(ES5oEprVxulp(b'\xe8\xa9\xf0,\xf1\xd3k\n\xef\xfb\xc2'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(0b1100101))('\165' + chr(10684 - 10568) + chr(0b1100110) + '\x2d' + '\070'), roI3spqORKae(ES5oEprVxulp(b'\xf5\xae\xe1.\xdf\xc1c\x1d'), chr(0b1100100) + chr(8883 - 8782) + '\x63' + chr(1928 - 1817) + chr(0b111001 + 0o53) + chr(0b1100101))('\x75' + chr(0b1110100) + '\x66' + '\055' + chr(715 - 659)), roI3spqORKae(ES5oEprVxulp(b'\xf0\xbc\xf7/\xc6\xcf|\x1c'), '\x64' + chr(0b1001001 + 0o34) + chr(0b1100011) + chr(4659 - 4548) + '\144' + chr(101))(chr(117) + '\x74' + chr(102) + chr(45) + chr(2219 - 2163))) roI3spqORKae(w8kLUuCcZpGl, roI3spqORKae(ES5oEprVxulp(b'\xda\xb4\xcf\x1e\x88\x99V\x0b\xa0\xaf\xfc\x97'), chr(100) + chr(0b1000101 + 0o40) + chr(3232 - 3133) + chr(10847 - 10736) + chr(0b1100100) + '\x65')('\x75' + chr(0b11 + 0o161) + chr(7334 - 7232) + chr(45) + '\x38'))() hfuqo7W2t0jp(HiQ9hql09_Kk, context=w8kLUuCcZpGl, value=ES5oEprVxulp(b'\x80') * nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(0b1101111) + chr(52), 60615 - 60607)) except roI3spqORKae(hjuUzBhdMrmC.exceptions, roI3spqORKae(ES5oEprVxulp(b'\xc7\x8e\xd7\x19\xc3\xd2a\n'), chr(0b1000111 + 0o35) + chr(101) + '\x63' + '\157' + '\144' + '\145')(chr(0b10010 + 0o143) + chr(0b110010 + 0o102) + chr(10014 - 9912) + chr(0b101101) + '\x38')) as UmlM4OyLHmCY: roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'\xe7\x9c\xbd\x06\x88\xc4aN\xcc\xf3\xf5\xa2'), '\x64' + chr(0b100 + 0o141) + '\143' + '\157' + chr(5983 - 5883) + chr(3947 - 3846))(chr(13549 - 13432) + chr(12407 - 12291) + chr(0b1100110) + chr(0b100 + 0o51) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'\xc6\xbc\xed0\xd4\xc4.\x0c\xf6\xbe\xd9\x96\xd7b\x12J\xb6\x12\x0c\x1bf\xdd\x8e\x99\x15\xd8\x01\x8a*.\xbfVc:\x0b\x80\x0e5\xe8\x1c\xd3\x9c\xd4\x15\x8b\x80+\x0b'), '\x64' + chr(1228 - 1127) + chr(0b1100011) + chr(3733 - 3622) + chr(0b100 + 0o140) + chr(101))('\x75' + '\x74' + chr(0b1100110) + chr(0b1101 + 0o40) + chr(0b10100 + 0o44)) % N9zlRy29S1SS(UmlM4OyLHmCY)) return [roI3spqORKae(ES5oEprVxulp(b'\xeb\xb8\xf6>\xd4\xd2a\x0b'), '\144' + chr(0b1100101) + '\143' + '\x6f' + '\144' + chr(8583 - 8482))('\x75' + chr(11850 - 11734) + '\146' + '\x2d' + chr(0b1111 + 0o51))] else: return [roI3spqORKae(ES5oEprVxulp(b'\xe1\xa8\xf03'), chr(0b1100100) + chr(0b10001 + 0o124) + '\x63' + chr(0b1101111) + '\144' + '\x65')(chr(4706 - 4589) + chr(116) + chr(3433 - 3331) + '\x2d' + chr(2716 - 2660)), roI3spqORKae(ES5oEprVxulp(b'\xeb\xb8\xf6>\xd4\xd2a\x0b'), chr(5506 - 5406) + chr(2753 - 2652) + chr(8338 - 8239) + chr(0b111001 + 0o66) + '\x64' + '\x65')('\x75' + chr(116) + '\x66' + '\055' + '\070'), roI3spqORKae(ES5oEprVxulp(b'\xee\xa9\xe81'), '\x64' + '\145' + '\143' + chr(0b1101111) + '\144' + chr(0b1100101))(chr(0b1110101) + '\x74' + '\146' + '\x2d' + '\x38')]
jborean93/requests-credssp
requests_credssp/credssp.py
CredSSPContext.credssp_generator
def credssp_generator(self): """ [MS-CSSP] 3.1.5 Processing Events and Sequencing Rules https://msdn.microsoft.com/en-us/library/cc226791.aspx Generator function that yields each CredSSP token to sent to the server. CredSSP has multiple steps that must be run for the client to successfully authenticate with the server and delegate the credentials. """ log.debug("Starting TLS handshake process") self.tls_connection = SSL.Connection(self.tls_context) self.tls_connection.set_connect_state() while True: try: self.tls_connection.do_handshake() except SSL.WantReadError: out_token = self.tls_connection.bio_read(self.BIO_BUFFER_SIZE) log.debug("Step 1. TLS Handshake, returning token: %s" % binascii.hexlify(out_token)) in_token = yield out_token, "Step 1. TLS Handshake" log.debug("Step 1. TLS Handshake, received token: %s" % binascii.hexlify(in_token)) self.tls_connection.bio_write(in_token) else: break log.debug("TLS Handshake complete. Protocol: %s, Cipher: %s" % (self.tls_connection.get_protocol_version_name(), self.tls_connection.get_cipher_name())) server_certificate = self.tls_connection.get_peer_certificate() server_public_key = self._get_subject_public_key(server_certificate) log.debug("Starting Authentication process") version = 6 context, auth_step, out_token = get_auth_context(self.hostname, self.username, self.password, self.auth_mechanism) while not context.complete: nego_token = NegoToken() nego_token['negoToken'] = out_token ts_request = TSRequest() ts_request['negoTokens'].append(nego_token) ts_request_token = encoder.encode(ts_request) log.debug("Step 2. Authenticate, returning token: %s" % binascii.hexlify(ts_request_token)) in_token = yield self.wrap(ts_request_token), \ "Step 2. Authenticate" in_token = self.unwrap(in_token) log.debug("Step 3. Authenticate, received token: %s" % binascii.hexlify(in_token)) ts_request = decoder.decode(in_token, asn1Spec=TSRequest())[0] ts_request.check_error_code() version = int(ts_request['version']) out_token = \ auth_step.send(bytes(ts_request['negoTokens'][0]['negoToken'])) version = min(version, TSRequest.CLIENT_VERSION) log.debug("Starting public key verification process at version %d" % version) if version < self.minimum_version: raise AuthenticationException("The reported server version was %d " "and did not meet the minimum " "requirements of %d" % (version, self.minimum_version)) if version > 4: nonce = os.urandom(32) else: log.warning("Reported server version was %d, susceptible to MitM " "attacks and should be patched - CVE 2018-0886" % version) nonce = None pub_key_auth = self._build_pub_key_auth(context, nonce, out_token, server_public_key) log.debug("Step 3. Server Authentication, returning token: %s" % binascii.hexlify(pub_key_auth)) in_token = yield (self.wrap(pub_key_auth), "Step 3. Server Authentication") in_token = self.unwrap(in_token) log.debug("Step 3. Server Authentication, received token: %s" % binascii.hexlify(in_token)) log.debug("Starting server public key response verification") ts_request = decoder.decode(in_token, asn1Spec=TSRequest())[0] ts_request.check_error_code() if not ts_request['pubKeyAuth'].isValue: raise AuthenticationException("The server did not response with " "pubKeyAuth info, authentication " "was rejected") if len(ts_request['negoTokens']) > 0: # SPNEGO auth returned the mechListMIC for us to verify auth_step.send(bytes(ts_request['negoTokens'][0]['negoToken'])) response_key = context.unwrap(bytes(ts_request['pubKeyAuth'])) self._verify_public_keys(nonce, response_key, server_public_key) log.debug("Sending encrypted credentials") enc_credentials = self._get_encrypted_credentials(context) yield self.wrap(enc_credentials), "Step 5. Delegate Credentials"
python
def credssp_generator(self): """ [MS-CSSP] 3.1.5 Processing Events and Sequencing Rules https://msdn.microsoft.com/en-us/library/cc226791.aspx Generator function that yields each CredSSP token to sent to the server. CredSSP has multiple steps that must be run for the client to successfully authenticate with the server and delegate the credentials. """ log.debug("Starting TLS handshake process") self.tls_connection = SSL.Connection(self.tls_context) self.tls_connection.set_connect_state() while True: try: self.tls_connection.do_handshake() except SSL.WantReadError: out_token = self.tls_connection.bio_read(self.BIO_BUFFER_SIZE) log.debug("Step 1. TLS Handshake, returning token: %s" % binascii.hexlify(out_token)) in_token = yield out_token, "Step 1. TLS Handshake" log.debug("Step 1. TLS Handshake, received token: %s" % binascii.hexlify(in_token)) self.tls_connection.bio_write(in_token) else: break log.debug("TLS Handshake complete. Protocol: %s, Cipher: %s" % (self.tls_connection.get_protocol_version_name(), self.tls_connection.get_cipher_name())) server_certificate = self.tls_connection.get_peer_certificate() server_public_key = self._get_subject_public_key(server_certificate) log.debug("Starting Authentication process") version = 6 context, auth_step, out_token = get_auth_context(self.hostname, self.username, self.password, self.auth_mechanism) while not context.complete: nego_token = NegoToken() nego_token['negoToken'] = out_token ts_request = TSRequest() ts_request['negoTokens'].append(nego_token) ts_request_token = encoder.encode(ts_request) log.debug("Step 2. Authenticate, returning token: %s" % binascii.hexlify(ts_request_token)) in_token = yield self.wrap(ts_request_token), \ "Step 2. Authenticate" in_token = self.unwrap(in_token) log.debug("Step 3. Authenticate, received token: %s" % binascii.hexlify(in_token)) ts_request = decoder.decode(in_token, asn1Spec=TSRequest())[0] ts_request.check_error_code() version = int(ts_request['version']) out_token = \ auth_step.send(bytes(ts_request['negoTokens'][0]['negoToken'])) version = min(version, TSRequest.CLIENT_VERSION) log.debug("Starting public key verification process at version %d" % version) if version < self.minimum_version: raise AuthenticationException("The reported server version was %d " "and did not meet the minimum " "requirements of %d" % (version, self.minimum_version)) if version > 4: nonce = os.urandom(32) else: log.warning("Reported server version was %d, susceptible to MitM " "attacks and should be patched - CVE 2018-0886" % version) nonce = None pub_key_auth = self._build_pub_key_auth(context, nonce, out_token, server_public_key) log.debug("Step 3. Server Authentication, returning token: %s" % binascii.hexlify(pub_key_auth)) in_token = yield (self.wrap(pub_key_auth), "Step 3. Server Authentication") in_token = self.unwrap(in_token) log.debug("Step 3. Server Authentication, received token: %s" % binascii.hexlify(in_token)) log.debug("Starting server public key response verification") ts_request = decoder.decode(in_token, asn1Spec=TSRequest())[0] ts_request.check_error_code() if not ts_request['pubKeyAuth'].isValue: raise AuthenticationException("The server did not response with " "pubKeyAuth info, authentication " "was rejected") if len(ts_request['negoTokens']) > 0: # SPNEGO auth returned the mechListMIC for us to verify auth_step.send(bytes(ts_request['negoTokens'][0]['negoToken'])) response_key = context.unwrap(bytes(ts_request['pubKeyAuth'])) self._verify_public_keys(nonce, response_key, server_public_key) log.debug("Sending encrypted credentials") enc_credentials = self._get_encrypted_credentials(context) yield self.wrap(enc_credentials), "Step 5. Delegate Credentials"
[ "def", "credssp_generator", "(", "self", ")", ":", "log", ".", "debug", "(", "\"Starting TLS handshake process\"", ")", "self", ".", "tls_connection", "=", "SSL", ".", "Connection", "(", "self", ".", "tls_context", ")", "self", ".", "tls_connection", ".", "set_connect_state", "(", ")", "while", "True", ":", "try", ":", "self", ".", "tls_connection", ".", "do_handshake", "(", ")", "except", "SSL", ".", "WantReadError", ":", "out_token", "=", "self", ".", "tls_connection", ".", "bio_read", "(", "self", ".", "BIO_BUFFER_SIZE", ")", "log", ".", "debug", "(", "\"Step 1. TLS Handshake, returning token: %s\"", "%", "binascii", ".", "hexlify", "(", "out_token", ")", ")", "in_token", "=", "yield", "out_token", ",", "\"Step 1. TLS Handshake\"", "log", ".", "debug", "(", "\"Step 1. TLS Handshake, received token: %s\"", "%", "binascii", ".", "hexlify", "(", "in_token", ")", ")", "self", ".", "tls_connection", ".", "bio_write", "(", "in_token", ")", "else", ":", "break", "log", ".", "debug", "(", "\"TLS Handshake complete. Protocol: %s, Cipher: %s\"", "%", "(", "self", ".", "tls_connection", ".", "get_protocol_version_name", "(", ")", ",", "self", ".", "tls_connection", ".", "get_cipher_name", "(", ")", ")", ")", "server_certificate", "=", "self", ".", "tls_connection", ".", "get_peer_certificate", "(", ")", "server_public_key", "=", "self", ".", "_get_subject_public_key", "(", "server_certificate", ")", "log", ".", "debug", "(", "\"Starting Authentication process\"", ")", "version", "=", "6", "context", ",", "auth_step", ",", "out_token", "=", "get_auth_context", "(", "self", ".", "hostname", ",", "self", ".", "username", ",", "self", ".", "password", ",", "self", ".", "auth_mechanism", ")", "while", "not", "context", ".", "complete", ":", "nego_token", "=", "NegoToken", "(", ")", "nego_token", "[", "'negoToken'", "]", "=", "out_token", "ts_request", "=", "TSRequest", "(", ")", "ts_request", "[", "'negoTokens'", "]", ".", "append", "(", "nego_token", ")", "ts_request_token", "=", "encoder", ".", "encode", "(", "ts_request", ")", "log", ".", "debug", "(", "\"Step 2. Authenticate, returning token: %s\"", "%", "binascii", ".", "hexlify", "(", "ts_request_token", ")", ")", "in_token", "=", "yield", "self", ".", "wrap", "(", "ts_request_token", ")", ",", "\"Step 2. Authenticate\"", "in_token", "=", "self", ".", "unwrap", "(", "in_token", ")", "log", ".", "debug", "(", "\"Step 3. Authenticate, received token: %s\"", "%", "binascii", ".", "hexlify", "(", "in_token", ")", ")", "ts_request", "=", "decoder", ".", "decode", "(", "in_token", ",", "asn1Spec", "=", "TSRequest", "(", ")", ")", "[", "0", "]", "ts_request", ".", "check_error_code", "(", ")", "version", "=", "int", "(", "ts_request", "[", "'version'", "]", ")", "out_token", "=", "auth_step", ".", "send", "(", "bytes", "(", "ts_request", "[", "'negoTokens'", "]", "[", "0", "]", "[", "'negoToken'", "]", ")", ")", "version", "=", "min", "(", "version", ",", "TSRequest", ".", "CLIENT_VERSION", ")", "log", ".", "debug", "(", "\"Starting public key verification process at version %d\"", "%", "version", ")", "if", "version", "<", "self", ".", "minimum_version", ":", "raise", "AuthenticationException", "(", "\"The reported server version was %d \"", "\"and did not meet the minimum \"", "\"requirements of %d\"", "%", "(", "version", ",", "self", ".", "minimum_version", ")", ")", "if", "version", ">", "4", ":", "nonce", "=", "os", ".", "urandom", "(", "32", ")", "else", ":", "log", ".", "warning", "(", "\"Reported server version was %d, susceptible to MitM \"", "\"attacks and should be patched - CVE 2018-0886\"", "%", "version", ")", "nonce", "=", "None", "pub_key_auth", "=", "self", ".", "_build_pub_key_auth", "(", "context", ",", "nonce", ",", "out_token", ",", "server_public_key", ")", "log", ".", "debug", "(", "\"Step 3. Server Authentication, returning token: %s\"", "%", "binascii", ".", "hexlify", "(", "pub_key_auth", ")", ")", "in_token", "=", "yield", "(", "self", ".", "wrap", "(", "pub_key_auth", ")", ",", "\"Step 3. Server Authentication\"", ")", "in_token", "=", "self", ".", "unwrap", "(", "in_token", ")", "log", ".", "debug", "(", "\"Step 3. Server Authentication, received token: %s\"", "%", "binascii", ".", "hexlify", "(", "in_token", ")", ")", "log", ".", "debug", "(", "\"Starting server public key response verification\"", ")", "ts_request", "=", "decoder", ".", "decode", "(", "in_token", ",", "asn1Spec", "=", "TSRequest", "(", ")", ")", "[", "0", "]", "ts_request", ".", "check_error_code", "(", ")", "if", "not", "ts_request", "[", "'pubKeyAuth'", "]", ".", "isValue", ":", "raise", "AuthenticationException", "(", "\"The server did not response with \"", "\"pubKeyAuth info, authentication \"", "\"was rejected\"", ")", "if", "len", "(", "ts_request", "[", "'negoTokens'", "]", ")", ">", "0", ":", "# SPNEGO auth returned the mechListMIC for us to verify", "auth_step", ".", "send", "(", "bytes", "(", "ts_request", "[", "'negoTokens'", "]", "[", "0", "]", "[", "'negoToken'", "]", ")", ")", "response_key", "=", "context", ".", "unwrap", "(", "bytes", "(", "ts_request", "[", "'pubKeyAuth'", "]", ")", ")", "self", ".", "_verify_public_keys", "(", "nonce", ",", "response_key", ",", "server_public_key", ")", "log", ".", "debug", "(", "\"Sending encrypted credentials\"", ")", "enc_credentials", "=", "self", ".", "_get_encrypted_credentials", "(", "context", ")", "yield", "self", ".", "wrap", "(", "enc_credentials", ")", ",", "\"Step 5. Delegate Credentials\"" ]
[MS-CSSP] 3.1.5 Processing Events and Sequencing Rules https://msdn.microsoft.com/en-us/library/cc226791.aspx Generator function that yields each CredSSP token to sent to the server. CredSSP has multiple steps that must be run for the client to successfully authenticate with the server and delegate the credentials.
[ "[", "MS", "-", "CSSP", "]", "3", ".", "1", ".", "5", "Processing", "Events", "and", "Sequencing", "Rules", "https", ":", "//", "msdn", ".", "microsoft", ".", "com", "/", "en", "-", "us", "/", "library", "/", "cc226791", ".", "aspx" ]
470db8d74dff919da67cf382e9ff784d4e8dd053
https://github.com/jborean93/requests-credssp/blob/470db8d74dff919da67cf382e9ff784d4e8dd053/requests_credssp/credssp.py#L68-L173
train
Generator function that yields each CredSSP token sent to the server.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23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oXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1101111) + '\061' + '\x32' + chr(0b11110 + 0o31), 0o10), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b101 + 0o152) + chr(0b10011 + 0o36) + chr(1170 - 1116) + chr(48), 65125 - 65117), nzTpIcepk0o8('\060' + '\157' + chr(0b10001 + 0o40) + chr(0b110111) + '\x32', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(52) + '\x31', 0o10), nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(2916 - 2805) + chr(2061 - 2010) + chr(0b110110) + '\x32', 0o10), nzTpIcepk0o8(chr(461 - 413) + chr(0b1101111) + chr(0b100101 + 0o21) + chr(49), 0b1000), nzTpIcepk0o8(chr(48) + chr(5903 - 5792) + chr(973 - 918) + chr(1104 - 1054), 786 - 778), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b1101111) + '\062' + '\063' + chr(2107 - 2057), 0o10), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(0b11010 + 0o125) + '\061' + chr(0b100011 + 0o16) + '\063', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011) + '\064' + chr(2344 - 2289), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(1457 - 1407) + '\067' + '\x35', 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\x35' + chr(2583 - 2532), 29784 - 29776), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + chr(52) + chr(370 - 315), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(6085 - 5974) + '\061' + chr(0b110010), 48919 - 48911), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + chr(1495 - 1446) + chr(693 - 645), ord("\x08")), nzTpIcepk0o8('\060' + chr(10431 - 10320) + chr(0b110111) + chr(1847 - 1799), 34569 - 34561), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + '\063' + chr(1713 - 1658), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1010000 + 0o37) + chr(49) + chr(0b110111) + chr(48), 0o10), nzTpIcepk0o8('\060' + chr(10307 - 10196) + chr(1539 - 1486) + chr(0b1001 + 0o55), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\062' + chr(0b11110 + 0o25) + '\062', 8), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + chr(0b110110) + chr(1677 - 1625), ord("\x08")), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(0b1101111) + chr(49) + '\x37' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(0b1101111) + '\x31' + chr(958 - 908) + '\x32', 0o10), nzTpIcepk0o8(chr(459 - 411) + chr(0b1100010 + 0o15) + '\063' + chr(0b110001), 0o10), nzTpIcepk0o8(chr(1577 - 1529) + chr(0b1101111) + chr(743 - 694) + '\x37' + '\060', 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(51) + '\x34' + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(10445 - 10334) + chr(0b10010 + 0o37) + chr(0b11010 + 0o31) + chr(0b110101), 57804 - 57796), nzTpIcepk0o8('\060' + chr(0b101101 + 0o102) + chr(525 - 474) + chr(1219 - 1164) + chr(101 - 48), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110101) + chr(0b101 + 0o53), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1569 - 1520) + chr(51), 20176 - 20168), nzTpIcepk0o8(chr(0b1010 + 0o46) + '\157' + '\x33' + chr(49) + chr(1182 - 1133), 5376 - 5368), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(0b11010 + 0o34) + chr(0b100100 + 0o21), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(6077 - 5966) + chr(0b110001) + '\066' + '\x30', 8), nzTpIcepk0o8(chr(48) + chr(10222 - 10111) + chr(51) + '\x35' + chr(55), 23811 - 23803), nzTpIcepk0o8(chr(2304 - 2256) + chr(111) + chr(50) + '\x32', 0b1000), nzTpIcepk0o8(chr(2034 - 1986) + chr(0b1001100 + 0o43) + '\x32' + chr(1388 - 1339) + chr(55), 61661 - 61653), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011) + '\x33' + chr(0b110101), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(1855 - 1804) + chr(0b110110), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b111 + 0o53) + chr(0b1010 + 0o47) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(1550 - 1502) + chr(111) + '\x31' + '\063' + '\x35', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(111) + '\065' + '\060', 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'y'), '\x64' + chr(0b1100101) + chr(0b111011 + 0o50) + chr(0b1010100 + 0o33) + chr(0b1100100) + '\145')(chr(0b101101 + 0o110) + chr(10763 - 10647) + chr(0b1100101 + 0o1) + chr(802 - 757) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def v0Vj7IRh6RIi(hXMPsSrOQzbh): roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'01C{\xcbUU\xac\x1e\x8a\xf8q'), chr(0b1100100) + chr(101) + '\143' + chr(0b10010 + 0o135) + '\144' + chr(0b100010 + 0o103))(chr(0b1110101) + chr(116) + chr(0b111001 + 0o55) + chr(0b101101) + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'\x04\x04\x1bS\x86XT\xfdk\xb3\xf1xGb)V\xbb\x0bF\xfb\x1f\x1cri\n\x89>\x98[x'), chr(100) + chr(0b1010011 + 0o22) + chr(6893 - 6794) + chr(7228 - 7117) + chr(0b1100100) + chr(0b1100101))(chr(660 - 543) + chr(13372 - 13256) + '\146' + chr(1005 - 960) + '\070')) hXMPsSrOQzbh.jFfjIDXTbOAk = mbrBZjGC9Ovi.Connection(hXMPsSrOQzbh.TncaUKhCjsPM) roI3spqORKae(hXMPsSrOQzbh.tls_connection, roI3spqORKae(ES5oEprVxulp(b'$\x15\x0e~\x91^T\xf4.\x84\xc9t\x14~)L\xba'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b11101 + 0o122) + '\x64' + chr(101))(chr(0b1110101) + chr(116) + chr(0b1100110) + '\055' + chr(2591 - 2535)))() while nzTpIcepk0o8('\060' + '\x6f' + chr(0b1110 + 0o43), ord("\x08")): try: roI3spqORKae(hXMPsSrOQzbh.tls_connection, roI3spqORKae(ES5oEprVxulp(b'3\x1f%I\x93_^\xe9#\x86\xd6N'), chr(5700 - 5600) + chr(0b100 + 0o141) + chr(0b1100011) + '\x6f' + chr(7560 - 7460) + '\x65')('\x75' + chr(8748 - 8632) + chr(0b1100110) + chr(45) + chr(2567 - 2511)))() except roI3spqORKae(mbrBZjGC9Ovi, roI3spqORKae(ES5oEprVxulp(b'\x00\x11\x14U\xa0T[\xfe\x0e\x95\xcfD\x15'), chr(0b1010010 + 0o22) + '\x65' + chr(0b1100011) + chr(3913 - 3802) + '\x64' + chr(0b111000 + 0o55))('\165' + chr(0b1110 + 0o146) + chr(0b1100101 + 0o1) + '\x2d' + chr(230 - 174))): _2eD29dXGjLS = hXMPsSrOQzbh.tls_connection.bio_read(hXMPsSrOQzbh.BIO_BUFFER_SIZE) roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'01C{\xcbUU\xac\x1e\x8a\xf8q'), chr(4344 - 4244) + chr(101) + chr(99) + chr(0b111001 + 0o66) + '\144' + chr(101))(chr(725 - 608) + '\x74' + '\x66' + chr(45) + '\070'))(roI3spqORKae(ES5oEprVxulp(b'\x04\x04\x1fQ\xd2\x00\x14\xba\x1f\xab\xee\x0b/k&\\\xac\x10O\xf1\x11Urk\x1d\x92(\x8fFb\xa7\xd2P\x9b}\xe4\xb8p\xb0}r\x03'), chr(801 - 701) + '\x65' + chr(1270 - 1171) + chr(0b1101111) + chr(100) + '\x65')('\x75' + chr(116) + '\x66' + chr(45) + chr(56)) % roI3spqORKae(tVthFMdkjoLb, roI3spqORKae(ES5oEprVxulp(b'?\x15\x02M\x9bWC'), chr(0b1100000 + 0o4) + chr(0b1100101) + chr(99) + chr(0b1011010 + 0o25) + chr(0b1011001 + 0o13) + '\145')(chr(178 - 61) + '\164' + '\x66' + chr(0b10110 + 0o27) + '\x38'))(_2eD29dXGjLS)) bwHmaVYchGVB = (yield (_2eD29dXGjLS, roI3spqORKae(ES5oEprVxulp(b'\x04\x04\x1fQ\xd2\x00\x14\xba\x1f\xab\xee\x0b/k&\\\xac\x10O\xf1\x11'), chr(0b1100100) + chr(183 - 82) + chr(3894 - 3795) + chr(0b10 + 0o155) + chr(0b1100100) + chr(0b1100101))(chr(117) + '\164' + '\x66' + '\055' + chr(0b10100 + 0o44)))) roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'01C{\xcbUU\xac\x1e\x8a\xf8q'), '\x64' + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(0b1001 + 0o133) + chr(0b101011 + 0o72))(chr(117) + '\x74' + chr(4403 - 4301) + chr(175 - 130) + chr(872 - 816)))(roI3spqORKae(ES5oEprVxulp(b'\x04\x04\x1fQ\xd2\x00\x14\xba\x1f\xab\xee\x0b/k&\\\xac\x10O\xf1\x11Urk\x1d\x858\x94^n\xad\x95\x04\x80y\xea\xb3$\xaax$'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\157' + chr(0b1100100) + chr(0b1100 + 0o131))('\x75' + chr(116) + chr(0b100000 + 0o106) + chr(0b101101) + '\x38') % roI3spqORKae(tVthFMdkjoLb, roI3spqORKae(ES5oEprVxulp(b'?\x15\x02M\x9bWC'), chr(100) + chr(0b1100101) + chr(215 - 116) + chr(0b111111 + 0o60) + chr(0b1100000 + 0o4) + chr(101))(chr(3274 - 3157) + '\x74' + '\146' + '\055' + chr(56)))(bwHmaVYchGVB)) roI3spqORKae(hXMPsSrOQzbh.tls_connection, roI3spqORKae(ES5oEprVxulp(b'5\x19\x15~\x85CS\xee.'), chr(0b1100100) + chr(8543 - 8442) + chr(8714 - 8615) + '\x6f' + chr(0b1100100) + '\145')(chr(0b110101 + 0o100) + chr(0b1110100) + chr(102) + chr(0b101000 + 0o5) + chr(0b111000)))(bwHmaVYchGVB) else: break roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'01C{\xcbUU\xac\x1e\x8a\xf8q'), '\144' + '\145' + chr(0b11001 + 0o112) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(0b1101 + 0o150) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + '\070'))(roI3spqORKae(ES5oEprVxulp(b"\x03<)\x01\xbaPT\xfe8\x8f\xdc@\x02*+W\xb2\x08B\xff\x00\x1c|9(\x942\x89Gh\xa6\xd9J\xcf7\xfc\xf1>\xc94'\x18\x1fS\xc8\x11\x1f\xe9"), chr(0b1100100) + chr(214 - 113) + chr(99) + chr(12070 - 11959) + chr(0b1100 + 0o130) + chr(101))(chr(0b1011010 + 0o33) + '\164' + chr(1165 - 1063) + '\055' + '\070') % (roI3spqORKae(hXMPsSrOQzbh.tls_connection, roI3spqORKae(ES5oEprVxulp(b'0\x15\x0e~\x82CU\xee$\x84\xd2G8|-J\xac\x11A\xf4+\x173t\x1d'), '\x64' + '\145' + '\143' + chr(111) + '\144' + chr(0b1100101))(chr(117) + chr(116) + chr(8344 - 8242) + '\x2d' + '\x38'))(), roI3spqORKae(hXMPsSrOQzbh.tls_connection, roI3spqORKae(ES5oEprVxulp(b'0\x15\x0e~\x91XJ\xf2.\x95\xe2E\x06g-'), chr(2034 - 1934) + chr(2502 - 2401) + chr(99) + '\157' + chr(100) + chr(4766 - 4665))('\165' + chr(116) + chr(0b1100110) + chr(0b101101) + chr(1735 - 1679)))())) QsAowIthxAYC = hXMPsSrOQzbh.tls_connection.get_peer_certificate() mlGPYBVyL8C8 = hXMPsSrOQzbh._get_subject_public_key(QsAowIthxAYC) roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'01C{\xcbUU\xac\x1e\x8a\xf8q'), chr(0b1100100) + '\x65' + chr(0b1001110 + 0o25) + chr(9874 - 9763) + '\144' + '\x65')('\x75' + '\x74' + '\146' + chr(0b111 + 0o46) + chr(234 - 178)))(roI3spqORKae(ES5oEprVxulp(b'\x04\x04\x1bS\x86XT\xfdk\xa6\xc8_\x0fo&L\xb6\x1bO\xee\x1d\x16<9\x08\x942\x9eMx\xba'), chr(100) + chr(448 - 347) + '\143' + '\157' + '\144' + chr(0b1100101))('\165' + '\x74' + chr(9523 - 9421) + '\x2d' + chr(56))) J4eG487sJbAu = nzTpIcepk0o8(chr(48) + chr(0b11001 + 0o126) + '\066', 48518 - 48510) (xwFiQMStTnzU, zdy2GjYswTH0, _2eD29dXGjLS) = xyTJBYrzCX0U(hXMPsSrOQzbh.NGLFNiXb9IZu, hXMPsSrOQzbh.fNAasCkJEM0V, hXMPsSrOQzbh.CgN2oEkfPaa_, hXMPsSrOQzbh.auth_mechanism) while not roI3spqORKae(xwFiQMStTnzU, roI3spqORKae(ES5oEprVxulp(b'\x03\x14\x0ft\xa7]o\xf1\x1c\xb7\xce\x1d'), '\144' + '\145' + chr(0b1000100 + 0o37) + chr(111) + chr(0b1100100) + chr(5443 - 5342))(chr(11354 - 11237) + chr(116) + chr(102) + chr(0b101101 + 0o0) + '\x38')): rlszMbC3xTdt = g4t18Uht2rfr() rlszMbC3xTdt[roI3spqORKae(ES5oEprVxulp(b'9\x15\x1dN\xa6^Q\xff%'), chr(1983 - 1883) + chr(0b11101 + 0o110) + chr(0b1100011) + chr(111) + chr(0b1001110 + 0o26) + chr(9307 - 9206))(chr(0b1011110 + 0o27) + chr(7728 - 7612) + chr(0b1101 + 0o131) + '\x2d' + '\070')] = _2eD29dXGjLS xSxcYsmhAbUW = XrHHeub0lBvE() roI3spqORKae(xSxcYsmhAbUW[roI3spqORKae(ES5oEprVxulp(b'9\x15\x1dN\xa6^Q\xff%\x94'), '\x64' + chr(0b1100101) + '\143' + chr(0b1101111) + '\144' + '\x65')(chr(117) + chr(116) + chr(10388 - 10286) + '\055' + '\x38')], roI3spqORKae(ES5oEprVxulp(b'\x1f$)\x15\x8aV}\xf5!\x88\xe8\x1e'), chr(100) + '\145' + '\143' + chr(4782 - 4671) + chr(0b1100100) + chr(9622 - 9521))(chr(12172 - 12055) + chr(116) + '\x66' + chr(45) + chr(0b110110 + 0o2)))(rlszMbC3xTdt) wiDjWhYgP37h = iOLbMFzneHpo.YqIaRFfeo4Ha(xSxcYsmhAbUW) roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'01C{\xcbUU\xac\x1e\x8a\xf8q'), chr(100) + chr(101) + '\x63' + chr(111) + chr(100) + '\x65')('\x75' + chr(0b1010010 + 0o42) + '\146' + chr(0b101101) + chr(0b10111 + 0o41)))(roI3spqORKae(ES5oEprVxulp(b'\x04\x04\x1fQ\xd2\x03\x14\xba\n\x92\xc9C\x02d<Q\xbc\x19Z\xffXY |\x0c\x93/\x93Ae\xae\x95\x04\x80y\xea\xb3$\xaax$'), chr(100) + chr(0b1100101) + '\x63' + chr(111) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(7005 - 6903) + '\x2d' + chr(0b111000)) % roI3spqORKae(tVthFMdkjoLb, roI3spqORKae(ES5oEprVxulp(b'?\x15\x02M\x9bWC'), chr(2189 - 2089) + chr(5750 - 5649) + chr(0b10100 + 0o117) + '\x6f' + chr(686 - 586) + chr(2043 - 1942))(chr(6965 - 6848) + '\x74' + chr(7242 - 7140) + '\x2d' + chr(0b11001 + 0o37)))(wiDjWhYgP37h)) bwHmaVYchGVB = (yield (hXMPsSrOQzbh.akRYbnaVA1EB(wiDjWhYgP37h), roI3spqORKae(ES5oEprVxulp(b'\x04\x04\x1fQ\xd2\x03\x14\xba\n\x92\xc9C\x02d<Q\xbc\x19Z\xff'), chr(0b1100100) + chr(0b1100101) + chr(99) + '\157' + chr(8582 - 8482) + chr(0b1100101))(chr(8546 - 8429) + chr(0b1110100) + '\146' + '\055' + chr(0b111000)))) bwHmaVYchGVB = hXMPsSrOQzbh.unwrap(bwHmaVYchGVB) roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'01C{\xcbUU\xac\x1e\x8a\xf8q'), chr(0b1001010 + 0o32) + chr(0b111001 + 0o54) + chr(2052 - 1953) + chr(111) + chr(0b1100100) + '\x65')(chr(9485 - 9368) + '\164' + chr(102) + chr(0b101100 + 0o1) + chr(84 - 28)))(roI3spqORKae(ES5oEprVxulp(b'\x04\x04\x1fQ\xd2\x02\x14\xba\n\x92\xc9C\x02d<Q\xbc\x19Z\xffXY |\x1b\x834\x8bMo\xe9\xc1\x1f\x84w\xe1\xe7>\xaf.'), chr(9209 - 9109) + chr(0b1100101) + chr(99) + '\157' + chr(0b10100 + 0o120) + chr(0b100100 + 0o101))(chr(0b1110101) + chr(12873 - 12757) + chr(3547 - 3445) + '\x2d' + '\x38') % roI3spqORKae(tVthFMdkjoLb, roI3spqORKae(ES5oEprVxulp(b'?\x15\x02M\x9bWC'), '\x64' + '\x65' + chr(0b1011101 + 0o6) + chr(0b1101111) + '\144' + chr(0b100110 + 0o77))('\x75' + chr(0b11100 + 0o130) + chr(0b1100110) + chr(181 - 136) + '\x38'))(bwHmaVYchGVB)) xSxcYsmhAbUW = CPoSpgmLTbWt.lfbFsdWlT3MB(bwHmaVYchGVB, asn1Spec=XrHHeub0lBvE())[nzTpIcepk0o8(chr(48) + '\157' + chr(743 - 695), 12531 - 12523)] roI3spqORKae(xSxcYsmhAbUW, roI3spqORKae(ES5oEprVxulp(b'4\x18\x1fB\x99n_\xe89\x88\xcft\x04e,]'), chr(100) + '\145' + chr(0b1011011 + 0o10) + '\x6f' + chr(295 - 195) + chr(4982 - 4881))(chr(0b1110101) + chr(116) + chr(102) + chr(0b101 + 0o50) + chr(0b111000)))() J4eG487sJbAu = nzTpIcepk0o8(xSxcYsmhAbUW[roI3spqORKae(ES5oEprVxulp(b'!\x15\x08R\x9b^T'), chr(100) + chr(101) + chr(3931 - 3832) + chr(0b1101111) + chr(100) + '\145')('\165' + '\x74' + '\146' + '\055' + chr(833 - 777))]) _2eD29dXGjLS = zdy2GjYswTH0.JYqXkYlMUreF(QNQS9e6tJqMV(xSxcYsmhAbUW[roI3spqORKae(ES5oEprVxulp(b'9\x15\x1dN\xa6^Q\xff%\x94'), '\x64' + chr(0b1010000 + 0o25) + chr(0b110111 + 0o54) + '\x6f' + chr(100) + chr(0b1100101))(chr(0b1110101) + '\x74' + '\x66' + chr(45) + '\x38')][nzTpIcepk0o8(chr(0b110000) + chr(0b10110 + 0o131) + chr(1410 - 1362), 8)][roI3spqORKae(ES5oEprVxulp(b'9\x15\x1dN\xa6^Q\xff%'), '\x64' + chr(2999 - 2898) + '\x63' + chr(8042 - 7931) + chr(100) + chr(101))('\165' + '\164' + chr(0b110100 + 0o62) + '\x2d' + '\x38')])) J4eG487sJbAu = XURpmPuEWCNF(J4eG487sJbAu, XrHHeub0lBvE.CLIENT_VERSION) roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'01C{\xcbUU\xac\x1e\x8a\xf8q'), '\x64' + '\145' + chr(8708 - 8609) + '\x6f' + chr(0b1100100) + chr(2716 - 2615))(chr(0b111110 + 0o67) + '\x74' + '\146' + '\055' + '\070'))(roI3spqORKae(ES5oEprVxulp(b'\x04\x04\x1bS\x86XT\xfdk\x97\xc8I\x0bc+\x18\xb4\x1dW\xba\x02\x1c p\x1e\x8f>\x9c\\b\xa6\xdbP\x9f`\xe0\xbe{\xf9.w\x11\x0e\x01\x84TH\xe9"\x88\xd3\x0bBn'), '\144' + chr(0b11001 + 0o114) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(4299 - 4198))(chr(0b1101111 + 0o6) + chr(0b1110100) + '\x66' + '\x2d' + chr(0b10111 + 0o41)) % J4eG487sJbAu) if J4eG487sJbAu < roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b':\x19\x14H\x9fDW\xc5=\x82\xcfX\x0ee&'), '\x64' + '\145' + '\143' + chr(11244 - 11133) + chr(3586 - 3486) + chr(0b1100101))('\x75' + '\164' + '\x66' + chr(0b101101) + '\070')): raise dPIu_ImOMRDz(roI3spqORKae(ES5oEprVxulp(b'\x03\x18\x1f\x01\x80TJ\xf59\x93\xd8OGy-J\xa9\x1d\\\xba\x02\x1c j\x11\x893\xdd_j\xba\x95U\x8b2\xee\xb3z\xaa9>\x14ZO\x9dE\x1a\xf7.\x82\xc9\x0b\x13b-\x18\xb2\x11@\xf3\x19\x0c?9\n\x83,\x88Ay\xac\xd8\x15\x81f\xfc\xfdq\xec}r\x14'), '\x64' + chr(0b1100101) + chr(99) + '\157' + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b100100 + 0o120) + '\146' + chr(0b101101) + chr(0b111000)) % (J4eG487sJbAu, roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b':\x19\x14H\x9fDW\xc5=\x82\xcfX\x0ee&'), '\x64' + '\145' + '\x63' + chr(0b10000 + 0o137) + '\144' + '\145')('\165' + chr(0b1010001 + 0o43) + '\146' + '\055' + chr(56))))) if J4eG487sJbAu > nzTpIcepk0o8(chr(48) + chr(0b10110 + 0o131) + chr(0b110100), 17755 - 17747): jdvs2TNPZIHs = aHUqKstZLeS6.urandom(nzTpIcepk0o8(chr(0b11000 + 0o30) + '\157' + '\x34' + '\x30', 0b1000)) else: roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b' \x11\x08O\x9b_]'), '\144' + chr(101) + '\x63' + '\157' + chr(0b110011 + 0o61) + '\x65')(chr(0b1101000 + 0o15) + '\164' + chr(102) + chr(1535 - 1490) + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'\x05\x15\nN\x80E_\xfek\x94\xd8Y\x11o:\x18\xa9\x1d\\\xe9\x1d\x16<9\x0f\x87.\xdd\ro\xe5\x95\x03\x9aa\xec\xb8n\xfe45\x1c\x1f\x01\x86^\x1a\xd7"\x93\xf0\x0b\x06~<Y\xbc\x13]\xba\x15\x1769\x0b\x8e2\x88Do\xe9\xd7\x15\xcfb\xee\xa9}\xe283PW\x01\xb1g\x7f\xbay\xd7\x8c\x13J:p\x00\xe9'), chr(0b11000 + 0o114) + chr(101) + chr(0b100101 + 0o76) + chr(0b111011 + 0o64) + chr(0b1100100) + chr(0b1100101))(chr(9161 - 9044) + '\x74' + chr(1168 - 1066) + chr(0b10101 + 0o30) + chr(56)) % J4eG487sJbAu) jdvs2TNPZIHs = None fhNBbYTNB69m = hXMPsSrOQzbh._build_pub_key_auth(xwFiQMStTnzU, jdvs2TNPZIHs, _2eD29dXGjLS, mlGPYBVyL8C8) roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'01C{\xcbUU\xac\x1e\x8a\xf8q'), chr(0b1100100) + chr(101) + chr(2437 - 2338) + chr(0b1000001 + 0o56) + chr(100) + chr(3839 - 3738))(chr(0b1110101) + chr(12582 - 12466) + chr(0b1100010 + 0o4) + '\055' + chr(56)))(roI3spqORKae(ES5oEprVxulp(b"\x04\x04\x1fQ\xd2\x02\x14\xba\x18\x82\xcf]\x02xhy\xaa\x0cF\xff\x1a\r;z\x19\x924\x92F'\xe9\xc7\x15\x9bg\xfd\xb3w\xe4:w\x04\x15J\x97_\x00\xban\x94"), chr(0b1100100) + chr(0b101000 + 0o75) + chr(0b1100011) + chr(111) + chr(0b1100100) + '\145')(chr(0b1110101) + '\164' + '\x66' + chr(131 - 86) + chr(2071 - 2015)) % roI3spqORKae(tVthFMdkjoLb, roI3spqORKae(ES5oEprVxulp(b'?\x15\x02M\x9bWC'), chr(0b0 + 0o144) + '\145' + chr(4120 - 4021) + chr(12183 - 12072) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(0b1010001 + 0o43) + '\146' + chr(777 - 732) + chr(0b110101 + 0o3)))(fhNBbYTNB69m)) bwHmaVYchGVB = (yield (hXMPsSrOQzbh.akRYbnaVA1EB(fhNBbYTNB69m), roI3spqORKae(ES5oEprVxulp(b'\x04\x04\x1fQ\xd2\x02\x14\xba\x18\x82\xcf]\x02xhy\xaa\x0cF\xff\x1a\r;z\x19\x924\x92F'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(0b111001 + 0o66) + chr(0b1100100) + '\145')(chr(117) + chr(116) + chr(0b100010 + 0o104) + chr(0b101101) + chr(56)))) bwHmaVYchGVB = hXMPsSrOQzbh.unwrap(bwHmaVYchGVB) roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'01C{\xcbUU\xac\x1e\x8a\xf8q'), '\x64' + chr(2184 - 2083) + chr(8668 - 8569) + chr(0b1101111) + chr(6725 - 6625) + '\145')('\165' + chr(0b1110100) + chr(0b10 + 0o144) + chr(0b100111 + 0o6) + chr(873 - 817)))(roI3spqORKae(ES5oEprVxulp(b"\x04\x04\x1fQ\xd2\x02\x14\xba\x18\x82\xcf]\x02xhy\xaa\x0cF\xff\x1a\r;z\x19\x924\x92F'\xe9\xc7\x15\x8cw\xe6\xab{\xee}#\x1f\x11D\x9c\x0b\x1a\xbf8"), chr(0b1010011 + 0o21) + chr(101) + chr(0b1110 + 0o125) + chr(111) + '\x64' + chr(5039 - 4938))('\165' + chr(0b100100 + 0o120) + '\146' + '\x2d' + chr(0b111000)) % roI3spqORKae(tVthFMdkjoLb, roI3spqORKae(ES5oEprVxulp(b'?\x15\x02M\x9bWC'), chr(0b1100100) + chr(0b1100101) + chr(6949 - 6850) + '\157' + chr(0b1001 + 0o133) + chr(0b110001 + 0o64))(chr(0b1110101) + chr(116) + '\x66' + chr(0b101101) + chr(0b111 + 0o61)))(bwHmaVYchGVB)) roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'01C{\xcbUU\xac\x1e\x8a\xf8q'), chr(9416 - 9316) + '\x65' + chr(277 - 178) + '\157' + chr(0b1100100) + chr(101))('\165' + chr(0b1110100) + chr(0b110100 + 0o62) + chr(0b101 + 0o50) + '\070'))(roI3spqORKae(ES5oEprVxulp(b'\x04\x04\x1bS\x86XT\xfdk\x94\xd8Y\x11o:\x18\xaf\rL\xf6\x1d\x1arr\x1d\x9f}\x8fMx\xb9\xda\x1e\x9cw\xaf\xab{\xf841\x19\x19@\x86XU\xf4'), '\144' + chr(7882 - 7781) + chr(0b111 + 0o134) + chr(0b110110 + 0o71) + chr(0b1010101 + 0o17) + '\x65')(chr(0b1001 + 0o154) + chr(116) + chr(0b1100110) + '\055' + chr(56))) xSxcYsmhAbUW = CPoSpgmLTbWt.lfbFsdWlT3MB(bwHmaVYchGVB, asn1Spec=XrHHeub0lBvE())[nzTpIcepk0o8(chr(1233 - 1185) + '\x6f' + chr(917 - 869), 8)] roI3spqORKae(xSxcYsmhAbUW, roI3spqORKae(ES5oEprVxulp(b'4\x18\x1fB\x99n_\xe89\x88\xcft\x04e,]'), '\144' + '\145' + '\143' + chr(7187 - 7076) + chr(5492 - 5392) + chr(0b101110 + 0o67))('\165' + chr(116) + '\146' + '\055' + chr(0b101 + 0o63)))() if not roI3spqORKae(xSxcYsmhAbUW[roI3spqORKae(ES5oEprVxulp(b"'\x05\x18j\x97H{\xef?\x8f"), chr(0b1100100) + '\x65' + chr(99) + chr(0b1000101 + 0o52) + '\144' + '\x65')('\165' + '\164' + chr(1273 - 1171) + '\055' + '\x38')], roI3spqORKae(ES5oEprVxulp(b'>\x03,@\x9eD_'), chr(9756 - 9656) + '\145' + chr(0b1100011) + chr(0b1001101 + 0o42) + chr(9384 - 9284) + chr(0b1100101))(chr(4208 - 4091) + chr(116) + chr(0b1100110) + chr(45) + '\070')): raise dPIu_ImOMRDz(roI3spqORKae(ES5oEprVxulp(b'\x03\x18\x1f\x01\x81TH\xec.\x95\x9dO\x0enhV\xb0\x0c\x0e\xe8\x11\n"v\x16\x958\xdd_b\xbd\xddP\x9fg\xed\x96{\xf3\x1c"\x04\x12\x01\x9b_\\\xf5g\xc7\xdc^\x13b-V\xab\x11M\xfb\x00\x10=wX\x91<\x8e\x08y\xac\xdf\x15\x8cf\xea\xb9'), chr(100) + '\145' + chr(0b1100011) + '\x6f' + chr(8594 - 8494) + chr(101))('\x75' + chr(116) + chr(2863 - 2761) + chr(0b101101) + chr(0b111000))) if ftfygxgFas5X(xSxcYsmhAbUW[roI3spqORKae(ES5oEprVxulp(b'9\x15\x1dN\xa6^Q\xff%\x94'), '\x64' + chr(0b1100101) + chr(0b101100 + 0o67) + chr(0b1101111) + chr(7675 - 7575) + chr(0b1100101))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b101101) + '\x38')]) > nzTpIcepk0o8(chr(48) + '\157' + chr(0b110000), 8): roI3spqORKae(zdy2GjYswTH0, roI3spqORKae(ES5oEprVxulp(b'\x1d)\x0by\x99hV\xd7\x1e\x95\xd8m'), chr(0b1100100) + chr(0b1001111 + 0o26) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(8124 - 8023))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(0b101010 + 0o3) + chr(0b111000)))(QNQS9e6tJqMV(xSxcYsmhAbUW[roI3spqORKae(ES5oEprVxulp(b'9\x15\x1dN\xa6^Q\xff%\x94'), chr(0b1100100) + '\x65' + chr(99) + chr(111) + chr(100) + chr(8434 - 8333))('\165' + chr(0b1110100) + '\146' + chr(1939 - 1894) + '\x38')][nzTpIcepk0o8(chr(48) + chr(0b101111 + 0o100) + '\060', 8)][roI3spqORKae(ES5oEprVxulp(b'9\x15\x1dN\xa6^Q\xff%'), '\x64' + '\x65' + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(101))('\165' + '\164' + '\x66' + chr(0b100011 + 0o12) + '\070')])) NBmuhj0756RB = xwFiQMStTnzU.unwrap(QNQS9e6tJqMV(xSxcYsmhAbUW[roI3spqORKae(ES5oEprVxulp(b"'\x05\x18j\x97H{\xef?\x8f"), chr(0b1100100) + chr(101) + '\143' + chr(11508 - 11397) + chr(100) + chr(0b100010 + 0o103))(chr(0b1101111 + 0o6) + '\x74' + chr(0b1100110) + '\055' + chr(56))])) roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x08\x06\x1fS\x9bWC\xc5;\x92\xdfG\x0ei\x17S\xba\x01]'), chr(9801 - 9701) + chr(6772 - 6671) + '\x63' + '\x6f' + chr(6240 - 6140) + '\x65')(chr(7713 - 7596) + chr(11286 - 11170) + chr(0b1100110) + '\x2d' + chr(0b101000 + 0o20)))(jdvs2TNPZIHs, NBmuhj0756RB, mlGPYBVyL8C8) roI3spqORKae(lmiGj7TonZgV, roI3spqORKae(ES5oEprVxulp(b'01C{\xcbUU\xac\x1e\x8a\xf8q'), '\144' + '\145' + chr(4857 - 4758) + '\x6f' + '\144' + chr(0b1100011 + 0o2))(chr(0b1110101) + chr(116) + '\146' + '\055' + chr(2804 - 2748)))(roI3spqORKae(ES5oEprVxulp(b'\x04\x15\x14E\x9b_]\xba.\x89\xdeY\x1ez<]\xbbXM\xe8\x11\x1d7w\x0c\x8f<\x91['), '\144' + chr(0b1011000 + 0o15) + chr(99) + chr(0b1001100 + 0o43) + chr(100) + chr(101))('\x75' + '\x74' + '\146' + '\055' + chr(0b111000))) duoD9AugM_nv = hXMPsSrOQzbh._get_encrypted_credentials(xwFiQMStTnzU) yield (roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'6\x1b(x\x90_[\xcc\n\xd6\xf8i'), chr(7726 - 7626) + '\x65' + chr(4899 - 4800) + chr(0b1101111) + chr(7155 - 7055) + chr(1520 - 1419))(chr(117) + chr(1160 - 1044) + '\146' + chr(0b100101 + 0o10) + chr(56)))(duoD9AugM_nv), roI3spqORKae(ES5oEprVxulp(b'\x04\x04\x1fQ\xd2\x04\x14\xba\x0f\x82\xd1N\x00k<]\xff;\\\xff\x10\x1c<m\x11\x871\x8e'), chr(0b1100100) + '\145' + '\x63' + '\157' + chr(0b110111 + 0o55) + chr(3617 - 3516))(chr(7943 - 7826) + chr(0b1110100) + chr(5910 - 5808) + chr(1876 - 1831) + chr(56)))
jborean93/requests-credssp
requests_credssp/credssp.py
CredSSPContext._build_pub_key_auth
def _build_pub_key_auth(self, context, nonce, auth_token, public_key): """ [MS-CSSP] 3.1.5 Processing Events and Sequencing Rules - Step 3 https://msdn.microsoft.com/en-us/library/cc226791.aspx This step sends the final SPNEGO token to the server if required and computes the value for the pubKeyAuth field for the protocol version negotiated. The format of the pubKeyAuth field depends on the version that the server supports. For version 2 to 4: The pubKeyAuth field is just wrapped using the authenticated context For versions 5 to 6: The pubKeyAuth is a sha256 hash of the server's public key plus a nonce and a magic string value. This hash is wrapped using the authenticated context and the nonce is added to the TSRequest alongside the nonce used in the hash calcs. :param context: The authenticated context :param nonce: If versions 5+, the nonce to use in the hash :param auth_token: If NTLM, this is the last msg (authenticate msg) to send in the same request :param public_key: The server's public key :return: The TSRequest as a byte string to send to the server """ ts_request = TSRequest() if auth_token is not None: nego_token = NegoToken() nego_token['negoToken'] = auth_token ts_request['negoTokens'].append(nego_token) if nonce is not None: ts_request['clientNonce'] = nonce hash_input = b"CredSSP Client-To-Server Binding Hash\x00" + \ nonce + public_key pub_value = hashlib.sha256(hash_input).digest() else: pub_value = public_key enc_public_key = context.wrap(pub_value) ts_request['pubKeyAuth'] = enc_public_key return encoder.encode(ts_request)
python
def _build_pub_key_auth(self, context, nonce, auth_token, public_key): """ [MS-CSSP] 3.1.5 Processing Events and Sequencing Rules - Step 3 https://msdn.microsoft.com/en-us/library/cc226791.aspx This step sends the final SPNEGO token to the server if required and computes the value for the pubKeyAuth field for the protocol version negotiated. The format of the pubKeyAuth field depends on the version that the server supports. For version 2 to 4: The pubKeyAuth field is just wrapped using the authenticated context For versions 5 to 6: The pubKeyAuth is a sha256 hash of the server's public key plus a nonce and a magic string value. This hash is wrapped using the authenticated context and the nonce is added to the TSRequest alongside the nonce used in the hash calcs. :param context: The authenticated context :param nonce: If versions 5+, the nonce to use in the hash :param auth_token: If NTLM, this is the last msg (authenticate msg) to send in the same request :param public_key: The server's public key :return: The TSRequest as a byte string to send to the server """ ts_request = TSRequest() if auth_token is not None: nego_token = NegoToken() nego_token['negoToken'] = auth_token ts_request['negoTokens'].append(nego_token) if nonce is not None: ts_request['clientNonce'] = nonce hash_input = b"CredSSP Client-To-Server Binding Hash\x00" + \ nonce + public_key pub_value = hashlib.sha256(hash_input).digest() else: pub_value = public_key enc_public_key = context.wrap(pub_value) ts_request['pubKeyAuth'] = enc_public_key return encoder.encode(ts_request)
[ "def", "_build_pub_key_auth", "(", "self", ",", "context", ",", "nonce", ",", "auth_token", ",", "public_key", ")", ":", "ts_request", "=", "TSRequest", "(", ")", "if", "auth_token", "is", "not", "None", ":", "nego_token", "=", "NegoToken", "(", ")", "nego_token", "[", "'negoToken'", "]", "=", "auth_token", "ts_request", "[", "'negoTokens'", "]", ".", "append", "(", "nego_token", ")", "if", "nonce", "is", "not", "None", ":", "ts_request", "[", "'clientNonce'", "]", "=", "nonce", "hash_input", "=", "b\"CredSSP Client-To-Server Binding Hash\\x00\"", "+", "nonce", "+", "public_key", "pub_value", "=", "hashlib", ".", "sha256", "(", "hash_input", ")", ".", "digest", "(", ")", "else", ":", "pub_value", "=", "public_key", "enc_public_key", "=", "context", ".", "wrap", "(", "pub_value", ")", "ts_request", "[", "'pubKeyAuth'", "]", "=", "enc_public_key", "return", "encoder", ".", "encode", "(", "ts_request", ")" ]
[MS-CSSP] 3.1.5 Processing Events and Sequencing Rules - Step 3 https://msdn.microsoft.com/en-us/library/cc226791.aspx This step sends the final SPNEGO token to the server if required and computes the value for the pubKeyAuth field for the protocol version negotiated. The format of the pubKeyAuth field depends on the version that the server supports. For version 2 to 4: The pubKeyAuth field is just wrapped using the authenticated context For versions 5 to 6: The pubKeyAuth is a sha256 hash of the server's public key plus a nonce and a magic string value. This hash is wrapped using the authenticated context and the nonce is added to the TSRequest alongside the nonce used in the hash calcs. :param context: The authenticated context :param nonce: If versions 5+, the nonce to use in the hash :param auth_token: If NTLM, this is the last msg (authenticate msg) to send in the same request :param public_key: The server's public key :return: The TSRequest as a byte string to send to the server
[ "[", "MS", "-", "CSSP", "]", "3", ".", "1", ".", "5", "Processing", "Events", "and", "Sequencing", "Rules", "-", "Step", "3", "https", ":", "//", "msdn", ".", "microsoft", ".", "com", "/", "en", "-", "us", "/", "library", "/", "cc226791", ".", "aspx" ]
470db8d74dff919da67cf382e9ff784d4e8dd053
https://github.com/jborean93/requests-credssp/blob/470db8d74dff919da67cf382e9ff784d4e8dd053/requests_credssp/credssp.py#L175-L221
train
Builds the Pubkey Auth field for the protocol version 2. 5 and 6. 5 +.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h6aCn31dg,oxj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,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1267 - 1219) + '\157' + '\x31' + chr(2830 - 2776) + '\x30', 57763 - 57755), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110011) + chr(0b11010 + 0o33) + chr(0b10011 + 0o35), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(267 - 214) + '\x30', 0b1000), nzTpIcepk0o8(chr(990 - 942) + chr(0b1101111) + '\064' + chr(49), ord("\x08")), nzTpIcepk0o8(chr(1929 - 1881) + chr(0b1011110 + 0o21) + '\x32' + '\x32' + chr(0b110110), 45512 - 45504), nzTpIcepk0o8('\x30' + chr(0b1001100 + 0o43) + chr(2424 - 2373) + '\x34' + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(520 - 472) + chr(5305 - 5194) + '\x32' + chr(0b101010 + 0o12) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101110 + 0o1) + chr(50) + chr(1098 - 1048) + chr(51), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\x31' + chr(48) + '\065', 0b1000), nzTpIcepk0o8(chr(48) + chr(6278 - 6167) + chr(2250 - 2200) + chr(0b110101) + '\x34', 0b1000), nzTpIcepk0o8(chr(1243 - 1195) + chr(0b1001101 + 0o42) + chr(0b110011) + chr(0b110011), 61885 - 61877), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(49) + chr(0b110101) + chr(0b110001), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110010) + chr(0b110101), 0o10), nzTpIcepk0o8('\060' + chr(0b1100000 + 0o17) + '\x33' + '\x33' + chr(0b110110), 0o10), nzTpIcepk0o8('\060' + chr(0b1010100 + 0o33) + chr(1181 - 1132) + chr(2588 - 2534) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + '\067' + chr(3014 - 2959), ord("\x08")), nzTpIcepk0o8(chr(378 - 330) + '\157' + chr(1367 - 1318) + chr(52) + chr(0b10 + 0o56), ord("\x08")), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(0b1101111) + '\x33' + chr(0b10011 + 0o44) + chr(954 - 906), 0o10), nzTpIcepk0o8(chr(893 - 845) + '\157' + '\063' + chr(1724 - 1673) + chr(0b11011 + 0o33), 8), nzTpIcepk0o8(chr(48) + chr(9001 - 8890) + chr(1073 - 1023) + chr(50) + chr(48), 0o10), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(0b1101111) + '\067', 11726 - 11718), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110011) + '\x34' + chr(53), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b0 + 0o62) + chr(0b101011 + 0o14) + chr(54), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + '\065' + chr(51), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\063' + chr(0b11101 + 0o26) + chr(0b11001 + 0o34), 0b1000), nzTpIcepk0o8(chr(1650 - 1602) + chr(111) + '\062' + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(787 - 739) + chr(6684 - 6573) + chr(49) + '\063' + chr(0b10101 + 0o42), 13378 - 13370), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(0b1101111) + chr(50) + '\065' + chr(0b101010 + 0o11), 8), nzTpIcepk0o8(chr(48) + '\157' + chr(471 - 422) + chr(0b10100 + 0o35) + chr(1084 - 1033), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x31' + chr(0b10000 + 0o44) + chr(0b110110 + 0o0), 29654 - 29646), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + chr(0b10010 + 0o44) + chr(1653 - 1603), 0o10), nzTpIcepk0o8(chr(740 - 692) + chr(0b1010001 + 0o36) + '\x31' + chr(1889 - 1839) + chr(0b10001 + 0o43), 0b1000), nzTpIcepk0o8('\x30' + chr(5807 - 5696) + chr(0b110010) + chr(1661 - 1606) + chr(116 - 68), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(12112 - 12001) + chr(0b110011) + chr(53) + chr(0b110110), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110000 + 0o1) + chr(0b1111 + 0o42) + chr(1940 - 1889), 8), nzTpIcepk0o8(chr(48) + chr(6231 - 6120) + chr(0b110011) + chr(808 - 754) + chr(49), ord("\x08")), nzTpIcepk0o8('\x30' + chr(1557 - 1446) + chr(49) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b10110 + 0o33) + chr(51) + chr(53), 42160 - 42152), nzTpIcepk0o8('\x30' + chr(10841 - 10730) + chr(1986 - 1937) + chr(349 - 294) + chr(0b100 + 0o60), 43992 - 43984), nzTpIcepk0o8(chr(1036 - 988) + chr(0b1101111) + chr(49) + '\x36' + chr(0b11110 + 0o30), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\157' + '\x35' + '\060', 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'^'), '\x64' + chr(0b110111 + 0o56) + chr(99) + '\x6f' + '\x64' + chr(0b1000101 + 0o40))(chr(2801 - 2684) + chr(2282 - 2166) + chr(102) + chr(1253 - 1208) + chr(0b100011 + 0o25)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def AwEPWJkS1AAX(hXMPsSrOQzbh, xwFiQMStTnzU, jdvs2TNPZIHs, T74iD718Pl1D, dB1SCpPThPhv): xSxcYsmhAbUW = XrHHeub0lBvE() if T74iD718Pl1D is not None: rlszMbC3xTdt = g4t18Uht2rfr() rlszMbC3xTdt[roI3spqORKae(ES5oEprVxulp(b'\x1e\x8dON\xc2\x89\xce\xf6+'), '\144' + chr(0b1100101) + chr(0b1100 + 0o127) + chr(111) + '\x64' + chr(0b1000100 + 0o41))('\165' + '\x74' + '\146' + chr(45) + chr(0b11 + 0o65))] = T74iD718Pl1D roI3spqORKae(xSxcYsmhAbUW[roI3spqORKae(ES5oEprVxulp(b'\x1e\x8dON\xc2\x89\xce\xf6+\xdf'), chr(0b1010111 + 0o15) + chr(0b1100101) + '\143' + '\157' + chr(5666 - 5566) + chr(101))(chr(0b1110101) + '\164' + chr(0b10 + 0o144) + chr(411 - 366) + chr(0b111000))], roI3spqORKae(ES5oEprVxulp(b'8\xbc{\x15\xee\x81\xe2\xfc/\xc3N\\'), '\144' + '\x65' + chr(0b1100011) + '\157' + chr(0b1100100) + chr(0b1100101))(chr(3865 - 3748) + chr(0b1011 + 0o151) + chr(7260 - 7158) + chr(45) + chr(56)))(rlszMbC3xTdt) if jdvs2TNPZIHs is not None: xSxcYsmhAbUW[roI3spqORKae(ES5oEprVxulp(b'\x13\x84AD\xf8\x92\xeb\xfc+\xcf~'), chr(0b1100100) + chr(0b11101 + 0o110) + '\143' + chr(0b1100101 + 0o12) + '\x64' + '\x65')(chr(117) + chr(11733 - 11617) + '\146' + chr(0b101101) + '\x38')] = jdvs2TNPZIHs QIqqFbUcF9m5 = ES5oEprVxulp(b'3\x9aME\xc5\xb5\xf5\xb3\x06\xc0r\x0c{\xaaZ\xab\x0f\xd5\x8d\xf5u\x93\xdb\xd9\xfdR6\xc5/\x0f\xdc3\x98\xa6*\x82d]') + jdvs2TNPZIHs + dB1SCpPThPhv wgIHhDBnYZCd = SDv77BhJq2mr.sha256(QIqqFbUcF9m5).CikyTeQ_2JKj() else: wgIHhDBnYZCd = dB1SCpPThPhv Y4NDKwU8hWel = xwFiQMStTnzU.akRYbnaVA1EB(wgIHhDBnYZCd) xSxcYsmhAbUW[roI3spqORKae(ES5oEprVxulp(b'\x00\x9dJj\xf3\x9f\xe4\xe61\xc4'), '\144' + '\145' + '\143' + chr(0b111100 + 0o63) + chr(0b1100100) + '\145')('\165' + chr(1739 - 1623) + chr(9224 - 9122) + chr(0b101101) + '\x38')] = Y4NDKwU8hWel return roI3spqORKae(iOLbMFzneHpo, roI3spqORKae(ES5oEprVxulp(b')\x99a@\xc4\xa0\xc3\xf6*\x98S\x08'), chr(0b1100100) + chr(2878 - 2777) + chr(0b101001 + 0o72) + chr(4718 - 4607) + chr(100) + chr(5742 - 5641))('\x75' + '\x74' + chr(885 - 783) + chr(45) + chr(0b111000)))(xSxcYsmhAbUW)
jborean93/requests-credssp
requests_credssp/credssp.py
CredSSPContext._verify_public_keys
def _verify_public_keys(self, nonce, server_key, public_key): """ [MS-CSSP] 3.1.5 Processing Events and Sequencing Rules - Step 4 https://msdn.microsoft.com/en-us/library/cc226791.aspx The rules vary depending on the server version For version 2 to 4: After the server received the public key in Step 3 it verifies the key with what was in the handshake. After the verification it then adds 1 to the first byte representing the public key and encrypts the bytes result by using the authentication protocol's encryption services. This method does the opposite where it will decrypt the public key returned from the server and subtract the first byte by 1 to compare with the public key we sent originally. For versions 5 to 6: A hash is calculated with the magic string value, the nonce that was sent to the server and the public key that was used. This is verified against the returned server public key. :param nonce: If version 5+, the nonce used in the hash calculations :param server_key: The unwrapped value returned in the TSRequest['pubKeyAuth'] field. :param public_key: The actual public key of the server """ if nonce is not None: hash_input = b"CredSSP Server-To-Client Binding Hash\x00" + nonce \ + public_key actual = hashlib.sha256(hash_input).digest() expected = server_key else: first_byte = struct.unpack("B", server_key[0:1])[0] actual_first_byte = struct.pack("B", first_byte - 1) actual = actual_first_byte + server_key[1:] expected = public_key if actual != expected: raise AuthenticationException("Could not verify key sent from the " "server, potential man in the " "middle attack")
python
def _verify_public_keys(self, nonce, server_key, public_key): """ [MS-CSSP] 3.1.5 Processing Events and Sequencing Rules - Step 4 https://msdn.microsoft.com/en-us/library/cc226791.aspx The rules vary depending on the server version For version 2 to 4: After the server received the public key in Step 3 it verifies the key with what was in the handshake. After the verification it then adds 1 to the first byte representing the public key and encrypts the bytes result by using the authentication protocol's encryption services. This method does the opposite where it will decrypt the public key returned from the server and subtract the first byte by 1 to compare with the public key we sent originally. For versions 5 to 6: A hash is calculated with the magic string value, the nonce that was sent to the server and the public key that was used. This is verified against the returned server public key. :param nonce: If version 5+, the nonce used in the hash calculations :param server_key: The unwrapped value returned in the TSRequest['pubKeyAuth'] field. :param public_key: The actual public key of the server """ if nonce is not None: hash_input = b"CredSSP Server-To-Client Binding Hash\x00" + nonce \ + public_key actual = hashlib.sha256(hash_input).digest() expected = server_key else: first_byte = struct.unpack("B", server_key[0:1])[0] actual_first_byte = struct.pack("B", first_byte - 1) actual = actual_first_byte + server_key[1:] expected = public_key if actual != expected: raise AuthenticationException("Could not verify key sent from the " "server, potential man in the " "middle attack")
[ "def", "_verify_public_keys", "(", "self", ",", "nonce", ",", "server_key", ",", "public_key", ")", ":", "if", "nonce", "is", "not", "None", ":", "hash_input", "=", "b\"CredSSP Server-To-Client Binding Hash\\x00\"", "+", "nonce", "+", "public_key", "actual", "=", "hashlib", ".", "sha256", "(", "hash_input", ")", ".", "digest", "(", ")", "expected", "=", "server_key", "else", ":", "first_byte", "=", "struct", ".", "unpack", "(", "\"B\"", ",", "server_key", "[", "0", ":", "1", "]", ")", "[", "0", "]", "actual_first_byte", "=", "struct", ".", "pack", "(", "\"B\"", ",", "first_byte", "-", "1", ")", "actual", "=", "actual_first_byte", "+", "server_key", "[", "1", ":", "]", "expected", "=", "public_key", "if", "actual", "!=", "expected", ":", "raise", "AuthenticationException", "(", "\"Could not verify key sent from the \"", "\"server, potential man in the \"", "\"middle attack\"", ")" ]
[MS-CSSP] 3.1.5 Processing Events and Sequencing Rules - Step 4 https://msdn.microsoft.com/en-us/library/cc226791.aspx The rules vary depending on the server version For version 2 to 4: After the server received the public key in Step 3 it verifies the key with what was in the handshake. After the verification it then adds 1 to the first byte representing the public key and encrypts the bytes result by using the authentication protocol's encryption services. This method does the opposite where it will decrypt the public key returned from the server and subtract the first byte by 1 to compare with the public key we sent originally. For versions 5 to 6: A hash is calculated with the magic string value, the nonce that was sent to the server and the public key that was used. This is verified against the returned server public key. :param nonce: If version 5+, the nonce used in the hash calculations :param server_key: The unwrapped value returned in the TSRequest['pubKeyAuth'] field. :param public_key: The actual public key of the server
[ "[", "MS", "-", "CSSP", "]", "3", ".", "1", ".", "5", "Processing", "Events", "and", "Sequencing", "Rules", "-", "Step", "4", "https", ":", "//", "msdn", ".", "microsoft", ".", "com", "/", "en", "-", "us", "/", "library", "/", "cc226791", ".", "aspx" ]
470db8d74dff919da67cf382e9ff784d4e8dd053
https://github.com/jborean93/requests-credssp/blob/470db8d74dff919da67cf382e9ff784d4e8dd053/requests_credssp/credssp.py#L223-L265
train
This method verifies the public key received from the server and the server_key field.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn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EroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31' + '\x31' + '\x37', 19558 - 19550), nzTpIcepk0o8('\060' + '\157' + '\063' + '\x32' + '\x31', 0b1000), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(12258 - 12147) + '\x32' + chr(0b11000 + 0o30) + '\065', 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b100101 + 0o15) + chr(0b110 + 0o53), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1100100 + 0o13) + '\x31' + chr(248 - 193) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(1057 - 1003) + '\x35', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1001001 + 0o46) + chr(326 - 274) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b1101111) + chr(2794 - 2739) + chr(0b1010 + 0o47), 57793 - 57785), nzTpIcepk0o8('\x30' + chr(5700 - 5589) + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\x30' + chr(9658 - 9547) + chr(50) + '\x37' + '\066', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110010) + '\064', 0o10), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(0b1101111) + '\x31' + chr(0b110101) + chr(48), 22540 - 22532), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110011) + chr(0b100010 + 0o21) + chr(1333 - 1284), ord("\x08")), nzTpIcepk0o8(chr(2197 - 2149) + chr(111) + chr(49) + chr(54) + '\061', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b10111 + 0o34) + chr(0b101000 + 0o13) + chr(49), 8), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(6635 - 6524) + '\x33' + '\061' + chr(49), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(6055 - 5944) + '\x33' + '\x36' + chr(489 - 437), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + '\064' + chr(0b110001), 50083 - 50075), nzTpIcepk0o8(chr(1206 - 1158) + '\x6f' + chr(0b110001) + '\x35' + chr(55), 0o10), nzTpIcepk0o8('\x30' + '\157' + '\067' + '\x34', 31567 - 31559), nzTpIcepk0o8('\060' + chr(0b110100 + 0o73) + chr(397 - 348) + chr(49) + chr(54), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(1344 - 1295) + chr(55) + '\067', 11 - 3), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x37', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101011 + 0o4) + chr(174 - 124) + chr(0b1011 + 0o54) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(1446 - 1398) + chr(111) + chr(0b110011) + '\065' + chr(51), 57803 - 57795), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110010) + '\060', ord("\x08")), nzTpIcepk0o8(chr(0b101100 + 0o4) + '\x6f' + chr(49) + chr(48) + '\x31', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\064', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(11848 - 11737) + chr(0b110011) + chr(0b1101 + 0o44) + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(0b100 + 0o153) + '\063' + '\x34' + '\x34', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b1011 + 0o46) + chr(0b11 + 0o62) + chr(0b100101 + 0o22), 8), nzTpIcepk0o8('\x30' + chr(0b11000 + 0o127) + chr(50) + chr(1059 - 1010) + chr(0b110101), 9117 - 9109), nzTpIcepk0o8('\x30' + chr(0b1010001 + 0o36) + chr(0b110011) + chr(0b100010 + 0o17) + chr(52), 14414 - 14406), nzTpIcepk0o8(chr(48) + chr(481 - 370) + chr(0b110011) + chr(0b101010 + 0o12), 0o10), nzTpIcepk0o8(chr(0b10011 + 0o35) + '\157' + '\061' + chr(1764 - 1714) + chr(50), 30596 - 30588), nzTpIcepk0o8(chr(1230 - 1182) + chr(0b1101111) + chr(154 - 104) + '\x32', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(53) + chr(0b110011), 36252 - 36244), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(111) + chr(0b101011 + 0o6) + chr(0b110011) + chr(0b110010), 0b1000), nzTpIcepk0o8('\060' + chr(0b100110 + 0o111) + chr(571 - 521) + '\x32' + chr(54), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\061' + chr(0b1001 + 0o52) + chr(0b10 + 0o64), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\x6f' + '\x35' + '\060', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'a'), '\144' + chr(0b1100101) + chr(4697 - 4598) + '\157' + '\144' + chr(0b1100101))(chr(3505 - 3388) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b100111 + 0o21)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def F32MgtRGy0sB(hXMPsSrOQzbh, jdvs2TNPZIHs, Cbr94GrcTIgY, dB1SCpPThPhv): if jdvs2TNPZIHs is not None: QIqqFbUcF9m5 = ES5oEprVxulp(b"\x0c\xa3\xe0u.&r\x19S\xdbf\x1e\xbc\x03\xf4\x9d\x9b\xcc,P'\x1ai\xc8\xcbR(j\xab\x8d\x01\xea\xecT3aCZ") + jdvs2TNPZIHs + dB1SCpPThPhv f4EFD6oS7U7x = SDv77BhJq2mr.sha256(QIqqFbUcF9m5).CikyTeQ_2JKj() CPqgJmwVQYNH = Cbr94GrcTIgY else: Lok7vuTJNcaZ = Mf7j_LCOrq1d.unpack(roI3spqORKae(ES5oEprVxulp(b'\r'), '\144' + '\145' + chr(4670 - 4571) + '\157' + '\144' + chr(101))(chr(0b10011 + 0o142) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(56)), Cbr94GrcTIgY[nzTpIcepk0o8(chr(0b110000 + 0o0) + '\157' + chr(48), 8):nzTpIcepk0o8('\x30' + '\157' + chr(0b110001), 28406 - 28398)])[nzTpIcepk0o8('\060' + chr(111) + '\x30', 8)] JuV_DsHL754u = Mf7j_LCOrq1d.pack(roI3spqORKae(ES5oEprVxulp(b'\r'), chr(0b1001011 + 0o31) + chr(0b1100101) + chr(99) + '\x6f' + '\x64' + chr(0b1100101))('\165' + '\164' + '\146' + chr(221 - 176) + chr(2859 - 2803)), Lok7vuTJNcaZ - nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001), 8)) f4EFD6oS7U7x = JuV_DsHL754u + Cbr94GrcTIgY[nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(111) + chr(0b110001), 8):] CPqgJmwVQYNH = dB1SCpPThPhv if f4EFD6oS7U7x != CPqgJmwVQYNH: raise dPIu_ImOMRDz(roI3spqORKae(ES5oEprVxulp(b"\x0c\xbe\xf0}\x19ULVt\x9eb\r\xab\x18\xbf\xb0\xd4\x8a\nEn\x0cb\xd2\x9f0'v\xa0\x89O\xf9\xa4yraN(\xe0;=\xfd\xa5a\x12\x01GWt\xd7u\x04\xf9\x1c\xb8\xa7\xd4\x88\x01\x1c:\x17b\x9c\x86y%`\xa3\x81O\xec\xb8h3q@"), chr(100) + chr(0b1100101) + chr(0b110001 + 0o62) + chr(0b101110 + 0o101) + chr(0b1 + 0o143) + '\x65')(chr(0b1110101) + '\x74' + chr(102) + '\055' + '\x38'))
jborean93/requests-credssp
requests_credssp/credssp.py
CredSSPContext._get_encrypted_credentials
def _get_encrypted_credentials(self, context): """ [MS-CSSP] 3.1.5 Processing Events and Sequencing Rules - Step 5 https://msdn.microsoft.com/en-us/library/cc226791.aspx After the client has verified the server's authenticity, it encrypts the user's credentials with the authentication protocol's encryption services. The resulting value is encapsulated in the authInfo field of the TSRequest structure and sent over the encrypted TLS channel to the server :param context: The authenticated security context :return: The encrypted TSRequest that contains the user's credentials """ ts_password = TSPasswordCreds() ts_password['domainName'] = context.domain.encode('utf-16-le') ts_password['userName'] = context.username.encode('utf-16-le') ts_password['password'] = context.password.encode('utf-16-le') ts_credentials = TSCredentials() ts_credentials['credType'] = ts_password.CRED_TYPE ts_credentials['credentials'] = encoder.encode(ts_password) ts_request = TSRequest() enc_credentials = context.wrap(encoder.encode(ts_credentials)) ts_request['authInfo'] = enc_credentials return encoder.encode(ts_request)
python
def _get_encrypted_credentials(self, context): """ [MS-CSSP] 3.1.5 Processing Events and Sequencing Rules - Step 5 https://msdn.microsoft.com/en-us/library/cc226791.aspx After the client has verified the server's authenticity, it encrypts the user's credentials with the authentication protocol's encryption services. The resulting value is encapsulated in the authInfo field of the TSRequest structure and sent over the encrypted TLS channel to the server :param context: The authenticated security context :return: The encrypted TSRequest that contains the user's credentials """ ts_password = TSPasswordCreds() ts_password['domainName'] = context.domain.encode('utf-16-le') ts_password['userName'] = context.username.encode('utf-16-le') ts_password['password'] = context.password.encode('utf-16-le') ts_credentials = TSCredentials() ts_credentials['credType'] = ts_password.CRED_TYPE ts_credentials['credentials'] = encoder.encode(ts_password) ts_request = TSRequest() enc_credentials = context.wrap(encoder.encode(ts_credentials)) ts_request['authInfo'] = enc_credentials return encoder.encode(ts_request)
[ "def", "_get_encrypted_credentials", "(", "self", ",", "context", ")", ":", "ts_password", "=", "TSPasswordCreds", "(", ")", "ts_password", "[", "'domainName'", "]", "=", "context", ".", "domain", ".", "encode", "(", "'utf-16-le'", ")", "ts_password", "[", "'userName'", "]", "=", "context", ".", "username", ".", "encode", "(", "'utf-16-le'", ")", "ts_password", "[", "'password'", "]", "=", "context", ".", "password", ".", "encode", "(", "'utf-16-le'", ")", "ts_credentials", "=", "TSCredentials", "(", ")", "ts_credentials", "[", "'credType'", "]", "=", "ts_password", ".", "CRED_TYPE", "ts_credentials", "[", "'credentials'", "]", "=", "encoder", ".", "encode", "(", "ts_password", ")", "ts_request", "=", "TSRequest", "(", ")", "enc_credentials", "=", "context", ".", "wrap", "(", "encoder", ".", "encode", "(", "ts_credentials", ")", ")", "ts_request", "[", "'authInfo'", "]", "=", "enc_credentials", "return", "encoder", ".", "encode", "(", "ts_request", ")" ]
[MS-CSSP] 3.1.5 Processing Events and Sequencing Rules - Step 5 https://msdn.microsoft.com/en-us/library/cc226791.aspx After the client has verified the server's authenticity, it encrypts the user's credentials with the authentication protocol's encryption services. The resulting value is encapsulated in the authInfo field of the TSRequest structure and sent over the encrypted TLS channel to the server :param context: The authenticated security context :return: The encrypted TSRequest that contains the user's credentials
[ "[", "MS", "-", "CSSP", "]", "3", ".", "1", ".", "5", "Processing", "Events", "and", "Sequencing", "Rules", "-", "Step", "5", "https", ":", "//", "msdn", ".", "microsoft", ".", "com", "/", "en", "-", "us", "/", "library", "/", "cc226791", ".", "aspx" ]
470db8d74dff919da67cf382e9ff784d4e8dd053
https://github.com/jborean93/requests-credssp/blob/470db8d74dff919da67cf382e9ff784d4e8dd053/requests_credssp/credssp.py#L267-L294
train
This method encrypts the user s credentials with the authentication protocol s encryption protocol s encryption services and returns the encrypted TSRequest that contains the user s credentials.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5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,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(3642 - 3531) + '\062' + chr(0b101110 + 0o2) + chr(54), 0b1000), nzTpIcepk0o8(chr(0b10100 + 0o34) + '\157' + chr(51) + chr(0b110001) + chr(0b1110 + 0o46), 0o10), nzTpIcepk0o8('\060' + '\157' + '\061' + chr(0b100010 + 0o22) + chr(52), 63879 - 63871), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(0b1101111) + chr(0b11000 + 0o35) + chr(0b0 + 0o64), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1100100 + 0o13) + '\x33' + chr(1160 - 1106) + chr(0b110100), 36125 - 36117), nzTpIcepk0o8('\x30' + '\157' + '\x33' + chr(0b110101) + chr(51), 0b1000), nzTpIcepk0o8('\060' + chr(0b1111 + 0o140) + chr(52) + chr(0b110101), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(54), 0b1000), nzTpIcepk0o8(chr(0b100100 + 0o14) + '\157' + chr(54) + chr(0b110111), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(1823 - 1773) + chr(0b110011) + '\067', 0b1000), nzTpIcepk0o8('\060' + chr(0b111 + 0o150) + '\063' + '\065', 0b1000), nzTpIcepk0o8('\x30' + chr(0b101111 + 0o100) + chr(50) + chr(0b110100) + chr(0b10010 + 0o40), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110010) + '\062' + chr(0b110001), 0o10), nzTpIcepk0o8(chr(1739 - 1691) + chr(0b110000 + 0o77) + '\062' + '\067' + chr(1162 - 1108), 32029 - 32021), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b11000 + 0o32) + chr(1960 - 1907) + chr(48), 0b1000), nzTpIcepk0o8('\060' + chr(0b1100 + 0o143) + chr(0b100 + 0o56) + chr(53) + '\062', 0b1000), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1101111) + chr(0b110010) + chr(49) + '\x35', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\x32' + '\x36' + '\x35', 6654 - 6646), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x35' + chr(1947 - 1897), 39364 - 39356), nzTpIcepk0o8(chr(48) + chr(7389 - 7278) + '\061' + chr(1582 - 1529) + chr(2503 - 2450), ord("\x08")), nzTpIcepk0o8(chr(1168 - 1120) + '\157' + chr(0b110001) + chr(53) + chr(54), 0o10), nzTpIcepk0o8(chr(48) + chr(4149 - 4038) + chr(0b110011) + '\x30' + chr(1944 - 1895), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(391 - 342) + '\062' + chr(843 - 788), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110010) + chr(2180 - 2131) + chr(0b100011 + 0o22), 8), nzTpIcepk0o8('\060' + chr(7561 - 7450) + chr(54), 8), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(50) + chr(1880 - 1825) + chr(911 - 860), 0b1000), nzTpIcepk0o8('\060' + chr(0b1011011 + 0o24) + chr(0b100000 + 0o22) + chr(53) + chr(0b110001), 47648 - 47640), nzTpIcepk0o8(chr(333 - 285) + chr(0b1101111) + chr(0b110011) + chr(1883 - 1834) + '\061', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b110110) + chr(49), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(567 - 512) + '\061', 0o10), nzTpIcepk0o8(chr(48) + chr(0b100110 + 0o111) + chr(284 - 233) + chr(1051 - 1003), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b11111 + 0o23) + '\x30' + '\067', ord("\x08")), nzTpIcepk0o8('\060' + chr(3330 - 3219) + '\x32' + chr(124 - 76) + chr(0b110101), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1011000 + 0o27) + '\063' + chr(0b110111) + chr(54), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + '\x32' + chr(48) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(0b111111 + 0o60) + chr(49) + '\x36' + chr(0b110010), 6224 - 6216), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001) + '\066', 55211 - 55203), nzTpIcepk0o8(chr(0b11001 + 0o27) + '\x6f' + '\x33' + chr(0b100100 + 0o17), ord("\x08")), nzTpIcepk0o8(chr(851 - 803) + '\x6f' + chr(0b11111 + 0o23) + chr(55) + '\x33', 8), nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(0b1010010 + 0o35) + chr(0b110100) + '\x32', 28695 - 28687)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1674 - 1626) + chr(111) + chr(0b110101 + 0o0) + chr(0b11101 + 0o23), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xa8'), chr(0b1001101 + 0o27) + chr(0b1100101) + chr(0b100010 + 0o101) + chr(0b1000011 + 0o54) + chr(0b1001000 + 0o34) + '\145')('\165' + chr(116) + chr(102) + '\x2d' + chr(0b101110 + 0o12)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def I9yDnOknVYjk(hXMPsSrOQzbh, xwFiQMStTnzU): tduXEVzqEY61 = d8IpJnDLERn2() tduXEVzqEY61[roI3spqORKae(ES5oEprVxulp(b'\xe2\xa3\tM\x9d\x85kgZ\xfa'), chr(0b111 + 0o135) + chr(0b1100101) + chr(0b101001 + 0o72) + '\x6f' + chr(100) + '\x65')(chr(0b111000 + 0o75) + chr(0b1011 + 0o151) + '\146' + '\x2d' + chr(0b101010 + 0o16))] = xwFiQMStTnzU.domain.YqIaRFfeo4Ha(roI3spqORKae(ES5oEprVxulp(b'\xf3\xb8\x02\x01\xc5\xdd\x08jR'), chr(9442 - 9342) + chr(0b1100101) + chr(99) + chr(0b1010 + 0o145) + '\x64' + chr(101))(chr(188 - 71) + '\x74' + chr(10286 - 10184) + '\x2d' + chr(0b1110 + 0o52))) tduXEVzqEY61[roI3spqORKae(ES5oEprVxulp(b'\xf3\xbf\x01^\xba\x8aHc'), chr(100) + '\145' + '\x63' + chr(11562 - 11451) + chr(0b1000010 + 0o42) + '\145')(chr(0b111 + 0o156) + chr(116) + chr(3718 - 3616) + chr(45) + chr(2100 - 2044))] = xwFiQMStTnzU.username.YqIaRFfeo4Ha(roI3spqORKae(ES5oEprVxulp(b'\xf3\xb8\x02\x01\xc5\xdd\x08jR'), chr(0b1100100) + chr(0b11101 + 0o110) + '\x63' + '\157' + '\144' + '\145')(chr(0b1110101) + chr(0b1110100) + '\146' + '\055' + chr(1695 - 1639))) tduXEVzqEY61[roI3spqORKae(ES5oEprVxulp(b'\xf6\xad\x17_\x83\x84Wb'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(8641 - 8530) + '\144' + chr(0b1100101))(chr(0b1110100 + 0o1) + '\164' + chr(0b1111 + 0o127) + chr(1494 - 1449) + '\x38')] = xwFiQMStTnzU.password.YqIaRFfeo4Ha(roI3spqORKae(ES5oEprVxulp(b'\xf3\xb8\x02\x01\xc5\xdd\x08jR'), chr(0b1000010 + 0o42) + chr(5537 - 5436) + chr(0b11000 + 0o113) + chr(3554 - 3443) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(0b1101 + 0o131) + chr(45) + '\070')) XlhhdAivld9F = JslNElhMjkEQ() XlhhdAivld9F[roI3spqORKae(ES5oEprVxulp(b'\xe5\xbe\x01H\xa0\x92Uc'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\157' + '\x64' + chr(101))('\165' + '\164' + chr(0b1100110) + chr(807 - 762) + chr(0b111000))] = tduXEVzqEY61.CRED_TYPE XlhhdAivld9F[roI3spqORKae(ES5oEprVxulp(b'\xe5\xbe\x01H\x91\x85QoV\xf3n'), chr(0b1100100) + chr(0b1000011 + 0o42) + chr(99) + chr(111) + chr(0b1100100) + chr(101))(chr(117) + chr(3756 - 3640) + chr(5644 - 5542) + chr(1491 - 1446) + '\x38')] = iOLbMFzneHpo.YqIaRFfeo4Ha(tduXEVzqEY61) xSxcYsmhAbUW = XrHHeub0lBvE() duoD9AugM_nv = xwFiQMStTnzU.akRYbnaVA1EB(iOLbMFzneHpo.YqIaRFfeo4Ha(XlhhdAivld9F)) xSxcYsmhAbUW[roI3spqORKae(ES5oEprVxulp(b'\xe7\xb9\x10D\xbd\x85Ci'), chr(7045 - 6945) + '\145' + chr(0b111110 + 0o45) + chr(111) + chr(100) + '\x65')('\165' + chr(0b1101111 + 0o5) + '\146' + '\x2d' + '\070')] = duoD9AugM_nv return roI3spqORKae(iOLbMFzneHpo, roI3spqORKae(ES5oEprVxulp(b'\xdf\xbd-M\xa6\xadCcX\xabU\xc3'), chr(859 - 759) + '\145' + chr(99) + '\x6f' + chr(0b1010001 + 0o23) + chr(101))(chr(117) + chr(116) + chr(5146 - 5044) + chr(1242 - 1197) + '\x38'))(xSxcYsmhAbUW)
jborean93/requests-credssp
requests_credssp/credssp.py
CredSSPContext.wrap
def wrap(self, data): """ Encrypts the data in preparation for sending to the server. The data is encrypted using the TLS channel negotiated between the client and the server. :param data: a byte string of data to encrypt :return: a byte string of the encrypted data """ length = self.tls_connection.send(data) encrypted_data = b'' counter = 0 while True: try: encrypted_chunk = \ self.tls_connection.bio_read(self.BIO_BUFFER_SIZE) except SSL.WantReadError: break encrypted_data += encrypted_chunk # in case of a borked TLS connection, break the loop if the current # buffer counter is > the length of the original message plus the # the size of the buffer (to be careful) counter += self.BIO_BUFFER_SIZE if counter > length + self.BIO_BUFFER_SIZE: break return encrypted_data
python
def wrap(self, data): """ Encrypts the data in preparation for sending to the server. The data is encrypted using the TLS channel negotiated between the client and the server. :param data: a byte string of data to encrypt :return: a byte string of the encrypted data """ length = self.tls_connection.send(data) encrypted_data = b'' counter = 0 while True: try: encrypted_chunk = \ self.tls_connection.bio_read(self.BIO_BUFFER_SIZE) except SSL.WantReadError: break encrypted_data += encrypted_chunk # in case of a borked TLS connection, break the loop if the current # buffer counter is > the length of the original message plus the # the size of the buffer (to be careful) counter += self.BIO_BUFFER_SIZE if counter > length + self.BIO_BUFFER_SIZE: break return encrypted_data
[ "def", "wrap", "(", "self", ",", "data", ")", ":", "length", "=", "self", ".", "tls_connection", ".", "send", "(", "data", ")", "encrypted_data", "=", "b''", "counter", "=", "0", "while", "True", ":", "try", ":", "encrypted_chunk", "=", "self", ".", "tls_connection", ".", "bio_read", "(", "self", ".", "BIO_BUFFER_SIZE", ")", "except", "SSL", ".", "WantReadError", ":", "break", "encrypted_data", "+=", "encrypted_chunk", "# in case of a borked TLS connection, break the loop if the current", "# buffer counter is > the length of the original message plus the", "# the size of the buffer (to be careful)", "counter", "+=", "self", ".", "BIO_BUFFER_SIZE", "if", "counter", ">", "length", "+", "self", ".", "BIO_BUFFER_SIZE", ":", "break", "return", "encrypted_data" ]
Encrypts the data in preparation for sending to the server. The data is encrypted using the TLS channel negotiated between the client and the server. :param data: a byte string of data to encrypt :return: a byte string of the encrypted data
[ "Encrypts", "the", "data", "in", "preparation", "for", "sending", "to", "the", "server", ".", "The", "data", "is", "encrypted", "using", "the", "TLS", "channel", "negotiated", "between", "the", "client", "and", "the", "server", "." ]
470db8d74dff919da67cf382e9ff784d4e8dd053
https://github.com/jborean93/requests-credssp/blob/470db8d74dff919da67cf382e9ff784d4e8dd053/requests_credssp/credssp.py#L296-L324
train
Encrypts the data in preparation for sending to the server.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_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WcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1843 - 1795) + chr(0b1011100 + 0o23) + '\066' + chr(51), 0o10), nzTpIcepk0o8(chr(48) + chr(6103 - 5992) + chr(49) + chr(0b110000) + chr(0b110101), 49548 - 49540), nzTpIcepk0o8(chr(623 - 575) + chr(111) + chr(0b110011) + chr(50) + chr(668 - 619), 49725 - 49717), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(582 - 531) + chr(50) + chr(687 - 632), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(437 - 387) + chr(1453 - 1400) + chr(50), 0o10), nzTpIcepk0o8(chr(115 - 67) + chr(0b1101111) + chr(0b110001) + chr(0b101100 + 0o6) + chr(847 - 794), 38057 - 38049), nzTpIcepk0o8(chr(0b110000) + chr(8891 - 8780) + chr(0b110001) + '\x36' + chr(0b10101 + 0o35), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b101110 + 0o101) + chr(53) + '\060', 2701 - 2693), nzTpIcepk0o8(chr(605 - 557) + chr(4855 - 4744) + chr(0b101010 + 0o10) + chr(0b100110 + 0o20) + chr(50), 0b1000), nzTpIcepk0o8(chr(2208 - 2160) + '\x6f' + chr(55) + chr(52), 9380 - 9372), nzTpIcepk0o8('\x30' + chr(8610 - 8499) + '\x33' + '\x31' + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(51) + chr(0b100110 + 0o13) + chr(0b110001), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b111 + 0o150) + '\061' + chr(1290 - 1238) + '\x33', 52415 - 52407), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x31' + chr(0b101111 + 0o5) + chr(1451 - 1401), 0b1000), nzTpIcepk0o8(chr(1340 - 1292) + chr(2176 - 2065) + chr(51 - 2) + '\x34', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\x31' + '\067' + chr(49), 0b1000), nzTpIcepk0o8(chr(1335 - 1287) + '\x6f' + chr(0b0 + 0o61) + '\065' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1001111 + 0o40) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(1129 - 1081) + chr(2301 - 2190) + chr(0b110101) + chr(0b100 + 0o54), 8), nzTpIcepk0o8(chr(691 - 643) + '\157' + chr(0b11000 + 0o31) + chr(1095 - 1042) + chr(0b110000), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(441 - 391) + chr(1957 - 1905) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(1554 - 1506) + '\157' + '\067' + '\060', 59823 - 59815), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\065' + chr(53), 0o10), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(111) + '\063' + '\064' + '\064', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110011) + chr(0b1001 + 0o53) + chr(53), 0o10), nzTpIcepk0o8('\060' + chr(607 - 496) + chr(0b100010 + 0o17) + chr(924 - 875) + chr(2083 - 2032), 24779 - 24771), nzTpIcepk0o8('\x30' + '\157' + '\x31' + chr(49) + chr(0b110011), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1010 + 0o145) + '\062' + '\063' + '\x34', ord("\x08")), nzTpIcepk0o8('\x30' + chr(4238 - 4127) + '\x32' + '\062' + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(2020 - 1970) + chr(0b11011 + 0o33) + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b1110 + 0o42) + '\x6f' + '\062' + '\060' + '\x30', 46727 - 46719), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b10100 + 0o35) + chr(0b110011) + chr(0b110010), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b101001 + 0o12) + chr(0b110110) + '\067', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1100111 + 0o10) + chr(1946 - 1897) + chr(1105 - 1050) + chr(2384 - 2335), 8), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b10010 + 0o41) + chr(0b110101) + chr(1139 - 1085), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(2040 - 1990) + chr(1036 - 983) + '\x32', 8), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110101) + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(11513 - 11402) + '\062' + chr(0b11001 + 0o31) + chr(0b110110), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b10100 + 0o133) + chr(0b100010 + 0o20) + '\062' + chr(0b110011 + 0o3), 8), nzTpIcepk0o8('\x30' + '\157' + '\063' + '\061' + '\066', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b10 + 0o56) + chr(111) + chr(53) + chr(0b11010 + 0o26), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x1d'), chr(0b1100100) + '\x65' + '\143' + chr(6382 - 6271) + '\x64' + '\x65')(chr(0b110000 + 0o105) + chr(0b1110100) + chr(532 - 430) + '\x2d' + '\x38') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def akRYbnaVA1EB(hXMPsSrOQzbh, FfKOThdpoDTb): a1RCQZREo3Kd = hXMPsSrOQzbh.tls_connection.JYqXkYlMUreF(FfKOThdpoDTb) dAqXXzys2EP1 = ES5oEprVxulp(b'') AISxp6RQlnj5 = nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1202 - 1154), 43904 - 43896) while nzTpIcepk0o8('\x30' + chr(12273 - 12162) + chr(0b110001), 0o10): try: q2kwZBg2MCKB = hXMPsSrOQzbh.tls_connection.bio_read(hXMPsSrOQzbh.BIO_BUFFER_SIZE) except roI3spqORKae(mbrBZjGC9Ovi, roI3spqORKae(ES5oEprVxulp(b'd$\xbf\xa3\xf80\x13L\xf7N\xbc\xa6\x11'), chr(0b11111 + 0o105) + chr(101) + chr(0b100110 + 0o75) + chr(0b100100 + 0o113) + '\x64' + chr(0b1100101))(chr(117) + chr(9933 - 9817) + chr(0b10001 + 0o125) + '\x2d' + '\x38')): break dAqXXzys2EP1 += q2kwZBg2MCKB AISxp6RQlnj5 += hXMPsSrOQzbh.BIO_BUFFER_SIZE if AISxp6RQlnj5 > a1RCQZREo3Kd + roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'q\x0c\x9e\x88\xe8\x004n\xf7n\x91\x9a*8I'), chr(100) + chr(101) + chr(0b1010001 + 0o22) + chr(3270 - 3159) + chr(100) + chr(7015 - 6914))(chr(0b1110101) + '\164' + chr(0b1000101 + 0o41) + chr(45) + chr(0b1010 + 0o56))): break return dAqXXzys2EP1
jborean93/requests-credssp
requests_credssp/credssp.py
CredSSPContext.unwrap
def unwrap(self, encrypted_data): """ Decrypts the data send by the server using the TLS channel negotiated between the client and the server. :param encrypted_data: the byte string of the encrypted data :return: a byte string of the decrypted data """ length = self.tls_connection.bio_write(encrypted_data) data = b'' counter = 0 while True: try: data_chunk = self.tls_connection.recv(self.BIO_BUFFER_SIZE) except SSL.WantReadError: break data += data_chunk counter += self.BIO_BUFFER_SIZE if counter > length: break return data
python
def unwrap(self, encrypted_data): """ Decrypts the data send by the server using the TLS channel negotiated between the client and the server. :param encrypted_data: the byte string of the encrypted data :return: a byte string of the decrypted data """ length = self.tls_connection.bio_write(encrypted_data) data = b'' counter = 0 while True: try: data_chunk = self.tls_connection.recv(self.BIO_BUFFER_SIZE) except SSL.WantReadError: break data += data_chunk counter += self.BIO_BUFFER_SIZE if counter > length: break return data
[ "def", "unwrap", "(", "self", ",", "encrypted_data", ")", ":", "length", "=", "self", ".", "tls_connection", ".", "bio_write", "(", "encrypted_data", ")", "data", "=", "b''", "counter", "=", "0", "while", "True", ":", "try", ":", "data_chunk", "=", "self", ".", "tls_connection", ".", "recv", "(", "self", ".", "BIO_BUFFER_SIZE", ")", "except", "SSL", ".", "WantReadError", ":", "break", "data", "+=", "data_chunk", "counter", "+=", "self", ".", "BIO_BUFFER_SIZE", "if", "counter", ">", "length", ":", "break", "return", "data" ]
Decrypts the data send by the server using the TLS channel negotiated between the client and the server. :param encrypted_data: the byte string of the encrypted data :return: a byte string of the decrypted data
[ "Decrypts", "the", "data", "send", "by", "the", "server", "using", "the", "TLS", "channel", "negotiated", "between", "the", "client", "and", "the", "server", "." ]
470db8d74dff919da67cf382e9ff784d4e8dd053
https://github.com/jborean93/requests-credssp/blob/470db8d74dff919da67cf382e9ff784d4e8dd053/requests_credssp/credssp.py#L326-L349
train
Decrypts the data sent by the client and the server using the TLS channel negotiated between the client and the server.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF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XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(8276 - 8165) + chr(2109 - 2055) + chr(0b101001 + 0o13), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1001111 + 0o40) + '\x34' + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b1 + 0o61) + chr(0b11111 + 0o21) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(1137 - 1089) + chr(4887 - 4776) + chr(0b10000 + 0o41) + chr(0b101001 + 0o13), 40918 - 40910), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1179 - 1124) + chr(0b100011 + 0o21), 0b1000), nzTpIcepk0o8(chr(130 - 82) + chr(0b1101111) + chr(0b110001) + chr(0b110101) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b11000 + 0o31) + chr(2330 - 2279) + chr(49), 13306 - 13298), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b110000) + chr(2291 - 2242), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001) + '\x34' + chr(55), 0o10), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(111) + chr(49) + chr(0b10000 + 0o41) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(2123 - 2075) + chr(0b1101111) + chr(1912 - 1861) + chr(52) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + '\061' + chr(54), 0o10), nzTpIcepk0o8('\060' + '\157' + '\x31' + chr(0b110111) + '\060', 0o10), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b1101111) + chr(0b111 + 0o54) + chr(0b110010) + '\064', 18829 - 18821), nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(111) + chr(51) + chr(1529 - 1474), ord("\x08")), nzTpIcepk0o8(chr(0b1100 + 0o44) + '\x6f' + chr(156 - 106) + chr(0b110101) + chr(50), 0b1000), nzTpIcepk0o8(chr(1506 - 1458) + '\x6f' + chr(53) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1100 + 0o143) + chr(0b10101 + 0o41) + chr(662 - 614), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b11000 + 0o32) + '\067', 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(55) + chr(0b101100 + 0o13), 23555 - 23547), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x37' + chr(50), 0b1000), nzTpIcepk0o8(chr(114 - 66) + chr(12238 - 12127) + chr(0b110010) + chr(0b101011 + 0o5), 0o10), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(7018 - 6907) + chr(55) + chr(2564 - 2513), ord("\x08")), nzTpIcepk0o8(chr(800 - 752) + chr(0b1010101 + 0o32) + chr(50) + '\061' + chr(0b101100 + 0o10), ord("\x08")), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(111) + chr(51) + chr(48), 0o10), nzTpIcepk0o8(chr(0b110000 + 0o0) + '\157' + chr(0b10 + 0o65) + '\x34', 8), nzTpIcepk0o8('\060' + chr(11051 - 10940) + chr(0b110011) + chr(0b11010 + 0o35) + chr(50), 0b1000), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(5599 - 5488) + chr(55), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110011) + '\x31' + chr(53), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b10001 + 0o136) + '\066' + chr(0b110100), 8), nzTpIcepk0o8(chr(48) + chr(2876 - 2765) + '\x37' + '\065', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + '\064' + chr(54), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(3290 - 3179) + chr(0b11111 + 0o22) + chr(50) + chr(2457 - 2407), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\x31' + '\x30' + chr(65 - 15), ord("\x08")), nzTpIcepk0o8(chr(956 - 908) + chr(0b1101111) + '\x32' + chr(54) + '\066', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + chr(686 - 633) + '\x32', 8), nzTpIcepk0o8(chr(0b1111 + 0o41) + '\x6f' + '\x31' + chr(0b1001 + 0o53) + chr(0b110001 + 0o3), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(2170 - 2121) + chr(0b10101 + 0o40), 0b1000), nzTpIcepk0o8('\x30' + chr(0b10100 + 0o133) + chr(400 - 350) + chr(0b101000 + 0o11) + chr(50), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(111) + '\065' + chr(1979 - 1931), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x1a'), chr(0b1000010 + 0o42) + '\145' + chr(6090 - 5991) + chr(6763 - 6652) + '\x64' + chr(101))('\165' + chr(6048 - 5932) + '\146' + '\055' + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def YqejweNAA8w5(hXMPsSrOQzbh, dAqXXzys2EP1): a1RCQZREo3Kd = hXMPsSrOQzbh.tls_connection.bio_write(dAqXXzys2EP1) FfKOThdpoDTb = ES5oEprVxulp(b'') AISxp6RQlnj5 = nzTpIcepk0o8('\060' + chr(0b1101111) + chr(48), 23333 - 23325) while nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49), 0b1000): try: pRrLKRJpSrNi = hXMPsSrOQzbh.tls_connection.recv(hXMPsSrOQzbh.BIO_BUFFER_SIZE) except roI3spqORKae(mbrBZjGC9Ovi, roI3spqORKae(ES5oEprVxulp(b'cE\xebxn\r8\xe5":\x92\xa1\n'), chr(100) + chr(2625 - 2524) + chr(0b101010 + 0o71) + chr(111) + chr(0b1100100) + chr(101))(chr(0b110111 + 0o76) + chr(0b100000 + 0o124) + chr(0b1000000 + 0o46) + '\055' + '\070')): break FfKOThdpoDTb += pRrLKRJpSrNi AISxp6RQlnj5 += hXMPsSrOQzbh.BIO_BUFFER_SIZE if AISxp6RQlnj5 > a1RCQZREo3Kd: break return FfKOThdpoDTb
jborean93/requests-credssp
requests_credssp/credssp.py
CredSSPContext._get_subject_public_key
def _get_subject_public_key(cert): """ Returns the SubjectPublicKey asn.1 field of the SubjectPublicKeyInfo field of the server's certificate. This is used in the server verification steps to thwart MitM attacks. :param cert: X509 certificate from pyOpenSSL .get_peer_certificate() :return: byte string of the asn.1 DER encoded SubjectPublicKey field """ public_key = cert.get_pubkey() cryptographic_key = public_key.to_cryptography_key() subject_public_key = cryptographic_key.public_bytes(Encoding.DER, PublicFormat.PKCS1) return subject_public_key
python
def _get_subject_public_key(cert): """ Returns the SubjectPublicKey asn.1 field of the SubjectPublicKeyInfo field of the server's certificate. This is used in the server verification steps to thwart MitM attacks. :param cert: X509 certificate from pyOpenSSL .get_peer_certificate() :return: byte string of the asn.1 DER encoded SubjectPublicKey field """ public_key = cert.get_pubkey() cryptographic_key = public_key.to_cryptography_key() subject_public_key = cryptographic_key.public_bytes(Encoding.DER, PublicFormat.PKCS1) return subject_public_key
[ "def", "_get_subject_public_key", "(", "cert", ")", ":", "public_key", "=", "cert", ".", "get_pubkey", "(", ")", "cryptographic_key", "=", "public_key", ".", "to_cryptography_key", "(", ")", "subject_public_key", "=", "cryptographic_key", ".", "public_bytes", "(", "Encoding", ".", "DER", ",", "PublicFormat", ".", "PKCS1", ")", "return", "subject_public_key" ]
Returns the SubjectPublicKey asn.1 field of the SubjectPublicKeyInfo field of the server's certificate. This is used in the server verification steps to thwart MitM attacks. :param cert: X509 certificate from pyOpenSSL .get_peer_certificate() :return: byte string of the asn.1 DER encoded SubjectPublicKey field
[ "Returns", "the", "SubjectPublicKey", "asn", ".", "1", "field", "of", "the", "SubjectPublicKeyInfo", "field", "of", "the", "server", "s", "certificate", ".", "This", "is", "used", "in", "the", "server", "verification", "steps", "to", "thwart", "MitM", "attacks", "." ]
470db8d74dff919da67cf382e9ff784d4e8dd053
https://github.com/jborean93/requests-credssp/blob/470db8d74dff919da67cf382e9ff784d4e8dd053/requests_credssp/credssp.py#L352-L365
train
Returns the SubjectPublicKey asn. 1 field of the SubjectPublicKeyInfo field of the server s certificate. This is used in the serverMacroCertificate verification steps to thwart MitM attacks.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5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MnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(871 - 823) + '\157' + '\x32' + chr(54) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b111 + 0o60) + '\x36', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b110 + 0o55) + chr(52) + chr(0b100101 + 0o22), 28691 - 28683), nzTpIcepk0o8(chr(48) + chr(5221 - 5110) + chr(0b110011) + chr(2833 - 2779) + '\x35', 27240 - 27232), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b10100 + 0o37) + '\063' + chr(0b110000), 44290 - 44282), nzTpIcepk0o8('\060' + chr(111) + '\x31' + '\063' + chr(54), 0o10), nzTpIcepk0o8(chr(352 - 304) + '\157' + '\x33' + chr(266 - 213) + chr(0b10101 + 0o42), 16924 - 16916), nzTpIcepk0o8('\x30' + chr(9109 - 8998) + chr(0b110010) + chr(0b100011 + 0o22) + '\060', 20156 - 20148), nzTpIcepk0o8('\060' + chr(0b10110 + 0o131) + chr(0b110100) + '\067', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1010111 + 0o30) + chr(1463 - 1413) + chr(53) + '\065', 14379 - 14371), nzTpIcepk0o8(chr(0b110000) + chr(0b1010000 + 0o37) + chr(0b110011) + '\062' + chr(1590 - 1536), ord("\x08")), nzTpIcepk0o8(chr(0b1010 + 0o46) + '\x6f' + '\x32' + chr(0b101001 + 0o7) + chr(55), 4783 - 4775), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(333 - 284) + chr(1262 - 1213) + chr(51), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b1000 + 0o51) + '\067' + '\x34', 41574 - 41566), nzTpIcepk0o8(chr(1608 - 1560) + chr(11169 - 11058) + chr(52) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110111 + 0o0) + chr(2638 - 2586), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(1407 - 1296) + '\062' + '\x33' + '\x31', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1100010 + 0o15) + chr(446 - 397) + '\067' + '\x35', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b1110 + 0o45) + chr(0b101001 + 0o11) + '\x34', 0b1000), nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(111) + '\x33' + chr(1281 - 1229) + chr(0b101 + 0o60), 63379 - 63371), nzTpIcepk0o8(chr(1627 - 1579) + chr(0b1101111) + '\062' + '\x31' + chr(735 - 684), 0o10), nzTpIcepk0o8(chr(507 - 459) + '\x6f' + chr(0b110010) + chr(0b110110 + 0o0) + chr(0b110000), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(309 - 260) + chr(2128 - 2078) + chr(92 - 43), 32607 - 32599), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x32' + chr(53) + '\x36', 0b1000), nzTpIcepk0o8('\060' + chr(5669 - 5558) + '\062' + chr(49) + chr(0b10001 + 0o42), 8), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x33' + chr(0b110101) + '\x30', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(3859 - 3748) + '\061' + chr(0b110100) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1000010 + 0o55) + '\x31' + '\x35' + chr(0b1 + 0o62), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\x32' + '\x34' + chr(0b110111), 31124 - 31116), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(0b1101111) + chr(819 - 770) + chr(0b110000 + 0o1), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(50) + chr(53) + chr(55), 59163 - 59155), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110010) + chr(2306 - 2256) + chr(305 - 256), ord("\x08")), nzTpIcepk0o8(chr(1054 - 1006) + '\157' + chr(0b101010 + 0o10) + '\x37' + '\061', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b10001 + 0o136) + chr(458 - 409) + chr(0b110001 + 0o4) + chr(0b11 + 0o64), 0b1000), nzTpIcepk0o8(chr(1540 - 1492) + chr(0b100 + 0o153) + '\x33' + '\x33', 0o10), nzTpIcepk0o8(chr(1969 - 1921) + '\x6f' + chr(0b1001 + 0o52) + chr(53) + '\x36', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(51) + '\x34' + chr(49), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b101111 + 0o100) + chr(0b1 + 0o60) + '\064' + '\066', 48631 - 48623), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b1101111) + '\061' + chr(892 - 844) + chr(51), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\063' + chr(2270 - 2215) + chr(0b110011), 45134 - 45126)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\157' + '\065' + chr(1015 - 967), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x9e'), chr(0b110011 + 0o61) + chr(0b101010 + 0o73) + chr(8980 - 8881) + chr(111) + '\144' + chr(0b1100101))(chr(117) + chr(4526 - 4410) + chr(0b1000010 + 0o44) + chr(45) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Rv00VJbFfw9a(ux0FimK1GYCy): dB1SCpPThPhv = ux0FimK1GYCy.get_pubkey() uY3aZJPrevA7 = dB1SCpPThPhv.to_cryptography_key() XoZVnIpfYJhl = uY3aZJPrevA7.public_bytes(VZSX5t81HhdR.DER, IQChHjB37uwN.PKCS1) return XoZVnIpfYJhl
msuozzo/Lector
lector/reader.py
_KindleCloudReaderBrowser._to_reader_home
def _to_reader_home(self): """Navigate to the Cloud Reader library page. Raises: BrowserError: If the KCR homepage could not be loaded. ConnectionError: If there was a connection error. """ # NOTE: Prevents QueryInterface error caused by getting a URL # while switched to an iframe self.switch_to_default_content() self.get(_KindleCloudReaderBrowser._CLOUD_READER_URL) if self.title == u'Problem loading page': raise ConnectionError # Wait for either the login page or the reader to load login_or_reader_loaded = lambda br: ( br.find_elements_by_id('amzn_kcr') or br.find_elements_by_id('KindleLibraryIFrame')) self._wait(5).until(login_or_reader_loaded) try: self._wait(5).until(lambda br: br.title == u'Amazon.com Sign In') except TimeoutException: raise BrowserError('Failed to load Kindle Cloud Reader.') else: self._login()
python
def _to_reader_home(self): """Navigate to the Cloud Reader library page. Raises: BrowserError: If the KCR homepage could not be loaded. ConnectionError: If there was a connection error. """ # NOTE: Prevents QueryInterface error caused by getting a URL # while switched to an iframe self.switch_to_default_content() self.get(_KindleCloudReaderBrowser._CLOUD_READER_URL) if self.title == u'Problem loading page': raise ConnectionError # Wait for either the login page or the reader to load login_or_reader_loaded = lambda br: ( br.find_elements_by_id('amzn_kcr') or br.find_elements_by_id('KindleLibraryIFrame')) self._wait(5).until(login_or_reader_loaded) try: self._wait(5).until(lambda br: br.title == u'Amazon.com Sign In') except TimeoutException: raise BrowserError('Failed to load Kindle Cloud Reader.') else: self._login()
[ "def", "_to_reader_home", "(", "self", ")", ":", "# NOTE: Prevents QueryInterface error caused by getting a URL", "# while switched to an iframe", "self", ".", "switch_to_default_content", "(", ")", "self", ".", "get", "(", "_KindleCloudReaderBrowser", ".", "_CLOUD_READER_URL", ")", "if", "self", ".", "title", "==", "u'Problem loading page'", ":", "raise", "ConnectionError", "# Wait for either the login page or the reader to load", "login_or_reader_loaded", "=", "lambda", "br", ":", "(", "br", ".", "find_elements_by_id", "(", "'amzn_kcr'", ")", "or", "br", ".", "find_elements_by_id", "(", "'KindleLibraryIFrame'", ")", ")", "self", ".", "_wait", "(", "5", ")", ".", "until", "(", "login_or_reader_loaded", ")", "try", ":", "self", ".", "_wait", "(", "5", ")", ".", "until", "(", "lambda", "br", ":", "br", ".", "title", "==", "u'Amazon.com Sign In'", ")", "except", "TimeoutException", ":", "raise", "BrowserError", "(", "'Failed to load Kindle Cloud Reader.'", ")", "else", ":", "self", ".", "_login", "(", ")" ]
Navigate to the Cloud Reader library page. Raises: BrowserError: If the KCR homepage could not be loaded. ConnectionError: If there was a connection error.
[ "Navigate", "to", "the", "Cloud", "Reader", "library", "page", "." ]
1570f7734a1c68f294648f44088a7ccb09c26241
https://github.com/msuozzo/Lector/blob/1570f7734a1c68f294648f44088a7ccb09c26241/lector/reader.py#L199-L225
train
Navigate to the KCR homepage page.
GiP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fHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(111) + '\062' + chr(2121 - 2066) + chr(0b110111), 64210 - 64202), nzTpIcepk0o8(chr(0b10111 + 0o31) + '\x6f' + '\x32' + '\063' + '\063', 40419 - 40411), nzTpIcepk0o8(chr(0b111 + 0o51) + '\x6f' + chr(50) + chr(48) + chr(0b10111 + 0o32), 63487 - 63479), nzTpIcepk0o8(chr(0b110000) + chr(0b1000101 + 0o52) + chr(0b1011 + 0o54) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\065' + '\065', 0o10), nzTpIcepk0o8(chr(2098 - 2050) + '\x6f' + '\x33' + chr(0b11011 + 0o34) + '\065', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1100000 + 0o17) + chr(0b11011 + 0o26) + chr(0b110010), 48876 - 48868), nzTpIcepk0o8(chr(48) + chr(0b100000 + 0o117) + chr(51) + chr(48) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(7391 - 7280) + chr(801 - 750) + chr(0b110011) + '\x34', 31851 - 31843), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1836 - 1787) + chr(251 - 202) + '\062', 21104 - 21096), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(9545 - 9434) + '\x31' + '\x37' + '\x34', 0b1000), nzTpIcepk0o8(chr(2175 - 2127) + '\157' + chr(0b1001 + 0o51) + chr(0b110010) + chr(0b1100 + 0o52), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\063' + '\061' + chr(89 - 39), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110010) + chr(0b1110 + 0o47) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\x31' + chr(1561 - 1507), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b110100 + 0o73) + '\x34', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(6037 - 5926) + chr(0b100 + 0o57) + chr(0b101110 + 0o10) + chr(49), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b100 + 0o55) + chr(372 - 321) + '\066', ord("\x08")), nzTpIcepk0o8(chr(1632 - 1584) + '\x6f' + chr(49) + chr(1065 - 1017), 47395 - 47387), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1101111) + chr(50) + '\067' + chr(0b110111), 8), nzTpIcepk0o8(chr(48) + chr(0b1011010 + 0o25) + '\066' + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x32' + chr(0b10101 + 0o34) + '\063', 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\064', 8), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b1000110 + 0o51) + chr(1324 - 1273) + chr(54) + '\066', 28042 - 28034), nzTpIcepk0o8(chr(0b100001 + 0o17) + '\157' + chr(1966 - 1916), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b1 + 0o60) + chr(0b110100) + '\x33', ord("\x08")), nzTpIcepk0o8('\060' + chr(5927 - 5816) + chr(0b11110 + 0o24) + chr(0b110000) + chr(2775 - 2722), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + '\x32' + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\061' + chr(1223 - 1170) + chr(1558 - 1507), 0o10), nzTpIcepk0o8('\060' + chr(9483 - 9372) + '\x31' + '\065', 0o10), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(0b101001 + 0o106) + '\061' + '\060' + chr(0b1100 + 0o46), ord("\x08")), nzTpIcepk0o8('\060' + chr(6846 - 6735) + chr(0b11001 + 0o32) + '\061' + '\x34', 29393 - 29385), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(111) + chr(0b110010) + chr(0b10010 + 0o45) + chr(0b110111), 8), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(7881 - 7770) + chr(0b110001) + '\x37' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(5344 - 5233) + chr(0b100011 + 0o16) + chr(0b11111 + 0o21) + chr(2262 - 2212), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + chr(2037 - 1987) + chr(223 - 168), ord("\x08")), nzTpIcepk0o8(chr(1774 - 1726) + chr(111) + chr(0b110010) + '\x37' + '\060', 0o10), nzTpIcepk0o8('\060' + chr(0b101111 + 0o100) + '\x31' + chr(584 - 531) + '\x37', 5504 - 5496), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b10100 + 0o36) + chr(0b110110) + chr(1260 - 1209), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110111) + '\x32', ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(0b1101111) + '\065' + chr(0b111 + 0o51), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x91'), chr(100) + chr(101) + chr(0b1100011) + chr(0b11010 + 0o125) + chr(100) + chr(101))(chr(0b100110 + 0o117) + chr(116) + chr(0b1100110) + chr(45) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def ho5j2KTsImFk(hXMPsSrOQzbh): roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xcc\xec\xe8ON\x95U\xb0\xb3\x15\x18\xf3\xac\xcd{h\x85\x01k\xd0\\\xffa\x98v'), '\x64' + chr(0b1100101) + '\143' + chr(0b1101111) + '\144' + chr(101))('\x75' + chr(116) + '\146' + chr(1049 - 1004) + chr(0b111000)))() roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xf8\xce\xca^Y\x88>\xbc\xbd\r\x0f\xdc'), '\144' + '\145' + '\x63' + chr(4086 - 3975) + '\x64' + chr(0b1100101))(chr(11038 - 10921) + chr(7020 - 6904) + chr(7650 - 7548) + '\055' + chr(0b110011 + 0o5)))(roI3spqORKae(RHBo2LCdlT9a, roI3spqORKae(ES5oEprVxulp(b'\xe0\xd8\xcdtx\xb9U\x96\x99\x0b8\xd3\x98\xf3[V\xbd'), '\x64' + chr(0b1100101) + '\x63' + chr(11840 - 11729) + chr(4996 - 4896) + chr(8105 - 8004))(chr(0b1010100 + 0o41) + '\x74' + chr(102) + '\x2d' + chr(2737 - 2681)))) if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xf0\xd4\xb1O\x7f\xaa3\xa5\xb6\x15\x04\xfe'), chr(1218 - 1118) + chr(847 - 746) + '\143' + chr(0b101101 + 0o102) + chr(100) + '\x65')('\165' + '\x74' + '\x66' + '\x2d' + chr(0b10011 + 0o45))) == roI3spqORKae(ES5oEprVxulp(b'\xef\xe9\xeeYA\x98g\xe4\xb0%\x1d\xf2\xa3\xc2i$\x81?o\xda'), '\x64' + '\145' + chr(0b1100011) + '\157' + chr(6226 - 6126) + '\145')(chr(0b110010 + 0o103) + chr(11099 - 10983) + chr(0b100000 + 0o106) + '\055' + chr(0b111000)): raise Y8CO_HpFZe1H def il3z1LMY9tQb(FpAmlh8fVJXZ): return roI3spqORKae(FpAmlh8fVJXZ, roI3spqORKae(ES5oEprVxulp(b'\xd9\xf2\xef_r\x98f\xa1\xb1/\x12\xe2\xb9\xf3l}\xae7l'), chr(0b1100100) + '\x65' + '\x63' + '\x6f' + chr(0b1100100) + '\x65')('\x75' + '\x74' + '\146' + chr(0b101101) + chr(0b11000 + 0o40)))(roI3spqORKae(ES5oEprVxulp(b'\xde\xf6\xfbUr\x96i\xb6'), chr(1027 - 927) + chr(4833 - 4732) + '\143' + chr(0b1011011 + 0o24) + chr(0b11011 + 0o111) + chr(0b110000 + 0o65))('\x75' + chr(0b1110100) + chr(0b10110 + 0o120) + chr(45) + '\070')) or roI3spqORKae(FpAmlh8fVJXZ, roI3spqORKae(ES5oEprVxulp(b'\xd9\xf2\xef_r\x98f\xa1\xb1/\x12\xe2\xb9\xf3l}\xae7l'), chr(0b1100100) + '\145' + chr(2012 - 1913) + chr(0b1101111) + chr(0b111010 + 0o52) + chr(0b1100101))('\x75' + '\164' + chr(0b1100110) + '\055' + '\070'))(roI3spqORKae(ES5oEprVxulp(b'\xf4\xf2\xef_A\x98F\xad\xbe8\x1d\xe4\xb3\xe5Hv\x903m'), chr(100) + chr(101) + '\x63' + chr(0b1101111) + chr(100) + chr(9462 - 9361))(chr(0b1110101) + '\x74' + chr(0b101111 + 0o67) + chr(45) + chr(0b1 + 0o67))) roI3spqORKae(hXMPsSrOQzbh._wait(nzTpIcepk0o8('\060' + chr(1394 - 1283) + chr(2435 - 2382), 63889 - 63881)), roI3spqORKae(ES5oEprVxulp(b'\xd5\xfd\xf1IO\xa2M\x80\xb3\x0e,\xf8'), chr(0b1000110 + 0o36) + chr(3190 - 3089) + chr(6785 - 6686) + '\x6f' + chr(0b1100100) + '\x65')(chr(117) + chr(116) + chr(0b11110 + 0o110) + '\055' + '\070'))(il3z1LMY9tQb) try: roI3spqORKae(hXMPsSrOQzbh._wait(nzTpIcepk0o8('\060' + '\x6f' + chr(53), 8)), roI3spqORKae(ES5oEprVxulp(b'\xd5\xfd\xf1IO\xa2M\x80\xb3\x0e,\xf8'), chr(0b111 + 0o135) + chr(412 - 311) + chr(4396 - 4297) + chr(111) + chr(0b110010 + 0o62) + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(0b11100 + 0o112) + '\055' + chr(1594 - 1538)))(lambda FpAmlh8fVJXZ: roI3spqORKae(FpAmlh8fVJXZ, roI3spqORKae(ES5oEprVxulp(b'\xf0\xd4\xb1O\x7f\xaa3\xa5\xb6\x15\x04\xfe'), '\144' + chr(8744 - 8643) + '\143' + '\x6f' + chr(0b111110 + 0o46) + chr(0b110010 + 0o63))(chr(0b111111 + 0o66) + chr(0b1110100) + chr(0b1100110) + '\055' + '\070')) == roI3spqORKae(ES5oEprVxulp(b"\xfe\xf6\xe0AB\x93$\xa7\xb3'\\\xc5\xa3\xcb`$\xb80"), '\x64' + chr(0b1100101) + chr(0b1000011 + 0o40) + chr(2076 - 1965) + '\x64' + chr(0b100000 + 0o105))('\165' + chr(4392 - 4276) + chr(0b100111 + 0o77) + '\055' + chr(2629 - 2573))) except sv1GKlcWMilV: raise janelb4d_mNv(roI3spqORKae(ES5oEprVxulp(b'\xf9\xfa\xe8WH\x99*\xb0\xb3j\x10\xf9\xab\xc8.O\x980l\xd3W\xabG\x9am\x16\xe1\xb79h#\xa8\xda\x0bl'), chr(0b1100100) + '\x65' + '\x63' + chr(8491 - 8380) + chr(100) + '\145')(chr(0b1110101) + chr(4100 - 3984) + chr(6061 - 5959) + chr(0b100000 + 0o15) + chr(0b111000))) else: roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xc6\xf7\xb9C{\xc9n\x94\xe5~\x10\xc2'), chr(7936 - 7836) + chr(7659 - 7558) + chr(99) + chr(111) + chr(100) + '\145')(chr(0b1101100 + 0o11) + chr(116) + '\x66' + chr(0b101000 + 0o5) + chr(0b1110 + 0o52)))()
msuozzo/Lector
lector/reader.py
_KindleCloudReaderBrowser._login
def _login(self, max_tries=2): """Logs in to Kindle Cloud Reader. Args: max_tries: The maximum number of login attempts that will be made. Raises: BrowserError: If method called when browser not at a signin URL. LoginError: If login unsuccessful after `max_tries` attempts. """ if not self.current_url.startswith(_KindleCloudReaderBrowser._SIGNIN_URL): raise BrowserError( 'Current url "%s" is not a signin url ("%s")' % (self.current_url, _KindleCloudReaderBrowser._SIGNIN_URL)) email_field_loaded = lambda br: br.find_elements_by_id('ap_email') self._wait().until(email_field_loaded) tries = 0 while tries < max_tries: # Enter the username email_elem = self.find_element_by_id('ap_email') email_elem.clear() email_elem.send_keys(self._uname) # Enter the password pword_elem = self.find_element_by_id('ap_password') pword_elem.clear() pword_elem.send_keys(self._pword) def creds_entered(_): """Returns whether the credentials were properly entered.""" email_ok = email_elem.get_attribute('value') == self._uname pword_ok = pword_elem.get_attribute('value') == self._pword return email_ok and pword_ok kcr_page_loaded = lambda br: br.title == u'Kindle Cloud Reader' try: self._wait(5).until(creds_entered) self.find_element_by_id('signInSubmit-input').click() self._wait(5).until(kcr_page_loaded) except TimeoutException: tries += 1 else: return raise LoginError
python
def _login(self, max_tries=2): """Logs in to Kindle Cloud Reader. Args: max_tries: The maximum number of login attempts that will be made. Raises: BrowserError: If method called when browser not at a signin URL. LoginError: If login unsuccessful after `max_tries` attempts. """ if not self.current_url.startswith(_KindleCloudReaderBrowser._SIGNIN_URL): raise BrowserError( 'Current url "%s" is not a signin url ("%s")' % (self.current_url, _KindleCloudReaderBrowser._SIGNIN_URL)) email_field_loaded = lambda br: br.find_elements_by_id('ap_email') self._wait().until(email_field_loaded) tries = 0 while tries < max_tries: # Enter the username email_elem = self.find_element_by_id('ap_email') email_elem.clear() email_elem.send_keys(self._uname) # Enter the password pword_elem = self.find_element_by_id('ap_password') pword_elem.clear() pword_elem.send_keys(self._pword) def creds_entered(_): """Returns whether the credentials were properly entered.""" email_ok = email_elem.get_attribute('value') == self._uname pword_ok = pword_elem.get_attribute('value') == self._pword return email_ok and pword_ok kcr_page_loaded = lambda br: br.title == u'Kindle Cloud Reader' try: self._wait(5).until(creds_entered) self.find_element_by_id('signInSubmit-input').click() self._wait(5).until(kcr_page_loaded) except TimeoutException: tries += 1 else: return raise LoginError
[ "def", "_login", "(", "self", ",", "max_tries", "=", "2", ")", ":", "if", "not", "self", ".", "current_url", ".", "startswith", "(", "_KindleCloudReaderBrowser", ".", "_SIGNIN_URL", ")", ":", "raise", "BrowserError", "(", "'Current url \"%s\" is not a signin url (\"%s\")'", "%", "(", "self", ".", "current_url", ",", "_KindleCloudReaderBrowser", ".", "_SIGNIN_URL", ")", ")", "email_field_loaded", "=", "lambda", "br", ":", "br", ".", "find_elements_by_id", "(", "'ap_email'", ")", "self", ".", "_wait", "(", ")", ".", "until", "(", "email_field_loaded", ")", "tries", "=", "0", "while", "tries", "<", "max_tries", ":", "# Enter the username", "email_elem", "=", "self", ".", "find_element_by_id", "(", "'ap_email'", ")", "email_elem", ".", "clear", "(", ")", "email_elem", ".", "send_keys", "(", "self", ".", "_uname", ")", "# Enter the password", "pword_elem", "=", "self", ".", "find_element_by_id", "(", "'ap_password'", ")", "pword_elem", ".", "clear", "(", ")", "pword_elem", ".", "send_keys", "(", "self", ".", "_pword", ")", "def", "creds_entered", "(", "_", ")", ":", "\"\"\"Returns whether the credentials were properly entered.\"\"\"", "email_ok", "=", "email_elem", ".", "get_attribute", "(", "'value'", ")", "==", "self", ".", "_uname", "pword_ok", "=", "pword_elem", ".", "get_attribute", "(", "'value'", ")", "==", "self", ".", "_pword", "return", "email_ok", "and", "pword_ok", "kcr_page_loaded", "=", "lambda", "br", ":", "br", ".", "title", "==", "u'Kindle Cloud Reader'", "try", ":", "self", ".", "_wait", "(", "5", ")", ".", "until", "(", "creds_entered", ")", "self", ".", "find_element_by_id", "(", "'signInSubmit-input'", ")", ".", "click", "(", ")", "self", ".", "_wait", "(", "5", ")", ".", "until", "(", "kcr_page_loaded", ")", "except", "TimeoutException", ":", "tries", "+=", "1", "else", ":", "return", "raise", "LoginError" ]
Logs in to Kindle Cloud Reader. Args: max_tries: The maximum number of login attempts that will be made. Raises: BrowserError: If method called when browser not at a signin URL. LoginError: If login unsuccessful after `max_tries` attempts.
[ "Logs", "in", "to", "Kindle", "Cloud", "Reader", "." ]
1570f7734a1c68f294648f44088a7ccb09c26241
https://github.com/msuozzo/Lector/blob/1570f7734a1c68f294648f44088a7ccb09c26241/lector/reader.py#L227-L274
train
Logs in to Kindle Cloud Reader.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4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HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1205 - 1157) + chr(111) + chr(0b110010) + chr(50) + '\060', 63189 - 63181), nzTpIcepk0o8('\060' + chr(111) + '\x31' + chr(0b110100) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1010001 + 0o36) + chr(1672 - 1618) + chr(0b110101), 0b1000), nzTpIcepk0o8('\x30' + chr(11955 - 11844) + chr(598 - 543) + '\x35', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\062' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(217 - 169) + chr(0b1100000 + 0o17) + chr(0b10001 + 0o41) + chr(2433 - 2378) + chr(1418 - 1367), 48620 - 48612), nzTpIcepk0o8(chr(1526 - 1478) + chr(0b1101111) + chr(49) + '\066' + chr(1540 - 1486), 0b1000), nzTpIcepk0o8(chr(1792 - 1744) + chr(1570 - 1459) + '\x31' + chr(51) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(1278 - 1230) + chr(0b1101111) + chr(0b100111 + 0o13) + chr(0b110011) + chr(0b10111 + 0o37), 0o10), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(111) + '\x32' + chr(0b110010) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(2103 - 2055) + chr(5944 - 5833) + '\x31' + '\x35' + chr(0b110000), 42082 - 42074), nzTpIcepk0o8('\x30' + chr(111) + '\061' + chr(438 - 390) + chr(50), 0o10), nzTpIcepk0o8(chr(1537 - 1489) + '\157' + chr(1602 - 1553) + chr(1883 - 1834) + '\x30', 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1449 - 1399) + '\066' + chr(1708 - 1658), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b101100 + 0o103) + chr(0b10111 + 0o34) + chr(48), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1104 - 1054) + chr(0b0 + 0o65) + chr(694 - 643), 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\063' + chr(1161 - 1108) + chr(50), 0o10), nzTpIcepk0o8('\x30' + '\157' + '\062' + chr(0b110100) + chr(0b100 + 0o55), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x32' + chr(52) + chr(49), 8), nzTpIcepk0o8(chr(1899 - 1851) + '\x6f' + '\x33' + '\063' + chr(1594 - 1541), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001) + chr(0b110000 + 0o6) + chr(48), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b1000 + 0o51) + '\x30' + chr(482 - 434), 0b1000), nzTpIcepk0o8(chr(0b101001 + 0o7) + '\x6f' + '\061' + chr(0b110011 + 0o4), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\063' + '\x33', 0b1000), nzTpIcepk0o8(chr(913 - 865) + chr(0b1101111) + chr(0b110010) + '\065' + '\x35', 43128 - 43120), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(51) + '\060' + '\x35', 0b1000), nzTpIcepk0o8('\060' + chr(0b1010000 + 0o37) + chr(0b10001 + 0o46), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b0 + 0o62) + '\065' + chr(0b10001 + 0o46), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b11010 + 0o31) + chr(2503 - 2451) + chr(0b110010), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + '\x36' + chr(0b101 + 0o60), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\063' + '\067' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b100101 + 0o20), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(6378 - 6267) + '\065' + '\064', ord("\x08")), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b1001100 + 0o43) + '\061' + chr(0b110101) + '\066', 0b1000), nzTpIcepk0o8('\060' + chr(0b1000011 + 0o54) + '\063' + chr(0b110110) + '\x31', 19433 - 19425), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110010) + chr(0b101011 + 0o7) + '\064', 8), nzTpIcepk0o8('\x30' + '\157' + chr(1761 - 1712) + chr(0b1111 + 0o50), 8), nzTpIcepk0o8(chr(2199 - 2151) + '\157' + '\062' + chr(54) + chr(0b110101), 37882 - 37874), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x31' + '\064' + chr(1807 - 1754), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b100110 + 0o12) + '\x6f' + '\x35' + chr(0b110000), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xbe'), chr(100) + '\x65' + chr(99) + chr(0b1101010 + 0o5) + '\x64' + chr(0b1100101))(chr(0b1110101) + '\x74' + '\x66' + '\055' + chr(0b10111 + 0o41)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def yl8xV4dP94lT(hXMPsSrOQzbh, tk8gkz5gp2z7=nzTpIcepk0o8('\x30' + chr(8265 - 8154) + '\x32', 0o10)): if not roI3spqORKae(hXMPsSrOQzbh.current_url, roI3spqORKae(ES5oEprVxulp(b'\xe3\x13TOd\xc8\x016\xea\xfc'), chr(1846 - 1746) + '\x65' + chr(99) + chr(0b101111 + 0o100) + chr(3063 - 2963) + chr(5222 - 5121))(chr(117) + chr(13238 - 13122) + '\x66' + '\x2d' + chr(56)))(roI3spqORKae(RHBo2LCdlT9a, roI3spqORKae(ES5oEprVxulp(b'\xcf4|z^\xf28\x00\xcb\xc6$'), chr(6790 - 6690) + chr(6898 - 6797) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(101))('\165' + chr(116) + chr(8958 - 8856) + '\x2d' + chr(2612 - 2556)))): raise janelb4d_mNv(roI3spqORKae(ES5oEprVxulp(b"\xd3\x12GOu\xd5\x02\x7f\xeb\xe6\x04bj\x97k\x89\xca\xc8\xd2\xfd\x1e/{;\xcc\xe5t\xc6\x85\x1b\x91c\x0c\x1b\x83o\xb4'\x97@\xe3E\x1c"), chr(100) + chr(0b1010000 + 0o25) + chr(0b1100 + 0o127) + chr(0b1101111) + '\144' + '\145')('\165' + chr(116) + chr(0b111101 + 0o51) + chr(1533 - 1488) + chr(56)) % (roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xf3\x12GOu\xd5\x02\x00\xeb\xe6\x04'), chr(0b100100 + 0o100) + chr(9656 - 9555) + chr(99) + chr(0b1101111) + chr(2938 - 2838) + chr(3284 - 3183))('\165' + chr(0b1110000 + 0o4) + chr(0b1001101 + 0o31) + chr(0b101001 + 0o4) + chr(0b100001 + 0o27))), roI3spqORKae(RHBo2LCdlT9a, roI3spqORKae(ES5oEprVxulp(b'\xcf4|z^\xf28\x00\xcb\xc6$'), chr(0b1100 + 0o130) + chr(0b1111 + 0o126) + chr(99) + '\157' + chr(5362 - 5262) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(0b101101) + '\x38')))) def Uq0F3eKcYlm8(FpAmlh8fVJXZ): return roI3spqORKae(FpAmlh8fVJXZ, roI3spqORKae(ES5oEprVxulp(b'\xf6\x0e[YO\xde\x1a:\xf3\xf1\x066;\xedz\xd2\xb5\xc8\xc5'), chr(7302 - 7202) + '\x65' + chr(99) + chr(1677 - 1566) + '\x64' + '\x65')('\165' + chr(0b1110100) + '\146' + '\055' + chr(588 - 532)))(roI3spqORKae(ES5oEprVxulp(b'\xf1\x17jX}\xda\x1f3'), '\144' + chr(0b1100101) + chr(0b1100011) + '\157' + '\144' + '\145')(chr(11562 - 11445) + '\x74' + '\146' + chr(1702 - 1657) + chr(420 - 364))) roI3spqORKae(hXMPsSrOQzbh._wait(), roI3spqORKae(ES5oEprVxulp(b'\xfa\x01EOr\xe41\x1b\xf1\xd08,'), chr(0b1011000 + 0o14) + chr(0b1110 + 0o127) + '\x63' + chr(9120 - 9009) + chr(0b1000100 + 0o40) + '\x65')(chr(10098 - 9981) + '\x74' + chr(0b1100110) + '\055' + chr(0b1010 + 0o56)))(Uq0F3eKcYlm8) dCumt7Sy5nIF = nzTpIcepk0o8(chr(1321 - 1273) + '\157' + chr(1463 - 1415), 0o10) while dCumt7Sy5nIF < tk8gkz5gp2z7: Skin2Sp0P3YM = hXMPsSrOQzbh.find_element_by_id(roI3spqORKae(ES5oEprVxulp(b'\xf1\x17jX}\xda\x1f3'), '\x64' + chr(101) + '\x63' + chr(0b10011 + 0o134) + chr(0b1000101 + 0o37) + chr(101))(chr(117) + '\x74' + chr(0b101111 + 0o67) + chr(0b101101) + chr(56))) roI3spqORKae(Skin2Sp0P3YM, roI3spqORKae(ES5oEprVxulp(b'\xfb\x04\x7f\x0fy\xf1?m\xff\xa1 \x08'), chr(100) + '\x65' + chr(3067 - 2968) + chr(111) + chr(467 - 367) + chr(0b1100101))('\165' + '\x74' + chr(8402 - 8300) + chr(858 - 813) + chr(0b11001 + 0o37)))() roI3spqORKae(Skin2Sp0P3YM, roI3spqORKae(ES5oEprVxulp(b'\xe3\x02[YO\xd0\x13&\xed'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + '\144' + chr(101))(chr(0b1010011 + 0o42) + chr(2664 - 2548) + chr(0b1001000 + 0o36) + chr(373 - 328) + '\070'))(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xcf\x12[\\}\xde'), '\x64' + '\145' + '\143' + chr(111) + chr(0b1100100) + chr(0b1100101))('\165' + '\x74' + '\x66' + '\x2d' + chr(56)))) ifXtW8f6VrPR = hXMPsSrOQzbh.find_element_by_id(roI3spqORKae(ES5oEprVxulp(b'\xf1\x17jMq\xc8\x05(\xf1\xe6\x0c'), chr(100) + '\x65' + chr(1542 - 1443) + chr(3288 - 3177) + chr(0b1100100) + chr(0b1100011 + 0o2))(chr(0b1110 + 0o147) + '\164' + '\146' + '\055' + '\x38')) roI3spqORKae(ifXtW8f6VrPR, roI3spqORKae(ES5oEprVxulp(b'\xfb\x04\x7f\x0fy\xf1?m\xff\xa1 \x08'), chr(0b1100100) + chr(0b1011110 + 0o7) + '\x63' + '\x6f' + chr(100) + chr(0b1100101))('\x75' + chr(116) + chr(1405 - 1303) + chr(45) + '\x38'))() roI3spqORKae(ifXtW8f6VrPR, roI3spqORKae(ES5oEprVxulp(b'\xe3\x02[YO\xd0\x13&\xed'), '\x64' + chr(0b1100101) + chr(99) + chr(111) + '\x64' + chr(0b1100101))('\x75' + chr(10054 - 9938) + chr(0b110011 + 0o63) + '\x2d' + '\070'))(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xcf\x17BRb\xdf'), chr(100) + chr(0b1100101) + '\x63' + chr(111) + chr(0b101110 + 0o66) + chr(4334 - 4233))(chr(7641 - 7524) + chr(9721 - 9605) + chr(0b1101 + 0o131) + '\055' + chr(0b111000)))) def gT4q4rPjdtub(zIqcgNgQ9U6F): s9bnF9N_Fa6p = Skin2Sp0P3YM.get_attribute(roI3spqORKae(ES5oEprVxulp(b'\xe6\x06YHu'), chr(0b1001101 + 0o27) + chr(0b10101 + 0o120) + chr(0b1100011) + chr(111) + '\144' + '\x65')('\165' + chr(0b1111 + 0o145) + chr(0b1100110) + chr(0b11011 + 0o22) + chr(0b111000))) == hXMPsSrOQzbh._uname ZSxkb3BydQ7a = ifXtW8f6VrPR.get_attribute(roI3spqORKae(ES5oEprVxulp(b'\xe6\x06YHu'), '\x64' + chr(0b100110 + 0o77) + chr(99) + '\x6f' + '\x64' + chr(101))(chr(10849 - 10732) + chr(0b1110100) + chr(2412 - 2310) + '\055' + '\070')) == hXMPsSrOQzbh._pword return s9bnF9N_Fa6p and ZSxkb3BydQ7a def qqkzOasrjvIO(FpAmlh8fVJXZ): return roI3spqORKae(FpAmlh8fVJXZ, roI3spqORKae(ES5oEprVxulp(b'\xdf(\x05IB\xecO>\xf4\xcb\x10*'), chr(0b101001 + 0o73) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(100) + '\145')(chr(4093 - 3976) + chr(0b1110100) + chr(0b10 + 0o144) + chr(45) + chr(56))) == roI3spqORKae(ES5oEprVxulp(b'\xdb\x0e[Y|\xdeV\x1c\xf2\xfb\x1d&h\xe0}\xca\x8e\xc4\xd3'), '\144' + chr(0b10011 + 0o122) + chr(0b1001 + 0o132) + '\157' + chr(0b1100100) + chr(0b110001 + 0o64))(chr(0b1 + 0o164) + chr(0b1110100) + '\146' + chr(283 - 238) + chr(2310 - 2254)) try: roI3spqORKae(hXMPsSrOQzbh._wait(nzTpIcepk0o8('\060' + '\x6f' + chr(0b1111 + 0o46), 0b1000)), roI3spqORKae(ES5oEprVxulp(b'\xfa\x01EOr\xe41\x1b\xf1\xd08,'), chr(100) + '\x65' + '\x63' + chr(111) + chr(0b1100100) + chr(0b10010 + 0o123))(chr(117) + chr(2793 - 2677) + chr(102) + chr(45) + chr(0b111000)))(gT4q4rPjdtub) roI3spqORKae(hXMPsSrOQzbh.find_element_by_id(roI3spqORKae(ES5oEprVxulp(b'\xe3\x0eRSY\xd5%*\xfc\xf9\x016e\xdbv\xdb\x9f\xd5'), '\144' + '\x65' + chr(0b1100011) + '\x6f' + chr(1600 - 1500) + chr(0b1100101))(chr(0b1110101) + chr(9651 - 9535) + chr(3209 - 3107) + chr(0b101101) + chr(56))), roI3spqORKae(ES5oEprVxulp(b'\xf3\x0b\\^{'), chr(0b1100100) + chr(0b1010111 + 0o16) + chr(0b1101 + 0o126) + chr(0b1001010 + 0o45) + chr(0b1100100) + chr(0b1011000 + 0o15))(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(0b10111 + 0o26) + '\x38'))() roI3spqORKae(hXMPsSrOQzbh._wait(nzTpIcepk0o8(chr(48) + chr(111) + chr(53), 8)), roI3spqORKae(ES5oEprVxulp(b'\xfa\x01EOr\xe41\x1b\xf1\xd08,'), chr(0b1100100) + chr(101) + chr(1669 - 1570) + chr(0b11001 + 0o126) + '\x64' + chr(101))(chr(117) + '\x74' + chr(4847 - 4745) + chr(0b101101) + chr(0b111000)))(qqkzOasrjvIO) except sv1GKlcWMilV: dCumt7Sy5nIF += nzTpIcepk0o8('\060' + chr(111) + chr(0b110001), 46305 - 46297) else: return raise H4G5yT11fyLT
msuozzo/Lector
lector/reader.py
_KindleCloudReaderBrowser._to_reader_frame
def _to_reader_frame(self): """Navigate to the KindleReader iframe.""" reader_frame = 'KindleReaderIFrame' frame_loaded = lambda br: br.find_elements_by_id(reader_frame) self._wait().until(frame_loaded) self.switch_to.frame(reader_frame) # pylint: disable=no-member reader_loaded = lambda br: br.find_elements_by_id('kindleReader_header') self._wait().until(reader_loaded)
python
def _to_reader_frame(self): """Navigate to the KindleReader iframe.""" reader_frame = 'KindleReaderIFrame' frame_loaded = lambda br: br.find_elements_by_id(reader_frame) self._wait().until(frame_loaded) self.switch_to.frame(reader_frame) # pylint: disable=no-member reader_loaded = lambda br: br.find_elements_by_id('kindleReader_header') self._wait().until(reader_loaded)
[ "def", "_to_reader_frame", "(", "self", ")", ":", "reader_frame", "=", "'KindleReaderIFrame'", "frame_loaded", "=", "lambda", "br", ":", "br", ".", "find_elements_by_id", "(", "reader_frame", ")", "self", ".", "_wait", "(", ")", ".", "until", "(", "frame_loaded", ")", "self", ".", "switch_to", ".", "frame", "(", "reader_frame", ")", "# pylint: disable=no-member", "reader_loaded", "=", "lambda", "br", ":", "br", ".", "find_elements_by_id", "(", "'kindleReader_header'", ")", "self", ".", "_wait", "(", ")", ".", "until", "(", "reader_loaded", ")" ]
Navigate to the KindleReader iframe.
[ "Navigate", "to", "the", "KindleReader", "iframe", "." ]
1570f7734a1c68f294648f44088a7ccb09c26241
https://github.com/msuozzo/Lector/blob/1570f7734a1c68f294648f44088a7ccb09c26241/lector/reader.py#L276-L286
train
Navigate to the KindleReader iframe.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMB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,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(335 - 287) + chr(0b1101111) + chr(812 - 761) + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001) + chr(1392 - 1339) + '\063', 0o10), nzTpIcepk0o8('\060' + chr(5333 - 5222) + '\061' + chr(0b110001) + chr(1687 - 1632), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(51) + chr(0b101 + 0o57) + '\x34', 0b1000), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(0b1101111) + chr(0b101100 + 0o5) + '\x31' + chr(0b100100 + 0o23), 8), nzTpIcepk0o8('\x30' + chr(0b10 + 0o155) + chr(51) + chr(0b110110 + 0o0) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110001) + chr(53) + chr(0b11111 + 0o27), 0b1000), nzTpIcepk0o8(chr(2290 - 2242) + chr(0b1011001 + 0o26) + chr(0b100100 + 0o16) + chr(2310 - 2260) + chr(0b110000), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + chr(50) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(2245 - 2197) + chr(111) + chr(0b110011) + '\061' + chr(2945 - 2890), 0o10), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(0b1101111) + '\x33' + '\x30' + chr(0b110001), 54246 - 54238), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1448 - 1397) + '\061', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(2148 - 2093) + chr(0b10101 + 0o36), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101001 + 0o6) + '\x32' + chr(49) + chr(49), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110010) + chr(2573 - 2519) + chr(0b110011), 0b1000), nzTpIcepk0o8('\060' + '\157' + '\062' + '\064' + '\x30', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x31' + chr(0b110101), 57957 - 57949), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(0b1101111) + chr(0b100110 + 0o13) + chr(1068 - 1016) + chr(0b1111 + 0o43), 12671 - 12663), nzTpIcepk0o8(chr(0b110000) + chr(3493 - 3382) + chr(0b1100 + 0o45) + '\061', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\x31' + chr(51) + '\065', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001) + '\x30' + '\064', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\x31' + chr(54) + '\063', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\x33' + chr(54) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(1240 - 1192) + '\x6f' + chr(1577 - 1528) + '\067' + chr(0b110000), 54434 - 54426), nzTpIcepk0o8(chr(2105 - 2057) + chr(0b1101111) + chr(49) + chr(0b101010 + 0o11), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b10011 + 0o37) + '\062' + chr(51), 47566 - 47558), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(111) + chr(984 - 933) + chr(51) + '\062', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110010) + chr(0b11111 + 0o23) + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b101000 + 0o10) + '\x6f' + '\x31' + '\x30' + chr(49), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\x32' + chr(2222 - 2174) + chr(1084 - 1034), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b111100 + 0o63) + '\x32' + chr(0b1110 + 0o45) + '\x30', 14777 - 14769), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\061' + '\x36' + chr(0b100101 + 0o15), 0o10), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(111) + chr(49) + '\x35' + chr(1603 - 1550), 22817 - 22809), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + '\x33' + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(0b1101111) + '\x33' + '\067' + chr(0b11001 + 0o35), ord("\x08")), nzTpIcepk0o8(chr(0b10111 + 0o31) + '\x6f' + chr(1911 - 1862) + '\063', 8), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(0b1010000 + 0o37) + '\x33' + chr(0b110111) + '\x36', 8), nzTpIcepk0o8('\x30' + chr(0b1101 + 0o142) + chr(0b110010) + chr(0b11100 + 0o31) + chr(0b1010 + 0o47), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b1010 + 0o51), 0b1000), nzTpIcepk0o8(chr(897 - 849) + chr(0b101100 + 0o103) + chr(0b110010) + chr(465 - 413) + chr(0b0 + 0o64), 39204 - 39196)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + '\x6f' + chr(0b1111 + 0o46) + chr(0b110000), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'1'), '\x64' + chr(0b1100101) + '\x63' + chr(111) + '\x64' + chr(0b1100101))(chr(117) + chr(116) + '\146' + chr(245 - 200) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def oErcBeUn29Iz(hXMPsSrOQzbh): qpBq5Dp81j7g = roI3spqORKae(ES5oEprVxulp(b'T\x02!\x80#\x95<\xf50\xab\xa4kr\xcf\xc1\xc1`\x07'), chr(942 - 842) + chr(101) + '\143' + '\x6f' + chr(100) + chr(101))(chr(9552 - 9435) + '\x74' + chr(0b111100 + 0o52) + chr(0b10110 + 0o27) + '\070') def KoJ4GsMUUh5s(FpAmlh8fVJXZ): return roI3spqORKae(FpAmlh8fVJXZ, roI3spqORKae(ES5oEprVxulp(b'y\x02!\x80\x10\x95\x02\xf5<\xaa\xafmH\xd6\xd1\xd9R\x0bm'), '\144' + chr(564 - 463) + chr(6091 - 5992) + '\157' + chr(0b110100 + 0o60) + chr(101))('\x75' + chr(0b101000 + 0o114) + chr(0b1000110 + 0o40) + '\x2d' + '\070'))(qpBq5Dp81j7g) roI3spqORKae(hXMPsSrOQzbh._wait(), roI3spqORKae(ES5oEprVxulp(b'u\r?\x96-\xaf)\xd4>\x8b\x91w'), '\144' + '\145' + chr(0b1100011) + chr(9626 - 9515) + '\144' + '\145')(chr(2579 - 2462) + chr(0b1110000 + 0o4) + '\x66' + '\055' + chr(0b1010 + 0o56)))(KoJ4GsMUUh5s) roI3spqORKae(hXMPsSrOQzbh.switch_to, roI3spqORKae(ES5oEprVxulp(b'T1{\x818\xc2\x1f\xe3`\x87\x95V'), '\144' + '\x65' + chr(0b1100011) + '\157' + chr(100) + '\x65')(chr(2557 - 2440) + '\x74' + chr(0b10000 + 0o126) + chr(0b100111 + 0o6) + chr(0b111000)))(qpBq5Dp81j7g) def q4QxC8tTvKfZ(FpAmlh8fVJXZ): return roI3spqORKae(FpAmlh8fVJXZ, roI3spqORKae(ES5oEprVxulp(b'y\x02!\x80\x10\x95\x02\xf5<\xaa\xafmH\xd6\xd1\xd9R\x0bm'), '\144' + '\x65' + chr(0b110110 + 0o55) + chr(111) + '\x64' + chr(2637 - 2536))(chr(0b1110101) + '\x74' + chr(0b1100110) + '\055' + chr(343 - 287)))(roI3spqORKae(ES5oEprVxulp(b't\x02!\x80#\x95<\xf50\xab\xa4kd\xe1\xd6\xc1i\x07{'), chr(100) + '\145' + '\x63' + '\x6f' + chr(4902 - 4802) + chr(0b110 + 0o137))(chr(0b1110101) + '\164' + chr(0b1011011 + 0o13) + chr(0b100110 + 0o7) + chr(0b111000))) roI3spqORKae(hXMPsSrOQzbh._wait(), roI3spqORKae(ES5oEprVxulp(b'u\r?\x96-\xaf)\xd4>\x8b\x91w'), chr(0b1100100) + '\145' + chr(99) + chr(0b1101111) + chr(593 - 493) + chr(0b1100100 + 0o1))('\165' + '\x74' + '\146' + '\x2d' + '\070'))(q4QxC8tTvKfZ)
msuozzo/Lector
lector/reader.py
KindleCloudReaderAPI._get_api_call
def _get_api_call(self, function_name, *args): """Runs an api call with javascript-formatted arguments. Args: function_name: The name of the KindleAPI call to run. *args: Javascript-formatted arguments to pass to the API call. Returns: The result of the API call. Raises: APIError: If the API call fails or times out. """ api_call = dedent(""" var done = arguments[0]; KindleAPI.%(api_call)s(%(args)s).always(function(a) { done(a); }); """) % { 'api_call': function_name, 'args': ', '.join(args) } script = '\n'.join((api.API_SCRIPT, api_call)) try: return self._browser.execute_async_script(script) except TimeoutException: # FIXME: KCR will occassionally not load library and fall over raise APIError
python
def _get_api_call(self, function_name, *args): """Runs an api call with javascript-formatted arguments. Args: function_name: The name of the KindleAPI call to run. *args: Javascript-formatted arguments to pass to the API call. Returns: The result of the API call. Raises: APIError: If the API call fails or times out. """ api_call = dedent(""" var done = arguments[0]; KindleAPI.%(api_call)s(%(args)s).always(function(a) { done(a); }); """) % { 'api_call': function_name, 'args': ', '.join(args) } script = '\n'.join((api.API_SCRIPT, api_call)) try: return self._browser.execute_async_script(script) except TimeoutException: # FIXME: KCR will occassionally not load library and fall over raise APIError
[ "def", "_get_api_call", "(", "self", ",", "function_name", ",", "*", "args", ")", ":", "api_call", "=", "dedent", "(", "\"\"\"\n var done = arguments[0];\n KindleAPI.%(api_call)s(%(args)s).always(function(a) {\n done(a);\n });\n \"\"\"", ")", "%", "{", "'api_call'", ":", "function_name", ",", "'args'", ":", "', '", ".", "join", "(", "args", ")", "}", "script", "=", "'\\n'", ".", "join", "(", "(", "api", ".", "API_SCRIPT", ",", "api_call", ")", ")", "try", ":", "return", "self", ".", "_browser", ".", "execute_async_script", "(", "script", ")", "except", "TimeoutException", ":", "# FIXME: KCR will occassionally not load library and fall over", "raise", "APIError" ]
Runs an api call with javascript-formatted arguments. Args: function_name: The name of the KindleAPI call to run. *args: Javascript-formatted arguments to pass to the API call. Returns: The result of the API call. Raises: APIError: If the API call fails or times out.
[ "Runs", "an", "api", "call", "with", "javascript", "-", "formatted", "arguments", "." ]
1570f7734a1c68f294648f44088a7ccb09c26241
https://github.com/msuozzo/Lector/blob/1570f7734a1c68f294648f44088a7ccb09c26241/lector/reader.py#L328-L355
train
Runs an API call with javascript - formatted arguments.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,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8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1227 - 1179) + chr(0b1101111) + chr(51) + chr(0b110001) + '\x35', 30525 - 30517), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x33' + chr(55) + '\064', 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(51) + chr(49) + chr(0b11110 + 0o25), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b10001 + 0o136) + chr(0b11111 + 0o23) + chr(48) + '\067', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b11101 + 0o122) + '\x31' + chr(0b110110) + chr(0b101010 + 0o13), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(0b110100) + chr(1542 - 1487), 24800 - 24792), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\x6f' + chr(0b1000 + 0o51) + '\x36' + chr(1845 - 1795), 0o10), nzTpIcepk0o8(chr(1851 - 1803) + chr(0b100101 + 0o112) + '\064', 62990 - 62982), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(0b1011111 + 0o20) + '\062' + chr(48) + '\x33', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\063' + chr(49) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(614 - 566) + chr(111) + chr(51) + chr(0b110000), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(50) + '\x32' + '\066', 0b1000), nzTpIcepk0o8(chr(1316 - 1268) + '\x6f' + '\062', 0b1000), nzTpIcepk0o8(chr(2044 - 1996) + '\157' + chr(0b110001) + chr(0b1101 + 0o44), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(2416 - 2366) + chr(482 - 427) + chr(2206 - 2152), ord("\x08")), nzTpIcepk0o8('\060' + chr(6185 - 6074) + chr(51) + chr(0b101010 + 0o10) + chr(0b110111), 1185 - 1177), nzTpIcepk0o8(chr(2286 - 2238) + chr(6406 - 6295) + chr(401 - 347) + chr(0b100110 + 0o12), 0b1000), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(111) + '\x36' + chr(0b110110), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b1110 + 0o44) + chr(0b110101) + '\x33', 0o10), nzTpIcepk0o8('\x30' + chr(0b1100101 + 0o12) + '\066' + chr(48), 8), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110011) + '\x31' + chr(49), 8733 - 8725), nzTpIcepk0o8(chr(0b101101 + 0o3) + '\x6f' + chr(2466 - 2414) + chr(53), 59919 - 59911), nzTpIcepk0o8('\060' + chr(0b11100 + 0o123) + '\063' + '\x37' + chr(0b110101 + 0o2), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110011) + '\x36' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b1111 + 0o41) + '\x6f' + '\x33' + '\x36' + '\061', 0b1000), nzTpIcepk0o8(chr(1670 - 1622) + chr(111) + chr(52) + chr(48), 62883 - 62875), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(51) + '\066' + chr(1441 - 1388), 12852 - 12844), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + '\x33' + '\x33', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + chr(1780 - 1727) + chr(343 - 293), ord("\x08")), nzTpIcepk0o8('\060' + chr(9449 - 9338) + chr(0b110010) + chr(50), 0b1000), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(2818 - 2707) + chr(0b101010 + 0o7) + chr(0b11010 + 0o34) + '\x31', 0b1000), nzTpIcepk0o8('\x30' + chr(398 - 287) + '\063' + chr(50), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\061' + '\x34' + '\x34', 9465 - 9457), nzTpIcepk0o8('\x30' + chr(0b101011 + 0o104) + chr(50) + '\067' + chr(440 - 392), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\061' + chr(0b110101) + '\x32', 1137 - 1129), nzTpIcepk0o8('\060' + '\x6f' + chr(2237 - 2187) + '\x31' + chr(0b110010), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + '\x34' + chr(0b101011 + 0o11), 8), nzTpIcepk0o8(chr(1100 - 1052) + chr(0b1101111) + chr(901 - 852) + '\x37' + chr(1431 - 1376), 40091 - 40083), nzTpIcepk0o8('\060' + chr(5654 - 5543) + chr(51) + chr(55) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(9975 - 9864) + chr(0b10011 + 0o40) + '\x36' + chr(608 - 557), 32475 - 32467)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(569 - 516) + '\060', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xe3'), '\x64' + chr(0b1100101) + '\x63' + '\x6f' + chr(0b10100 + 0o120) + '\145')(chr(0b10110 + 0o137) + chr(0b1011101 + 0o27) + chr(102) + chr(0b10110 + 0o27) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def oDjTmjpnK3Cm(hXMPsSrOQzbh, fnoSXMFnhelI, *eemPYp2vtTSr): Dg7wlXyN9voQ = kiEosB74wGZN(roI3spqORKae(ES5oEprVxulp(b'\xc7\xdc\xeb\xa7U\x87R$\xa3\xbcy\xe4"m\xd1\xb9U\x16\x96\x10\xa8W\x98\x87\x9cE\x9b\xef\xd9IAG_\xb2J\xaaD_\xda\xd3\xed\xdc\x80\xee\x1b\xc3\x1ea\xc2\x9aQ\xb8\'!\xdf\xa7Yi\xc8Q\xa5I\xd6\x81\xd9\x05\xdd\xfa\xd8u\x023\x17\x91D\xeb\x08\x08\x9b\x8a\xbe\xd4\xad\xf2\x1b\xc4\x06m\xec\xa40\xf7+)\xc5\xdd\x10\x16\x8b\x10\xe9\x05\xdf\xd2\xd1\x00\xd5\xbb\xce}\x1f\x7fL\xd9C\xb1n_\xda\xd3\xed\xdc\xeb\xa7U\xda[?\x89\xea8\xb6"'), chr(100) + chr(101) + chr(0b1100011) + chr(111) + '\144' + chr(2798 - 2697))('\165' + chr(0b1110100) + chr(0b111000 + 0o56) + chr(0b101101) + chr(0b111000))) % {roI3spqORKae(ES5oEprVxulp(b'\xac\x8c\xa2\xd8\x16\xc6\x1eh'), '\144' + chr(7610 - 7509) + chr(0b1100011) + chr(0b1000111 + 0o50) + '\x64' + chr(101))(chr(0b111101 + 0o70) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b1000 + 0o60)): fnoSXMFnhelI, roI3spqORKae(ES5oEprVxulp(b'\xac\x8e\xac\xf4'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(101))('\165' + chr(1466 - 1350) + chr(0b1100110) + '\x2d' + chr(56)): roI3spqORKae(ES5oEprVxulp(b'\xe1\xdc'), chr(100) + '\145' + chr(0b1001 + 0o132) + '\x6f' + '\144' + chr(101))(chr(117) + chr(0b1110100) + chr(102) + chr(0b101100 + 0o1) + '\x38').Y4yM9BcfTCNq(eemPYp2vtTSr)} I3kYRJy89vKS = roI3spqORKae(ES5oEprVxulp(b'\xc7'), chr(0b1100100) + '\x65' + chr(8822 - 8723) + '\157' + chr(0b1100100) + '\x65')(chr(0b1101101 + 0o10) + chr(116) + '\x66' + chr(45) + chr(0b111000)).Y4yM9BcfTCNq((Zy5jC95Ko39c.API_SCRIPT, Dg7wlXyN9voQ)) try: return roI3spqORKae(hXMPsSrOQzbh._browser, roI3spqORKae(ES5oEprVxulp(b'\xa8\x84\xae\xe4\x00\xd3\x17[\xe2\xb9a\xf8aV\xcd\xb4B_\xdbD'), chr(100) + chr(842 - 741) + '\x63' + '\157' + '\x64' + '\x65')('\x75' + chr(0b1110100) + '\146' + chr(1578 - 1533) + chr(578 - 522)))(I3kYRJy89vKS) except sv1GKlcWMilV: raise YQyr6R04Y5gz
msuozzo/Lector
lector/reader.py
KindleCloudReaderAPI.get_book_metadata
def get_book_metadata(self, asin): """Returns a book's metadata. Args: asin: The ASIN of the book to be queried. Returns: A `KindleBook` instance corresponding to the book associated with `asin`. """ kbm = self._get_api_call('get_book_metadata', '"%s"' % asin) return KindleCloudReaderAPI._kbm_to_book(kbm)
python
def get_book_metadata(self, asin): """Returns a book's metadata. Args: asin: The ASIN of the book to be queried. Returns: A `KindleBook` instance corresponding to the book associated with `asin`. """ kbm = self._get_api_call('get_book_metadata', '"%s"' % asin) return KindleCloudReaderAPI._kbm_to_book(kbm)
[ "def", "get_book_metadata", "(", "self", ",", "asin", ")", ":", "kbm", "=", "self", ".", "_get_api_call", "(", "'get_book_metadata'", ",", "'\"%s\"'", "%", "asin", ")", "return", "KindleCloudReaderAPI", ".", "_kbm_to_book", "(", "kbm", ")" ]
Returns a book's metadata. Args: asin: The ASIN of the book to be queried. Returns: A `KindleBook` instance corresponding to the book associated with `asin`.
[ "Returns", "a", "book", "s", "metadata", "." ]
1570f7734a1c68f294648f44088a7ccb09c26241
https://github.com/msuozzo/Lector/blob/1570f7734a1c68f294648f44088a7ccb09c26241/lector/reader.py#L387-L398
train
Returns a book s metadata.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h6aCn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JL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b111101 + 0o62) + chr(87 - 37) + chr(0b110101) + chr(2398 - 2345), ord("\x08")), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(111) + chr(0b110010) + chr(531 - 478) + chr(52), 0b1000), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(111) + chr(0b101001 + 0o14) + chr(0b101110 + 0o2), 4793 - 4785), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x32' + chr(2673 - 2618) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110011) + '\x30' + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(48) + chr(11074 - 10963) + chr(0b110011) + chr(0b100101 + 0o17) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(487 - 439) + chr(1545 - 1434) + chr(0b101001 + 0o12) + chr(1652 - 1604) + chr(52), 8), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(111) + chr(51) + chr(0b110111) + '\x34', 0o10), nzTpIcepk0o8('\060' + chr(9501 - 9390) + '\x32' + '\061' + chr(0b11111 + 0o24), 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\062' + chr(51) + chr(947 - 895), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\061' + '\064' + chr(233 - 179), 0b1000), nzTpIcepk0o8('\x30' + chr(0b11 + 0o154) + '\062' + '\x36' + chr(1690 - 1637), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1934 - 1885) + chr(0b110110) + chr(1653 - 1601), ord("\x08")), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(111) + chr(0b100111 + 0o14) + chr(336 - 288) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(0b1000111 + 0o50) + chr(1667 - 1614), 63461 - 63453), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\063' + '\063' + chr(1623 - 1572), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(0b1101111) + '\x32' + chr(54), ord("\x08")), nzTpIcepk0o8('\x30' + chr(1325 - 1214) + '\061' + '\x34' + '\x35', 0b1000), nzTpIcepk0o8(chr(70 - 22) + '\x6f' + '\x35' + chr(1456 - 1408), 8), nzTpIcepk0o8(chr(0b110000) + chr(749 - 638) + chr(0b110001) + chr(50) + chr(0b1010 + 0o51), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\064' + chr(0b10 + 0o60), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b101011 + 0o6) + chr(1145 - 1092) + chr(1144 - 1090), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(0b110001) + chr(0b100110 + 0o12), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1000010 + 0o55) + chr(0b110001) + chr(0b110001) + chr(54), 0o10), nzTpIcepk0o8('\060' + chr(0b111010 + 0o65) + '\064' + chr(0b1110 + 0o43), 0b1000), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(111) + chr(51), 0b1000), nzTpIcepk0o8(chr(0b101011 + 0o5) + '\x6f' + chr(666 - 617) + chr(0b110011) + chr(52), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(2133 - 2081) + chr(55), 0o10), nzTpIcepk0o8('\x30' + chr(0b1100001 + 0o16) + chr(0b110011) + chr(0b101001 + 0o15) + chr(52), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\061' + chr(54) + '\x36', 0o10), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(111) + chr(1663 - 1613) + chr(0b101101 + 0o7) + chr(0b110101 + 0o1), 0b1000), nzTpIcepk0o8(chr(279 - 231) + '\x6f' + '\063' + chr(0b11100 + 0o25) + chr(0b110000), 58208 - 58200), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1653 - 1600) + '\065', 0b1000), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(111) + chr(2313 - 2264) + chr(0b11001 + 0o33) + chr(2077 - 2029), 0b1000), nzTpIcepk0o8('\060' + chr(1974 - 1863) + '\065' + '\x37', 24071 - 24063), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110010) + '\064', 0b1000), nzTpIcepk0o8('\x30' + chr(0b101110 + 0o101) + chr(326 - 275) + chr(0b10110 + 0o36) + chr(2790 - 2737), 0b1000), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(1456 - 1345) + chr(0b11010 + 0o27) + '\x37' + '\061', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(50) + chr(0b10011 + 0o36) + chr(54), 6253 - 6245)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b1101111) + chr(2223 - 2170) + chr(48), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x83'), chr(9781 - 9681) + chr(101) + chr(99) + chr(0b1101111) + chr(100) + '\145')(chr(8089 - 7972) + chr(2929 - 2813) + '\146' + '\x2d' + chr(0b11101 + 0o33)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def djq3M4qKFEUI(hXMPsSrOQzbh, uDfKcjiHfpr6): ytX5ob2lgiyc = hXMPsSrOQzbh._get_api_call(roI3spqORKae(ES5oEprVxulp(b'\xca\xc9\\\xe2\xa6\x8d\xab\x97\xd4\xf1\x03\xc1\x15\xa6d\xaft'), chr(8371 - 8271) + '\x65' + '\143' + chr(0b1101111) + chr(0b1010110 + 0o16) + chr(2386 - 2285))('\165' + '\x74' + '\x66' + chr(45) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\x8f\x89[\x9f'), chr(0b10110 + 0o116) + chr(0b101110 + 0o67) + chr(0b111100 + 0o47) + chr(0b1100100 + 0o13) + '\x64' + chr(2923 - 2822))(chr(0b1110101) + '\164' + chr(0b1011100 + 0o12) + '\x2d' + chr(0b10010 + 0o46)) % uDfKcjiHfpr6) return roI3spqORKae(RKbF8EHN39tb, roI3spqORKae(ES5oEprVxulp(b'\xf2\xc7J\xd0\x9b\x96\xab\xa3\xe9\xf3\t\xde'), chr(100) + chr(0b101110 + 0o67) + chr(99) + '\157' + chr(0b1100001 + 0o3) + '\145')('\x75' + chr(0b1000010 + 0o62) + chr(102) + chr(45) + chr(2779 - 2723)))(ytX5ob2lgiyc)
msuozzo/Lector
lector/reader.py
KindleCloudReaderAPI.get_book_progress
def get_book_progress(self, asin): """Returns the progress data available for a book. NOTE: A summary of the two progress formats can be found in the docstring for `ReadingProgress`. Args: asin: The asin of the book to be queried. Returns: A `ReadingProgress` instance corresponding to the book associated with `asin`. """ kbp = self._get_api_call('get_book_progress', '"%s"' % asin) return KindleCloudReaderAPI._kbp_to_progress(kbp)
python
def get_book_progress(self, asin): """Returns the progress data available for a book. NOTE: A summary of the two progress formats can be found in the docstring for `ReadingProgress`. Args: asin: The asin of the book to be queried. Returns: A `ReadingProgress` instance corresponding to the book associated with `asin`. """ kbp = self._get_api_call('get_book_progress', '"%s"' % asin) return KindleCloudReaderAPI._kbp_to_progress(kbp)
[ "def", "get_book_progress", "(", "self", ",", "asin", ")", ":", "kbp", "=", "self", ".", "_get_api_call", "(", "'get_book_progress'", ",", "'\"%s\"'", "%", "asin", ")", "return", "KindleCloudReaderAPI", ".", "_kbp_to_progress", "(", "kbp", ")" ]
Returns the progress data available for a book. NOTE: A summary of the two progress formats can be found in the docstring for `ReadingProgress`. Args: asin: The asin of the book to be queried. Returns: A `ReadingProgress` instance corresponding to the book associated with `asin`.
[ "Returns", "the", "progress", "data", "available", "for", "a", "book", "." ]
1570f7734a1c68f294648f44088a7ccb09c26241
https://github.com/msuozzo/Lector/blob/1570f7734a1c68f294648f44088a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i_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b100001 + 0o17) + '\157' + '\062' + '\x30' + '\x37', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b10111 + 0o32) + chr(0b110011) + '\062', ord("\x08")), nzTpIcepk0o8(chr(0b100101 + 0o13) + '\x6f' + chr(49) + '\x30' + chr(1580 - 1532), 20827 - 20819), nzTpIcepk0o8('\x30' + chr(0b1001110 + 0o41) + chr(0b110100) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(794 - 746) + chr(0b1010111 + 0o30) + '\063' + '\x31' + chr(0b101100 + 0o12), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b0 + 0o157) + '\x31' + chr(0b110001 + 0o6) + '\062', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b10000 + 0o45), 0b1000), nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(0b10000 + 0o137) + chr(0b11110 + 0o25) + chr(0b110101), 5430 - 5422), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(2293 - 2182) + chr(50) + chr(313 - 264) + chr(0b110010), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b10 + 0o57) + chr(0b110011) + chr(0b110001 + 0o0), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(2286 - 2231) + chr(53), 0b1000), nzTpIcepk0o8(chr(1058 - 1010) + chr(111) + '\061' + chr(49) + chr(0b110010), 0o10), nzTpIcepk0o8(chr(0b100111 + 0o11) + '\157' + chr(765 - 716) + chr(0b101011 + 0o11) + '\062', 45640 - 45632), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + '\x33' + chr(53), 34124 - 34116), nzTpIcepk0o8(chr(48) + chr(111) + chr(407 - 358) + chr(0b1001 + 0o53) + chr(50), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + chr(841 - 788) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b11111 + 0o21) + '\157' + '\x31' + chr(2275 - 2225) + chr(0b0 + 0o64), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(9945 - 9834) + chr(0b110011) + chr(0b110000) + chr(0b0 + 0o67), 54130 - 54122), nzTpIcepk0o8('\060' + '\157' + chr(51) + '\062' + chr(1945 - 1897), 61001 - 60993), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x31' + chr(49) + chr(1748 - 1695), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(130 - 79) + chr(49) + '\x34', 0o10), nzTpIcepk0o8(chr(48) + chr(8974 - 8863) + chr(0b110001) + '\061' + '\x32', 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(864 - 813) + chr(0b100000 + 0o22), 39793 - 39785), nzTpIcepk0o8('\060' + chr(111) + chr(51) + chr(51) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110010) + '\x37' + '\067', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\063' + '\064' + chr(0b110101), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(0b110111) + '\x31', 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b100001 + 0o20) + chr(52) + '\x33', 5223 - 5215), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(51) + '\064', ord("\x08")), nzTpIcepk0o8(chr(1231 - 1183) + chr(0b11001 + 0o126) + chr(0b101110 + 0o4) + '\x34' + chr(0b1011 + 0o46), ord("\x08")), nzTpIcepk0o8(chr(1866 - 1818) + chr(0b1101111) + '\063' + '\067' + chr(2651 - 2596), 0o10), nzTpIcepk0o8(chr(48) + chr(6878 - 6767) + '\061' + '\x33' + chr(49), 8), nzTpIcepk0o8('\060' + '\157' + chr(0b1111 + 0o44) + '\x31', 0o10), nzTpIcepk0o8('\x30' + chr(11346 - 11235) + chr(0b10100 + 0o37) + chr(1008 - 959), 8), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(757 - 707) + chr(54) + chr(0b11100 + 0o33), 55088 - 55080), nzTpIcepk0o8(chr(0b101111 + 0o1) + '\x6f' + chr(0b101001 + 0o12) + '\060' + chr(0b10000 + 0o42), 0o10), nzTpIcepk0o8('\x30' + chr(4585 - 4474) + '\063' + '\x36' + '\x30', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b101101 + 0o12) + '\062', 0o10), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(111) + chr(0b100001 + 0o20) + chr(0b110 + 0o52) + chr(0b101 + 0o57), ord("\x08")), nzTpIcepk0o8('\060' + chr(4215 - 4104) + chr(61 - 12) + chr(0b110110) + chr(0b110010), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\x6f' + '\065' + chr(0b110000), 38682 - 38674)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xa9'), '\x64' + '\x65' + '\x63' + '\x6f' + chr(0b100110 + 0o76) + chr(8595 - 8494))(chr(0b10 + 0o163) + '\164' + '\146' + '\055' + chr(0b101 + 0o63)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def XJ1dI4amTSQi(hXMPsSrOQzbh, uDfKcjiHfpr6): FIiiVvhbRtaN = hXMPsSrOQzbh._get_api_call(roI3spqORKae(ES5oEprVxulp(b"\xe0?4{\xac\x15jv\xd5)O%\x05\xef\x07\x1d'"), chr(9258 - 9158) + chr(0b111001 + 0o54) + '\143' + chr(0b1001001 + 0o46) + '\144' + chr(8403 - 8302))('\165' + chr(116) + chr(0b11011 + 0o113) + chr(0b101101) + chr(1156 - 1100)), roI3spqORKae(ES5oEprVxulp(b'\xa5\x7f3\x06'), chr(100) + '\x65' + '\x63' + '\157' + chr(0b1100100) + '\145')(chr(117) + chr(0b1000101 + 0o57) + '\146' + chr(0b101101) + chr(56)) % uDfKcjiHfpr6) return roI3spqORKae(RKbF8EHN39tb, roI3spqORKae(ES5oEprVxulp(b'\xd81"T\x91\x0ejB\xfa+R-\x10\xf8\x11\x1d'), '\x64' + chr(101) + chr(0b1100011) + '\157' + chr(0b101010 + 0o72) + chr(0b101 + 0o140))(chr(0b1110101) + chr(0b100010 + 0o122) + chr(0b100100 + 0o102) + chr(442 - 397) + chr(3056 - 3000)))(FIiiVvhbRtaN)
msuozzo/Lector
lector/reader.py
KindleCloudReaderAPI.get_library_progress
def get_library_progress(self): """Returns the reading progress for all books in the kindle library. Returns: A mapping of ASINs to `ReadingProgress` instances corresponding to the books in the current user's library. """ kbp_dict = self._get_api_call('get_library_progress') return {asin: KindleCloudReaderAPI._kbp_to_progress(kbp) for asin, kbp in kbp_dict.iteritems()}
python
def get_library_progress(self): """Returns the reading progress for all books in the kindle library. Returns: A mapping of ASINs to `ReadingProgress` instances corresponding to the books in the current user's library. """ kbp_dict = self._get_api_call('get_library_progress') return {asin: KindleCloudReaderAPI._kbp_to_progress(kbp) for asin, kbp in kbp_dict.iteritems()}
[ "def", "get_library_progress", "(", "self", ")", ":", "kbp_dict", "=", "self", ".", "_get_api_call", "(", "'get_library_progress'", ")", "return", "{", "asin", ":", "KindleCloudReaderAPI", ".", "_kbp_to_progress", "(", "kbp", ")", "for", "asin", ",", "kbp", "in", "kbp_dict", ".", "iteritems", "(", ")", "}" ]
Returns the reading progress for all books in the kindle library. Returns: A mapping of ASINs to `ReadingProgress` instances corresponding to the books in the current user's library.
[ "Returns", "the", "reading", "progress", "for", "all", "books", "in", "the", "kindle", "library", "." ]
1570f7734a1c68f294648f44088a7ccb09c26241
https://github.com/msuozzo/Lector/blob/1570f7734a1c68f294648f44088a7ccb09c26241/lector/reader.py#L426-L435
train
Returns the reading progress for all books in the current user s kindle library.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL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q,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(828 - 780) + '\x6f' + chr(0b11110 + 0o25) + chr(0b1 + 0o65) + chr(51), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110110) + chr(53), 55937 - 55929), nzTpIcepk0o8(chr(48) + chr(4865 - 4754) + chr(0b110111) + '\x33', 0b1000), nzTpIcepk0o8('\060' + chr(8298 - 8187) + chr(0b11010 + 0o31) + '\064' + '\x37', 0o10), nzTpIcepk0o8('\060' + chr(12119 - 12008) + chr(0b110010) + chr(51) + chr(967 - 919), 0b1000), nzTpIcepk0o8(chr(2217 - 2169) + chr(1696 - 1585) + chr(0b110011) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + chr(0b110011) + chr(0b110000) + chr(0b110111), 15665 - 15657), nzTpIcepk0o8(chr(314 - 266) + chr(0b1101111) + chr(0b110001) + chr(0b10010 + 0o42) + chr(0b110101), 17801 - 17793), nzTpIcepk0o8(chr(0b10111 + 0o31) + '\157' + chr(0b100000 + 0o23) + chr(0b101011 + 0o7) + chr(0b10111 + 0o31), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(660 - 549) + '\x31' + '\x31' + chr(1462 - 1410), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b110101) + chr(639 - 585), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(1212 - 1162) + chr(0b101001 + 0o16), ord("\x08")), nzTpIcepk0o8(chr(0b10101 + 0o33) + '\157' + chr(0b11011 + 0o27) + chr(0b100000 + 0o20), 0o10), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(111) + chr(2234 - 2184) + '\064' + chr(0b111 + 0o53), 50960 - 50952), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110010) + chr(0b10011 + 0o36) + chr(1429 - 1381), 0o10), nzTpIcepk0o8('\x30' + chr(0b110110 + 0o71) + chr(50) + '\062' + chr(1429 - 1378), 22685 - 22677), nzTpIcepk0o8('\x30' + '\157' + chr(0b100011 + 0o17) + chr(54) + chr(669 - 614), 64494 - 64486), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + chr(0b110011) + '\064', ord("\x08")), nzTpIcepk0o8('\060' + chr(5263 - 5152) + chr(0b110001 + 0o0) + '\061' + chr(0b110100), 8), nzTpIcepk0o8(chr(0b110000) + '\157' + '\061' + chr(52), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(2424 - 2369) + chr(55), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b10101 + 0o132) + chr(2842 - 2787) + chr(0b110010), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001 + 0o0) + '\x30' + chr(1126 - 1074), 0o10), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(4357 - 4246) + chr(0b11111 + 0o23) + '\066' + chr(0b100 + 0o61), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1010110 + 0o31) + chr(0b101110 + 0o5) + '\x37', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + chr(164 - 115) + chr(2233 - 2179), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x34' + '\062', 0b1000), nzTpIcepk0o8('\x30' + chr(6140 - 6029) + '\x34' + chr(49), 0o10), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(1308 - 1197) + chr(50) + chr(2232 - 2183) + chr(1571 - 1523), 8), nzTpIcepk0o8(chr(213 - 165) + chr(111) + chr(0b110011) + '\x33' + chr(51), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(2337 - 2285), 62130 - 62122), nzTpIcepk0o8('\060' + chr(0b1001111 + 0o40) + '\063' + '\065' + chr(2171 - 2122), 0b1000), nzTpIcepk0o8(chr(1545 - 1497) + chr(111) + '\062' + chr(48) + chr(0b101011 + 0o12), 11028 - 11020), nzTpIcepk0o8('\060' + chr(0b1011001 + 0o26) + '\x31' + chr(49) + chr(2608 - 2556), 8), nzTpIcepk0o8('\060' + chr(1562 - 1451) + chr(2298 - 2248) + chr(331 - 281) + chr(52), 44818 - 44810), nzTpIcepk0o8(chr(693 - 645) + chr(10701 - 10590) + chr(0b100010 + 0o21) + chr(0b110001) + chr(0b110011), 19415 - 19407), nzTpIcepk0o8(chr(48) + chr(111) + chr(51) + chr(0b11001 + 0o27) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(0b100001 + 0o17) + '\157' + chr(980 - 929) + chr(0b0 + 0o65) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b100011 + 0o114) + chr(0b110001) + '\x35' + '\x36', ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(49) + chr(0b110011) + chr(0b10010 + 0o40), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(264 - 153) + '\065' + '\x30', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xdd'), chr(0b110011 + 0o61) + chr(0b1011011 + 0o12) + '\x63' + chr(3193 - 3082) + chr(0b1100100) + '\x65')(chr(6367 - 6250) + chr(116) + '\x66' + chr(0b100011 + 0o12) + chr(0b11111 + 0o31)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Uu8ibjGxoZyq(hXMPsSrOQzbh): mBsAVbjUW1ab = hXMPsSrOQzbh._get_api_call(roI3spqORKae(ES5oEprVxulp(b'\x94PO\xb8\xf4p\xa5\x17\xb1>\xd7H`\xd0\xe7\xf4\xc59?\x7f'), chr(100) + chr(0b11100 + 0o111) + '\143' + '\x6f' + '\144' + '\x65')(chr(13541 - 13424) + chr(116) + '\x66' + chr(0b101011 + 0o2) + '\070')) return {uDfKcjiHfpr6: roI3spqORKae(RKbF8EHN39tb, roI3spqORKae(ES5oEprVxulp(b'\xac^Y\x97\xc7m\xa8:\xa0>\xc1pb\xc7\xfb\xe0'), '\x64' + chr(101) + chr(0b1100011) + chr(0b101100 + 0o103) + chr(0b1100100) + chr(0b1010011 + 0o22))(chr(2605 - 2488) + chr(10329 - 10213) + '\146' + chr(0b1101 + 0o40) + chr(0b111000)))(FIiiVvhbRtaN) for (uDfKcjiHfpr6, FIiiVvhbRtaN) in roI3spqORKae(mBsAVbjUW1ab, roI3spqORKae(ES5oEprVxulp(b'\x87Vh\x8c\xf2z\xb5)\xbb?\xc5&'), chr(100) + chr(101) + chr(0b11110 + 0o105) + chr(111) + chr(468 - 368) + chr(7199 - 7098))('\x75' + '\164' + chr(2943 - 2841) + '\055' + '\070'))()}
msuozzo/Lector
lector/reader.py
KindleCloudReaderAPI.get_instance
def get_instance(*args, **kwargs): """Context manager for an instance of `KindleCloudReaderAPI`.""" inst = KindleCloudReaderAPI(*args, **kwargs) try: yield inst except Exception: raise finally: inst.close()
python
def get_instance(*args, **kwargs): """Context manager for an instance of `KindleCloudReaderAPI`.""" inst = KindleCloudReaderAPI(*args, **kwargs) try: yield inst except Exception: raise finally: inst.close()
[ "def", "get_instance", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "inst", "=", "KindleCloudReaderAPI", "(", "*", "args", ",", "*", "*", "kwargs", ")", "try", ":", "yield", "inst", "except", "Exception", ":", "raise", "finally", ":", "inst", ".", "close", "(", ")" ]
Context manager for an instance of `KindleCloudReaderAPI`.
[ "Context", "manager", "for", "an", "instance", "of", "KindleCloudReaderAPI", "." ]
1570f7734a1c68f294648f44088a7ccb09c26241
https://github.com/msuozzo/Lector/blob/1570f7734a1c68f294648f44088a7ccb09c26241/lector/reader.py#L443-L452
train
Context manager for an instance of KindleCloudReaderAPI.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0D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HWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(549 - 501) + chr(0b1101111) + chr(1135 - 1084) + chr(0b100 + 0o55) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(978 - 867) + '\x31' + '\x37', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b110010 + 0o75) + chr(667 - 616) + '\x34' + '\x31', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1010110 + 0o31) + chr(51) + chr(0b110100) + '\x31', 8), nzTpIcepk0o8('\060' + '\157' + chr(522 - 472) + '\060' + chr(52), 0b1000), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b110011 + 0o74) + chr(1604 - 1554) + chr(53) + '\060', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110 + 0o54) + '\062' + chr(0b110001), 41280 - 41272), nzTpIcepk0o8(chr(0b110000) + '\157' + '\061' + '\061' + '\062', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1100011 + 0o14) + chr(0b110011) + '\063' + '\067', ord("\x08")), nzTpIcepk0o8(chr(808 - 760) + chr(0b111011 + 0o64) + '\x37' + chr(0b111 + 0o51), 33640 - 33632), nzTpIcepk0o8(chr(48) + '\157' + '\063' + '\x34' + chr(0b110100), 0o10), nzTpIcepk0o8(chr(2105 - 2057) + '\157' + '\062' + chr(0b110110) + chr(0b100000 + 0o22), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b1011 + 0o50) + chr(2299 - 2245) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(366 - 318) + chr(0b1011011 + 0o24) + chr(0b110111), 13717 - 13709), nzTpIcepk0o8(chr(48) + '\x6f' + chr(51) + chr(0b110100) + chr(2504 - 2449), 44418 - 44410), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(52) + chr(0b1101 + 0o52), 8), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + chr(0b110010) + chr(0b110100), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b111001 + 0o66) + '\063' + '\x32' + '\x36', ord("\x08")), nzTpIcepk0o8('\x30' + chr(6024 - 5913) + '\065' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\062' + chr(0b110 + 0o56) + chr(49), 242 - 234), nzTpIcepk0o8('\x30' + chr(0b1010001 + 0o36) + '\062' + chr(48) + chr(0b100100 + 0o17), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\061' + chr(54) + '\064', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\061' + chr(54) + chr(0b110011), 44565 - 44557), nzTpIcepk0o8('\060' + chr(0b101011 + 0o104) + chr(0b101101 + 0o5) + chr(0b11110 + 0o22), 31185 - 31177), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1101111) + '\x35' + chr(0b110001), 35822 - 35814), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b0 + 0o157) + chr(0b110011) + '\065' + chr(51), 0o10), nzTpIcepk0o8(chr(1577 - 1529) + '\x6f' + chr(0b110011) + '\x34' + '\063', 0o10), nzTpIcepk0o8(chr(48) + chr(0b110100 + 0o73) + chr(0b110011) + '\063', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + chr(0b110111) + '\061', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x37' + chr(0b101000 + 0o17), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b110000 + 0o77) + chr(0b110001) + chr(0b11001 + 0o31) + chr(0b110100), 0o10), nzTpIcepk0o8('\060' + '\157' + '\x32' + chr(0b110011) + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(10872 - 10761) + chr(0b101101 + 0o4) + chr(54) + '\x31', 0o10), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(2633 - 2522) + chr(51) + '\060' + '\064', 4546 - 4538), nzTpIcepk0o8('\x30' + chr(0b111110 + 0o61) + chr(50) + '\x36' + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b100001 + 0o17) + '\x6f' + '\x37' + chr(0b110010), 36412 - 36404), nzTpIcepk0o8('\x30' + chr(0b100 + 0o153) + chr(0b110010) + '\x31' + chr(712 - 660), 38096 - 38088), nzTpIcepk0o8(chr(676 - 628) + '\x6f' + chr(0b10011 + 0o41) + chr(51), 20124 - 20116), nzTpIcepk0o8(chr(1737 - 1689) + '\x6f' + chr(0b110011) + '\x33' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49) + '\x35' + chr(54), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b100 + 0o54) + chr(111) + chr(2415 - 2362) + chr(0b110000), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xe2'), chr(0b1000100 + 0o40) + chr(0b10 + 0o143) + chr(4647 - 4548) + chr(111) + chr(6423 - 6323) + '\145')(chr(0b1100001 + 0o24) + '\164' + chr(0b1000010 + 0o44) + chr(0b11 + 0o52) + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def HAxsmtHsH36V(*eemPYp2vtTSr, **q5n0sHDDTy90): wDEIk17vEWwT = RKbF8EHN39tb(*eemPYp2vtTSr, **q5n0sHDDTy90) try: yield wDEIk17vEWwT except zfo2Sgkz3IVJ: raise finally: roI3spqORKae(wDEIk17vEWwT, roI3spqORKae(ES5oEprVxulp(b'\x96j\x90\xd6\xc7\xcb\xf7s\x8a\\\xdc\xd8'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(111) + chr(0b1011001 + 0o13) + '\x65')('\165' + chr(13114 - 12998) + chr(102) + '\x2d' + chr(1920 - 1864)))()
alexanderlukanin13/coolname
coolname/loader.py
load_config
def load_config(path): """ Loads configuration from a path. Path can be a json file, or a directory containing config.json and zero or more *.txt files with word lists or phrase lists. Returns config dict. Raises InitializationError when something is wrong. """ path = os.path.abspath(path) if os.path.isdir(path): config, wordlists = _load_data(path) elif os.path.isfile(path): config = _load_config(path) wordlists = {} else: raise InitializationError('File or directory not found: {0}'.format(path)) for name, wordlist in wordlists.items(): if name in config: raise InitializationError("Conflict: list {!r} is defined both in config " "and in *.txt file. If it's a {!r} list, " "you should remove it from config." .format(name, _CONF.TYPE.WORDS)) config[name] = wordlist return config
python
def load_config(path): """ Loads configuration from a path. Path can be a json file, or a directory containing config.json and zero or more *.txt files with word lists or phrase lists. Returns config dict. Raises InitializationError when something is wrong. """ path = os.path.abspath(path) if os.path.isdir(path): config, wordlists = _load_data(path) elif os.path.isfile(path): config = _load_config(path) wordlists = {} else: raise InitializationError('File or directory not found: {0}'.format(path)) for name, wordlist in wordlists.items(): if name in config: raise InitializationError("Conflict: list {!r} is defined both in config " "and in *.txt file. If it's a {!r} list, " "you should remove it from config." .format(name, _CONF.TYPE.WORDS)) config[name] = wordlist return config
[ "def", "load_config", "(", "path", ")", ":", "path", "=", "os", ".", "path", ".", "abspath", "(", "path", ")", "if", "os", ".", "path", ".", "isdir", "(", "path", ")", ":", "config", ",", "wordlists", "=", "_load_data", "(", "path", ")", "elif", "os", ".", "path", ".", "isfile", "(", "path", ")", ":", "config", "=", "_load_config", "(", "path", ")", "wordlists", "=", "{", "}", "else", ":", "raise", "InitializationError", "(", "'File or directory not found: {0}'", ".", "format", "(", "path", ")", ")", "for", "name", ",", "wordlist", "in", "wordlists", ".", "items", "(", ")", ":", "if", "name", "in", "config", ":", "raise", "InitializationError", "(", "\"Conflict: list {!r} is defined both in config \"", "\"and in *.txt file. If it's a {!r} list, \"", "\"you should remove it from config.\"", ".", "format", "(", "name", ",", "_CONF", ".", "TYPE", ".", "WORDS", ")", ")", "config", "[", "name", "]", "=", "wordlist", "return", "config" ]
Loads configuration from a path. Path can be a json file, or a directory containing config.json and zero or more *.txt files with word lists or phrase lists. Returns config dict. Raises InitializationError when something is wrong.
[ "Loads", "configuration", "from", "a", "path", "." ]
416cc39254ab9e921fd5be77dfe6cdafbad0300c
https://github.com/alexanderlukanin13/coolname/blob/416cc39254ab9e921fd5be77dfe6cdafbad0300c/coolname/loader.py#L19-L45
train
Loads a configuration from a file or directory containing config. json or zero or more *. txt files with word lists or phrase lists.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnH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4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(0b111101 + 0o62) + chr(0b1011 + 0o50) + chr(49), 53914 - 53906), nzTpIcepk0o8('\x30' + '\157' + '\x31' + chr(0b110001) + chr(0b101011 + 0o5), ord("\x08")), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\x6f' + '\x32' + '\x36' + '\x32', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b110000) + '\062', ord("\x08")), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(0b1101111) + chr(599 - 549) + chr(0b1011 + 0o51) + '\064', 63408 - 63400), nzTpIcepk0o8('\060' + '\157' + chr(0b10110 + 0o34) + chr(0b1010 + 0o51) + '\x30', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b110010 + 0o75) + chr(0b10011 + 0o40) + '\067', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1100101 + 0o12) + '\066' + '\x33', 59110 - 59102), nzTpIcepk0o8(chr(560 - 512) + chr(0b101010 + 0o105) + chr(51) + '\x30' + '\x34', 0o10), nzTpIcepk0o8(chr(48) + chr(0b100000 + 0o117) + chr(1698 - 1649) + chr(2351 - 2299) + chr(2066 - 2011), 35310 - 35302), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(8994 - 8883) + '\064' + '\062', 41707 - 41699), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + '\x36', 0o10), nzTpIcepk0o8(chr(1800 - 1752) + chr(0b1101101 + 0o2) + chr(0b1110 + 0o45) + chr(54) + chr(50), 55368 - 55360), nzTpIcepk0o8(chr(48) + chr(3637 - 3526) + '\x33' + chr(0b110010) + chr(0b1111 + 0o50), 42493 - 42485), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(2813 - 2702) + chr(0b110001) + '\x35' + chr(0b110001), 50708 - 50700), nzTpIcepk0o8(chr(48) + '\x6f' + chr(358 - 307) + chr(2901 - 2847) + chr(0b110111), 0o10), nzTpIcepk0o8(chr(1991 - 1943) + chr(0b1101111) + '\x31' + '\x31' + '\x31', 256 - 248), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(53) + chr(0b110111), 18952 - 18944), nzTpIcepk0o8(chr(1364 - 1316) + '\x6f' + '\x31' + '\x30' + chr(55), 27866 - 27858), nzTpIcepk0o8(chr(0b110000) + chr(7352 - 7241) + chr(49) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(111) + '\065' + chr(52), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\062' + chr(1725 - 1677) + '\064', 0o10), nzTpIcepk0o8(chr(785 - 737) + '\157' + chr(192 - 142) + chr(0b11100 + 0o32) + chr(51), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(1074 - 1024) + chr(0b110 + 0o55) + chr(0b101 + 0o62), 0b1000), nzTpIcepk0o8(chr(767 - 719) + chr(9323 - 9212) + '\x33' + chr(0b11010 + 0o35), 8), nzTpIcepk0o8('\060' + '\x6f' + '\061' + '\060' + chr(0b110101 + 0o0), ord("\x08")), nzTpIcepk0o8(chr(0b101010 + 0o6) + '\x6f' + '\061' + chr(2139 - 2087) + '\060', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x31' + chr(278 - 225) + '\x33', 0o10), nzTpIcepk0o8(chr(77 - 29) + '\x6f' + '\x37' + '\x31', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(2356 - 2245) + '\063' + chr(1722 - 1671) + chr(0b0 + 0o60), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x32' + chr(51) + '\066', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b100111 + 0o110) + chr(0b1011 + 0o50) + '\x32' + chr(0b10 + 0o61), 0o10), nzTpIcepk0o8('\x30' + chr(0b111110 + 0o61) + chr(0b110001) + '\x32' + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(749 - 701) + chr(6996 - 6885) + chr(810 - 755) + '\x33', 0b1000), nzTpIcepk0o8(chr(48) + chr(6703 - 6592) + chr(54) + chr(0b10100 + 0o37), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\067' + chr(48), 0o10), nzTpIcepk0o8(chr(1928 - 1880) + '\157' + '\x34' + '\x35', 3773 - 3765), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(0b1101111) + chr(49) + chr(558 - 504) + chr(0b110000), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001) + chr(108 - 55) + '\066', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1010001 + 0o36) + chr(0b110011) + chr(54) + chr(1036 - 986), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(2248 - 2200) + chr(4588 - 4477) + chr(53) + chr(0b110000), 50211 - 50203)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'7'), chr(100) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(100) + chr(0b1100101))(chr(0b101001 + 0o114) + '\164' + chr(0b1100110) + chr(921 - 876) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def s3cG7WT6g3Gb(_pSYqrosNb95): _pSYqrosNb95 = aHUqKstZLeS6.path.abspath(_pSYqrosNb95) if roI3spqORKae(aHUqKstZLeS6.path, roI3spqORKae(ES5oEprVxulp(b'A \xe2\xf3\xfe\xec]\n\xa56XT'), chr(0b1100100) + chr(101) + chr(99) + chr(0b1101111) + chr(493 - 393) + chr(0b1001100 + 0o31))('\x75' + chr(0b1110100) + chr(7156 - 7054) + chr(45) + chr(0b10110 + 0o42)))(_pSYqrosNb95): (kgkKUcD36lls, V0pCznKlh4mt) = IEcC1ghDYoJi(_pSYqrosNb95) elif roI3spqORKae(aHUqKstZLeS6.path, roI3spqORKae(ES5oEprVxulp(b'p;\xd4\xab\xc8\xfd'), '\x64' + '\x65' + chr(416 - 317) + chr(0b1101 + 0o142) + chr(0b1100100) + '\x65')(chr(10633 - 10516) + chr(0b111001 + 0o73) + chr(102) + chr(0b10 + 0o53) + chr(0b10011 + 0o45)))(_pSYqrosNb95): kgkKUcD36lls = GWpUiqxw02a5(_pSYqrosNb95) V0pCznKlh4mt = {} else: raise b2IAKyD1qsnO(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'_!\xde\xa7\x84\xf7m\x13\xa0\x0ePs\x91\xa3\x06\x850\x0f)`X\xa4\xd5\xf0j+\x04Q\x19\xa3\xae\xae'), '\144' + '\x65' + '\143' + chr(0b110001 + 0o76) + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(0b1001110 + 0o46) + chr(0b1100110) + '\x2d' + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'h{\x81\x89\xe3\xaby\\\x958a\\'), chr(100) + '\145' + '\143' + '\157' + chr(3377 - 3277) + '\145')(chr(0b1010100 + 0o41) + '\x74' + chr(102) + chr(0b101101) + chr(0b101100 + 0o14)))(_pSYqrosNb95)) for (SLVB2BPA_mIe, xYT7xQW_c5h7) in roI3spqORKae(V0pCznKlh4mt, roI3spqORKae(ES5oEprVxulp(b'@\x17\xdc\x8c\xe1\xe2W\x07\xf7\x11z\x7f'), chr(515 - 415) + chr(6528 - 6427) + chr(0b1100011) + '\x6f' + '\144' + chr(101))('\x75' + chr(0b1011 + 0o151) + chr(6233 - 6131) + chr(656 - 611) + chr(0b101001 + 0o17)))(): if SLVB2BPA_mIe in kgkKUcD36lls: raise b2IAKyD1qsnO(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'Z\'\xdc\xa4\xc8\xf1|G\xfeGN\x7f\x81\xa3I\x8ch]:/E\xf7\x93\xfbz#\t\x05\\\xbc\xbe\xb18O[\x18L\x1eN\x91v&\xd4\xab\xc3\xb8~]\xa0GKx\xd2\xfdG\x831[giE\xe8\xd6\xb1?\x0c\x06KP\xac\xb9\xa0wZ\x13C\x04\x02\x13\xd2u!\xc1\xb6\x88\xb8f\\\xb1GQ~\x9d\xa2\x05\x93i]"bC\xf2\xd6\xbfv1@\rK\xb7\xf3\xf34T]^L\x17@'), chr(5691 - 5591) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(100) + chr(3184 - 3083))(chr(0b1100001 + 0o24) + '\x74' + chr(102) + '\x2d' + '\070'), roI3spqORKae(ES5oEprVxulp(b'h{\x81\x89\xe3\xaby\\\x958a\\'), '\x64' + chr(101) + '\x63' + '\x6f' + chr(100) + '\145')(chr(117) + '\x74' + chr(0b1011111 + 0o7) + chr(0b101101) + chr(0b111000)))(SLVB2BPA_mIe, roI3spqORKae(konYruLIWsio.TYPE, roI3spqORKae(ES5oEprVxulp(b'N\x07\xe0\x86\xf7'), chr(405 - 305) + '\x65' + '\x63' + chr(0b11011 + 0o124) + chr(0b1100100) + chr(0b1100101))(chr(117) + '\x74' + chr(0b1011100 + 0o12) + chr(45) + '\x38')))) kgkKUcD36lls[SLVB2BPA_mIe] = xYT7xQW_c5h7 return kgkKUcD36lls
alexanderlukanin13/coolname
coolname/loader.py
_load_data
def _load_data(path): """ Loads data from a directory. Returns tuple (config_dict, wordlists). Raises Exception on failure (e.g. if data is corrupted). """ path = os.path.abspath(path) if not os.path.isdir(path): raise InitializationError('Directory not found: {0}'.format(path)) wordlists = {} for file_name in os.listdir(path): if os.path.splitext(file_name)[1] != '.txt': continue file_path = os.path.join(path, file_name) name = os.path.splitext(os.path.split(file_path)[1])[0] try: with codecs.open(file_path, encoding='utf-8') as file: wordlists[name] = _load_wordlist(name, file) except OSError as ex: raise InitializationError('Failed to read {}: {}'.format(file_path, ex)) config = _load_config(os.path.join(path, 'config.json')) return (config, wordlists)
python
def _load_data(path): """ Loads data from a directory. Returns tuple (config_dict, wordlists). Raises Exception on failure (e.g. if data is corrupted). """ path = os.path.abspath(path) if not os.path.isdir(path): raise InitializationError('Directory not found: {0}'.format(path)) wordlists = {} for file_name in os.listdir(path): if os.path.splitext(file_name)[1] != '.txt': continue file_path = os.path.join(path, file_name) name = os.path.splitext(os.path.split(file_path)[1])[0] try: with codecs.open(file_path, encoding='utf-8') as file: wordlists[name] = _load_wordlist(name, file) except OSError as ex: raise InitializationError('Failed to read {}: {}'.format(file_path, ex)) config = _load_config(os.path.join(path, 'config.json')) return (config, wordlists)
[ "def", "_load_data", "(", "path", ")", ":", "path", "=", "os", ".", "path", ".", "abspath", "(", "path", ")", "if", "not", "os", ".", "path", ".", "isdir", "(", "path", ")", ":", "raise", "InitializationError", "(", "'Directory not found: {0}'", ".", "format", "(", "path", ")", ")", "wordlists", "=", "{", "}", "for", "file_name", "in", "os", ".", "listdir", "(", "path", ")", ":", "if", "os", ".", "path", ".", "splitext", "(", "file_name", ")", "[", "1", "]", "!=", "'.txt'", ":", "continue", "file_path", "=", "os", ".", "path", ".", "join", "(", "path", ",", "file_name", ")", "name", "=", "os", ".", "path", ".", "splitext", "(", "os", ".", "path", ".", "split", "(", "file_path", ")", "[", "1", "]", ")", "[", "0", "]", "try", ":", "with", "codecs", ".", "open", "(", "file_path", ",", "encoding", "=", "'utf-8'", ")", "as", "file", ":", "wordlists", "[", "name", "]", "=", "_load_wordlist", "(", "name", ",", "file", ")", "except", "OSError", "as", "ex", ":", "raise", "InitializationError", "(", "'Failed to read {}: {}'", ".", "format", "(", "file_path", ",", "ex", ")", ")", "config", "=", "_load_config", "(", "os", ".", "path", ".", "join", "(", "path", ",", "'config.json'", ")", ")", "return", "(", "config", ",", "wordlists", ")" ]
Loads data from a directory. Returns tuple (config_dict, wordlists). Raises Exception on failure (e.g. if data is corrupted).
[ "Loads", "data", "from", "a", "directory", ".", "Returns", "tuple", "(", "config_dict", "wordlists", ")", ".", "Raises", "Exception", "on", "failure", "(", "e", ".", "g", ".", "if", "data", "is", "corrupted", ")", "." ]
416cc39254ab9e921fd5be77dfe6cdafbad0300c
https://github.com/alexanderlukanin13/coolname/blob/416cc39254ab9e921fd5be77dfe6cdafbad0300c/coolname/loader.py#L48-L69
train
Loads data from a directory.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M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G3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(0b10001 + 0o37) + '\067', 0o10), nzTpIcepk0o8(chr(48) + chr(0b11111 + 0o120) + '\063' + chr(0b1001 + 0o53), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1892 - 1843) + chr(0b1010 + 0o53) + chr(0b110101), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\x33' + chr(54) + chr(1555 - 1505), 0b1000), nzTpIcepk0o8(chr(495 - 447) + chr(0b1101111) + chr(51) + '\x34' + chr(567 - 514), ord("\x08")), nzTpIcepk0o8(chr(0b101111 + 0o1) + '\157' + chr(0b110011) + '\x32' + chr(54), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x32' + chr(49) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(867 - 818) + chr(54) + chr(0b100111 + 0o14), 58407 - 58399), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1977 - 1927) + chr(50) + chr(0b101100 + 0o10), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b110010) + chr(1901 - 1846) + chr(547 - 494), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + chr(55) + chr(0b110001), 27086 - 27078), nzTpIcepk0o8('\x30' + '\157' + '\x33' + '\x30' + chr(0b11001 + 0o27), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b100101 + 0o15) + chr(0b1001 + 0o54) + chr(0b110110), 30932 - 30924), nzTpIcepk0o8(chr(48) + '\157' + '\062' + '\x33' + chr(54), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\061' + chr(0b10001 + 0o37) + chr(0b101001 + 0o14), 0b1000), nzTpIcepk0o8('\060' + chr(0b111000 + 0o67) + chr(50) + '\x32' + chr(0b11101 + 0o27), 8), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + chr(48) + chr(0b100001 + 0o22), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\064' + chr(0b10000 + 0o44), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b110111) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(111) + '\x31' + chr(0b110100) + chr(0b110100), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(51) + '\064' + chr(0b110000), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\x35' + chr(2115 - 2065), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b1111 + 0o45), 0b1000), nzTpIcepk0o8('\060' + chr(0b111000 + 0o67) + chr(0b11010 + 0o30) + '\x34', 0o10), nzTpIcepk0o8('\x30' + '\157' + '\x32' + chr(0b10100 + 0o43) + '\x32', 1308 - 1300), nzTpIcepk0o8('\x30' + chr(111) + '\x33' + '\060' + '\061', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b101111 + 0o100) + chr(0b101100 + 0o13), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(49) + chr(980 - 926) + chr(1845 - 1795), 0o10), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(0b1101111) + chr(2436 - 2383) + chr(0b100011 + 0o21), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1010010 + 0o35) + chr(0b1010 + 0o47) + '\x37' + '\x36', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001) + '\066' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(3038 - 2927) + chr(0b10011 + 0o36) + chr(55) + '\067', ord("\x08")), nzTpIcepk0o8('\060' + chr(2015 - 1904) + chr(51) + chr(629 - 576) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(0b11010 + 0o26) + '\x6f' + chr(49) + chr(48) + chr(2072 - 2018), 7090 - 7082), nzTpIcepk0o8(chr(0b10001 + 0o37) + '\x6f' + chr(0b1001 + 0o51) + '\066' + chr(0b10000 + 0o45), 0o10), nzTpIcepk0o8('\060' + chr(111) + '\x31' + '\x35' + chr(1784 - 1734), 0o10), nzTpIcepk0o8(chr(0b0 + 0o60) + '\157' + chr(1256 - 1207) + '\064' + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b1101111) + '\061' + chr(50) + chr(216 - 164), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110011) + chr(2134 - 2086) + '\067', 8), nzTpIcepk0o8(chr(720 - 672) + chr(111) + '\x30', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\157' + '\065' + '\060', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xe9'), chr(0b1001000 + 0o34) + '\x65' + chr(0b1011011 + 0o10) + chr(0b1101101 + 0o2) + '\x64' + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(45) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def IEcC1ghDYoJi(_pSYqrosNb95): _pSYqrosNb95 = aHUqKstZLeS6.path.abspath(_pSYqrosNb95) if not roI3spqORKae(aHUqKstZLeS6.path, roI3spqORKae(ES5oEprVxulp(b'\x9ft=\xc3\xbf\xa2\xceJ\xf5\xec\x03\x82'), '\x64' + chr(0b1100101) + chr(0b111111 + 0o44) + chr(0b1101111) + '\144' + '\145')(chr(0b111000 + 0o75) + '\164' + chr(0b1010101 + 0o21) + chr(0b101101) + chr(0b111000)))(_pSYqrosNb95): raise b2IAKyD1qsnO(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\x83u\x1f\x97\x86\xa2\xe3\x01\xed\x9d\x17\xaf\xda\xbe#\xfb6J\x9d^\xc0Q4i'), chr(6091 - 5991) + chr(0b1100101) + '\x63' + chr(9338 - 9227) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b1101101 + 0o7) + chr(102) + chr(45) + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\xb6/^\xb9\xa2\xe5\xea\x1c\xc5\xe2:\x8a'), '\144' + chr(3170 - 3069) + chr(99) + chr(0b1101111) + chr(100) + chr(0b1010111 + 0o16))(chr(858 - 741) + '\x74' + chr(0b1000000 + 0o46) + chr(0b101101) + chr(0b1011 + 0o55)))(_pSYqrosNb95)) V0pCznKlh4mt = {} for Ob89R3fsHgUT in roI3spqORKae(aHUqKstZLeS6, roI3spqORKae(ES5oEprVxulp(b'\xabu\x1e\x86\x81\xbf\xfe'), '\144' + chr(0b1100101) + chr(9661 - 9562) + chr(0b1100011 + 0o14) + chr(9097 - 8997) + '\x65')(chr(0b1010101 + 0o40) + '\164' + chr(0b1111 + 0o127) + chr(0b1001 + 0o44) + chr(0b101101 + 0o13)))(_pSYqrosNb95): if roI3spqORKae(aHUqKstZLeS6.path, roI3spqORKae(ES5oEprVxulp(b'\xa9W\x03\x98\x96\x97\xbf&\xe7\xe5\t\x99'), '\144' + '\x65' + '\143' + chr(111) + '\144' + chr(0b1100101))(chr(117) + chr(0b1101010 + 0o12) + chr(0b1100110) + '\055' + chr(0b110111 + 0o1)))(Ob89R3fsHgUT)[nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001), 0o10)] != roI3spqORKae(ES5oEprVxulp(b'\xe9h\x15\x86'), '\144' + chr(2573 - 2472) + chr(99) + '\x6f' + chr(0b1011001 + 0o13) + chr(101))(chr(0b10010 + 0o143) + chr(116) + '\146' + chr(45) + '\070'): continue FQgy_W0Nc99x = aHUqKstZLeS6.path.Y4yM9BcfTCNq(_pSYqrosNb95, Ob89R3fsHgUT) SLVB2BPA_mIe = aHUqKstZLeS6.path.nKnjsA3UsXpY(aHUqKstZLeS6.path.LfRrQOxuDvnC(FQgy_W0Nc99x)[nzTpIcepk0o8(chr(0b110000) + '\157' + chr(49), 8)])[nzTpIcepk0o8('\060' + chr(111) + '\060', 8)] try: with roI3spqORKae(Hj8X5RtMNBIn, roI3spqORKae(ES5oEprVxulp(b'\x83r8\xc1\xb7\xa7\xb5=\xa1\xdc\x15\xa1'), chr(100) + '\145' + chr(99) + chr(1879 - 1768) + chr(0b11000 + 0o114) + '\145')(chr(0b1110101) + chr(0b1010100 + 0o40) + chr(6463 - 6361) + '\x2d' + chr(0b111000)))(FQgy_W0Nc99x, encoding=roI3spqORKae(ES5oEprVxulp(b'\xb2h\x0b\xdf\xdd'), '\x64' + '\x65' + '\x63' + chr(111) + '\x64' + chr(4248 - 4147))('\x75' + chr(0b1110100) + chr(102) + chr(0b101101) + '\070')) as GtsVUCYulgYX: V0pCznKlh4mt[SLVB2BPA_mIe] = oJGL_Cds0Noi(SLVB2BPA_mIe, GtsVUCYulgYX) except zsedrPqY_EmW as dclkBu6Bdnnh: raise b2IAKyD1qsnO(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\x81}\x04\x9e\x80\xb2\xac\x07\xfb\x9d\x0b\xa5\xcf\xfae\xef>\x1e\xd9\x1f\x9d'), chr(0b10110 + 0o116) + '\145' + chr(0b111011 + 0o50) + chr(2632 - 2521) + chr(100) + '\x65')(chr(8031 - 7914) + chr(0b110101 + 0o77) + chr(0b1100110) + chr(1905 - 1860) + '\070'), roI3spqORKae(ES5oEprVxulp(b'\xb6/^\xb9\xa2\xe5\xea\x1c\xc5\xe2:\x8a'), chr(100) + chr(101) + chr(0b111010 + 0o51) + chr(111) + chr(100) + chr(101))(chr(0b1110101) + '\164' + chr(3602 - 3500) + '\x2d' + '\x38'))(FQgy_W0Nc99x, dclkBu6Bdnnh)) kgkKUcD36lls = GWpUiqxw02a5(aHUqKstZLeS6.path.Y4yM9BcfTCNq(_pSYqrosNb95, roI3spqORKae(ES5oEprVxulp(b'\xa4s\x03\x94\x8c\xb1\xa2\x19\xe7\xd2\x17'), chr(3970 - 3870) + chr(101) + chr(0b1100011) + '\x6f' + chr(4911 - 4811) + chr(0b1100101))(chr(0b1110101) + chr(6615 - 6499) + chr(102) + '\x2d' + chr(0b111000)))) return (kgkKUcD36lls, V0pCznKlh4mt)
alexanderlukanin13/coolname
coolname/loader.py
_parse_option
def _parse_option(line): """ Parses option line. Returns (name, value). Raises ValueError on invalid syntax or unknown option. """ match = _OPTION_REGEX.match(line) if not match: raise ValueError('Invalid syntax') for name, type_ in _OPTIONS: if name == match.group(1): return name, type_(match.group(2)) raise ValueError('Unknown option')
python
def _parse_option(line): """ Parses option line. Returns (name, value). Raises ValueError on invalid syntax or unknown option. """ match = _OPTION_REGEX.match(line) if not match: raise ValueError('Invalid syntax') for name, type_ in _OPTIONS: if name == match.group(1): return name, type_(match.group(2)) raise ValueError('Unknown option')
[ "def", "_parse_option", "(", "line", ")", ":", "match", "=", "_OPTION_REGEX", ".", "match", "(", "line", ")", "if", "not", "match", ":", "raise", "ValueError", "(", "'Invalid syntax'", ")", "for", "name", ",", "type_", "in", "_OPTIONS", ":", "if", "name", "==", "match", ".", "group", "(", "1", ")", ":", "return", "name", ",", "type_", "(", "match", ".", "group", "(", "2", ")", ")", "raise", "ValueError", "(", "'Unknown option'", ")" ]
Parses option line. Returns (name, value). Raises ValueError on invalid syntax or unknown option.
[ "Parses", "option", "line", ".", "Returns", "(", "name", "value", ")", ".", "Raises", "ValueError", "on", "invalid", "syntax", "or", "unknown", "option", "." ]
416cc39254ab9e921fd5be77dfe6cdafbad0300c
https://github.com/alexanderlukanin13/coolname/blob/416cc39254ab9e921fd5be77dfe6cdafbad0300c/coolname/loader.py#L95-L107
train
Parses a line of text into a key - value pair.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ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mKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(152 - 104) + chr(0b1101001 + 0o6) + chr(0b110011) + chr(0b110011) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(2319 - 2268) + chr(472 - 422) + chr(2513 - 2459), 6383 - 6375), nzTpIcepk0o8(chr(48) + chr(111) + '\x32' + '\x31' + chr(1680 - 1628), 6755 - 6747), nzTpIcepk0o8(chr(1236 - 1188) + '\157' + chr(0b101001 + 0o11) + chr(1410 - 1361) + chr(2455 - 2401), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1730 - 1680) + '\x35' + '\x32', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b10101 + 0o36) + '\060', 0o10), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(0b1101111) + chr(49) + chr(52) + '\064', ord("\x08")), nzTpIcepk0o8('\x30' + chr(11411 - 11300) + '\x32' + chr(1241 - 1189) + '\063', 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(700 - 649) + chr(49), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(50) + chr(0b10000 + 0o40) + chr(52), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b10010 + 0o37) + '\x32' + chr(0b100100 + 0o21), 0b1000), nzTpIcepk0o8(chr(1707 - 1659) + chr(0b110101 + 0o72) + chr(0b11101 + 0o24) + chr(1898 - 1850) + chr(770 - 721), 0o10), nzTpIcepk0o8(chr(2213 - 2165) + chr(0b1101111) + chr(0b110011) + '\x30' + chr(236 - 187), ord("\x08")), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(111) + chr(49) + chr(683 - 630) + chr(55), 0o10), nzTpIcepk0o8(chr(796 - 748) + chr(0b1101010 + 0o5) + chr(0b110011) + chr(48) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(0b1101111) + '\063' + chr(51) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b10010 + 0o44), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\x33' + chr(0b110100) + '\063', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b110001) + chr(1605 - 1557), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\064' + '\x37', 0b1000), nzTpIcepk0o8('\x30' + chr(0b111110 + 0o61) + '\x33' + chr(50) + chr(0b110110), 8), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(0b110100) + chr(1277 - 1223), 9734 - 9726), nzTpIcepk0o8('\060' + chr(0b1101111) + '\061' + '\060' + chr(0b110111), 14803 - 14795), nzTpIcepk0o8('\060' + chr(0b1101111) + '\062' + chr(0b11111 + 0o21), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(49) + chr(54) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(2088 - 2040) + '\x6f' + chr(1715 - 1661) + '\064', 53557 - 53549), nzTpIcepk0o8(chr(2103 - 2055) + chr(111) + chr(54), 8), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x32' + '\066' + chr(55), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\x32' + '\x33', 0b1000), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(0b11101 + 0o122) + chr(50), 27689 - 27681), nzTpIcepk0o8('\x30' + chr(0b100101 + 0o112) + chr(413 - 362) + chr(0b110110) + chr(326 - 276), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + '\x36' + chr(0b110011), 51393 - 51385), nzTpIcepk0o8(chr(0b110000) + chr(10253 - 10142) + '\x33' + chr(0b10010 + 0o43) + '\x37', 0o10), nzTpIcepk0o8(chr(961 - 913) + chr(111) + '\x31' + chr(0b101010 + 0o15) + chr(0b110101), 59475 - 59467), nzTpIcepk0o8(chr(0b110000) + chr(4135 - 4024) + '\x32' + chr(2443 - 2389) + chr(48), 0o10), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(111) + '\061' + chr(0b110110) + chr(0b11001 + 0o35), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(116 - 67) + '\067' + chr(2462 - 2412), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110000 + 0o1) + chr(50), 15417 - 15409), nzTpIcepk0o8('\060' + chr(0b101011 + 0o104) + '\062' + '\x34' + chr(0b100010 + 0o23), 0b1000), nzTpIcepk0o8(chr(0b1011 + 0o45) + '\x6f' + chr(0b11101 + 0o32) + chr(845 - 793), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(785 - 674) + chr(0b100001 + 0o24) + '\x30', 40880 - 40872)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xf1'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(7678 - 7567) + chr(9234 - 9134) + chr(0b1100101))(chr(117) + '\164' + chr(6705 - 6603) + chr(0b100011 + 0o12) + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def NUKjxND60p6K(ffiOpFBWGmZU): hk9OijmiC_zA = scwV_Lg3Jl_a.hk9OijmiC_zA(ffiOpFBWGmZU) if not hk9OijmiC_zA: raise WbNHlDKpyPtQ(roI3spqORKae(ES5oEprVxulp(b'\x96\xb8\xfa\xef\xc6q\x00\x83j\xfd;5\xa0\x17'), '\x64' + chr(101) + chr(0b111011 + 0o50) + '\x6f' + chr(5230 - 5130) + chr(0b1000001 + 0o44))(chr(0b1110101) + '\164' + chr(102) + chr(45) + chr(56))) for (SLVB2BPA_mIe, aPbOqK56cePj) in DZJff7Xo1BHQ: if SLVB2BPA_mIe == roI3spqORKae(hk9OijmiC_zA, roI3spqORKae(ES5oEprVxulp(b'\x99\xef\xe0\xc4\x92J\x06\xeav\xea$#'), chr(0b1100100) + chr(6976 - 6875) + chr(0b1001111 + 0o24) + '\x6f' + chr(0b1100100) + '\145')(chr(0b1110101) + '\164' + chr(102) + '\055' + '\x38'))(nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001), 0b1000)): return (SLVB2BPA_mIe, aPbOqK56cePj(roI3spqORKae(hk9OijmiC_zA, roI3spqORKae(ES5oEprVxulp(b'\x99\xef\xe0\xc4\x92J\x06\xeav\xea$#'), '\144' + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(6050 - 5950) + '\x65')(chr(0b111110 + 0o67) + chr(0b101101 + 0o107) + '\x66' + '\055' + chr(0b110001 + 0o7)))(nzTpIcepk0o8(chr(48) + '\157' + chr(53 - 3), 8)))) raise WbNHlDKpyPtQ(roI3spqORKae(ES5oEprVxulp(b'\x8a\xb8\xe7\xe0\xc5o\n\x83v\xf4!(\xae\x01'), chr(7230 - 7130) + chr(1412 - 1311) + chr(0b1100011) + chr(7866 - 7755) + '\x64' + '\145')(chr(0b10 + 0o163) + chr(0b101000 + 0o114) + chr(9471 - 9369) + chr(1441 - 1396) + chr(56)))
alexanderlukanin13/coolname
coolname/loader.py
_load_wordlist
def _load_wordlist(name, stream): """ Loads list of words or phrases from file. Returns "words" or "phrases" dictionary, the same as used in config. Raises Exception if file is missing or invalid. """ items = [] max_length = None multiword = False multiword_start = None number_of_words = None for i, line in enumerate(stream, start=1): line = line.strip() if not line or line.startswith('#'): continue # Is it an option line, e.g. 'max_length = 10'? if '=' in line: if items: raise ConfigurationError('Invalid assignment at list {!r} line {}: {!r} ' '(options must be defined before words)' .format(name, i, line)) try: option, option_value = _parse_option(line) except ValueError as ex: raise ConfigurationError('Invalid assignment at list {!r} line {}: {!r} ' '({})' .format(name, i, line, ex)) if option == _CONF.FIELD.MAX_LENGTH: max_length = option_value elif option == _CONF.FIELD.NUMBER_OF_WORDS: number_of_words = option_value continue # pragma: no cover # Parse words if not multiword and _WORD_REGEX.match(line): if max_length is not None and len(line) > max_length: raise ConfigurationError('Word is too long at list {!r} line {}: {!r}' .format(name, i, line)) items.append(line) elif _PHRASE_REGEX.match(line): if not multiword: multiword = True multiword_start = len(items) phrase = tuple(line.split(' ')) if number_of_words is not None and len(phrase) != number_of_words: raise ConfigurationError('Phrase has {} word(s) (while number_of_words={}) ' 'at list {!r} line {}: {!r}' .format(len(phrase), number_of_words, name, i, line)) if max_length is not None and sum(len(x) for x in phrase) > max_length: raise ConfigurationError('Phrase is too long at list {!r} line {}: {!r}' .format(name, i, line)) items.append(phrase) else: raise ConfigurationError('Invalid syntax at list {!r} line {}: {!r}' .format(name, i, line)) if multiword: # If in phrase mode, convert everything to tuples for i in range(0, multiword_start): items[i] = (items[i], ) result = { _CONF.FIELD.TYPE: _CONF.TYPE.PHRASES, _CONF.FIELD.PHRASES: items } if number_of_words is not None: result[_CONF.FIELD.NUMBER_OF_WORDS] = number_of_words else: result = { _CONF.FIELD.TYPE: _CONF.TYPE.WORDS, _CONF.FIELD.WORDS: items } if max_length is not None: result[_CONF.FIELD.MAX_LENGTH] = max_length return result
python
def _load_wordlist(name, stream): """ Loads list of words or phrases from file. Returns "words" or "phrases" dictionary, the same as used in config. Raises Exception if file is missing or invalid. """ items = [] max_length = None multiword = False multiword_start = None number_of_words = None for i, line in enumerate(stream, start=1): line = line.strip() if not line or line.startswith('#'): continue # Is it an option line, e.g. 'max_length = 10'? if '=' in line: if items: raise ConfigurationError('Invalid assignment at list {!r} line {}: {!r} ' '(options must be defined before words)' .format(name, i, line)) try: option, option_value = _parse_option(line) except ValueError as ex: raise ConfigurationError('Invalid assignment at list {!r} line {}: {!r} ' '({})' .format(name, i, line, ex)) if option == _CONF.FIELD.MAX_LENGTH: max_length = option_value elif option == _CONF.FIELD.NUMBER_OF_WORDS: number_of_words = option_value continue # pragma: no cover # Parse words if not multiword and _WORD_REGEX.match(line): if max_length is not None and len(line) > max_length: raise ConfigurationError('Word is too long at list {!r} line {}: {!r}' .format(name, i, line)) items.append(line) elif _PHRASE_REGEX.match(line): if not multiword: multiword = True multiword_start = len(items) phrase = tuple(line.split(' ')) if number_of_words is not None and len(phrase) != number_of_words: raise ConfigurationError('Phrase has {} word(s) (while number_of_words={}) ' 'at list {!r} line {}: {!r}' .format(len(phrase), number_of_words, name, i, line)) if max_length is not None and sum(len(x) for x in phrase) > max_length: raise ConfigurationError('Phrase is too long at list {!r} line {}: {!r}' .format(name, i, line)) items.append(phrase) else: raise ConfigurationError('Invalid syntax at list {!r} line {}: {!r}' .format(name, i, line)) if multiword: # If in phrase mode, convert everything to tuples for i in range(0, multiword_start): items[i] = (items[i], ) result = { _CONF.FIELD.TYPE: _CONF.TYPE.PHRASES, _CONF.FIELD.PHRASES: items } if number_of_words is not None: result[_CONF.FIELD.NUMBER_OF_WORDS] = number_of_words else: result = { _CONF.FIELD.TYPE: _CONF.TYPE.WORDS, _CONF.FIELD.WORDS: items } if max_length is not None: result[_CONF.FIELD.MAX_LENGTH] = max_length return result
[ "def", "_load_wordlist", "(", "name", ",", "stream", ")", ":", "items", "=", "[", "]", "max_length", "=", "None", "multiword", "=", "False", "multiword_start", "=", "None", "number_of_words", "=", "None", "for", "i", ",", "line", "in", "enumerate", "(", "stream", ",", "start", "=", "1", ")", ":", "line", "=", "line", ".", "strip", "(", ")", "if", "not", "line", "or", "line", ".", "startswith", "(", "'#'", ")", ":", "continue", "# Is it an option line, e.g. 'max_length = 10'?", "if", "'='", "in", "line", ":", "if", "items", ":", "raise", "ConfigurationError", "(", "'Invalid assignment at list {!r} line {}: {!r} '", "'(options must be defined before words)'", ".", "format", "(", "name", ",", "i", ",", "line", ")", ")", "try", ":", "option", ",", "option_value", "=", "_parse_option", "(", "line", ")", "except", "ValueError", "as", "ex", ":", "raise", "ConfigurationError", "(", "'Invalid assignment at list {!r} line {}: {!r} '", "'({})'", ".", "format", "(", "name", ",", "i", ",", "line", ",", "ex", ")", ")", "if", "option", "==", "_CONF", ".", "FIELD", ".", "MAX_LENGTH", ":", "max_length", "=", "option_value", "elif", "option", "==", "_CONF", ".", "FIELD", ".", "NUMBER_OF_WORDS", ":", "number_of_words", "=", "option_value", "continue", "# pragma: no cover", "# Parse words", "if", "not", "multiword", "and", "_WORD_REGEX", ".", "match", "(", "line", ")", ":", "if", "max_length", "is", "not", "None", "and", "len", "(", "line", ")", ">", "max_length", ":", "raise", "ConfigurationError", "(", "'Word is too long at list {!r} line {}: {!r}'", ".", "format", "(", "name", ",", "i", ",", "line", ")", ")", "items", ".", "append", "(", "line", ")", "elif", "_PHRASE_REGEX", ".", "match", "(", "line", ")", ":", "if", "not", "multiword", ":", "multiword", "=", "True", "multiword_start", "=", "len", "(", "items", ")", "phrase", "=", "tuple", "(", "line", ".", "split", "(", "' '", ")", ")", "if", "number_of_words", "is", "not", "None", "and", "len", "(", "phrase", ")", "!=", "number_of_words", ":", "raise", "ConfigurationError", "(", "'Phrase has {} word(s) (while number_of_words={}) '", "'at list {!r} line {}: {!r}'", ".", "format", "(", "len", "(", "phrase", ")", ",", "number_of_words", ",", "name", ",", "i", ",", "line", ")", ")", "if", "max_length", "is", "not", "None", "and", "sum", "(", "len", "(", "x", ")", "for", "x", "in", "phrase", ")", ">", "max_length", ":", "raise", "ConfigurationError", "(", "'Phrase is too long at list {!r} line {}: {!r}'", ".", "format", "(", "name", ",", "i", ",", "line", ")", ")", "items", ".", "append", "(", "phrase", ")", "else", ":", "raise", "ConfigurationError", "(", "'Invalid syntax at list {!r} line {}: {!r}'", ".", "format", "(", "name", ",", "i", ",", "line", ")", ")", "if", "multiword", ":", "# If in phrase mode, convert everything to tuples", "for", "i", "in", "range", "(", "0", ",", "multiword_start", ")", ":", "items", "[", "i", "]", "=", "(", "items", "[", "i", "]", ",", ")", "result", "=", "{", "_CONF", ".", "FIELD", ".", "TYPE", ":", "_CONF", ".", "TYPE", ".", "PHRASES", ",", "_CONF", ".", "FIELD", ".", "PHRASES", ":", "items", "}", "if", "number_of_words", "is", "not", "None", ":", "result", "[", "_CONF", ".", "FIELD", ".", "NUMBER_OF_WORDS", "]", "=", "number_of_words", "else", ":", "result", "=", "{", "_CONF", ".", "FIELD", ".", "TYPE", ":", "_CONF", ".", "TYPE", ".", "WORDS", ",", "_CONF", ".", "FIELD", ".", "WORDS", ":", "items", "}", "if", "max_length", "is", "not", "None", ":", "result", "[", "_CONF", ".", "FIELD", ".", "MAX_LENGTH", "]", "=", "max_length", "return", "result" ]
Loads list of words or phrases from file. Returns "words" or "phrases" dictionary, the same as used in config. Raises Exception if file is missing or invalid.
[ "Loads", "list", "of", "words", "or", "phrases", "from", "file", "." ]
416cc39254ab9e921fd5be77dfe6cdafbad0300c
https://github.com/alexanderlukanin13/coolname/blob/416cc39254ab9e921fd5be77dfe6cdafbad0300c/coolname/loader.py#L110-L182
train
Loads a list of words or phrases from a file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsF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,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\x6f' + chr(0b1 + 0o60) + '\x34' + '\066', 0o10), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(0b110000 + 0o77) + chr(51) + chr(48) + chr(51), 0b1000), nzTpIcepk0o8(chr(603 - 555) + '\x6f' + chr(51) + chr(1337 - 1285) + '\063', 0b1000), nzTpIcepk0o8(chr(849 - 801) + chr(111) + chr(0b100100 + 0o15) + chr(242 - 189) + chr(0b100000 + 0o22), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(0b101 + 0o56) + chr(2180 - 2132) + chr(1119 - 1071), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(2570 - 2459) + chr(1639 - 1590) + chr(0b110101) + chr(2323 - 2272), 47386 - 47378), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b10 + 0o60) + chr(0b11111 + 0o21) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1000011 + 0o54) + chr(50) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110011) + chr(48), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1010110 + 0o31) + chr(0b110010) + '\060' + chr(0b110110), 0o10), nzTpIcepk0o8(chr(112 - 64) + '\x6f' + '\062', 0o10), nzTpIcepk0o8('\x30' + chr(0b101101 + 0o102) + chr(50) + '\065' + '\062', 0b1000), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(0b1101111) + '\x31' + chr(55) + chr(2447 - 2392), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\062' + '\062' + chr(2535 - 2483), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(2263 - 2212) + chr(53) + chr(0b110001), 0o10), nzTpIcepk0o8(chr(2149 - 2101) + '\x6f' + '\x31' + '\067' + chr(0b100000 + 0o27), 8), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(0b1101111) + chr(1410 - 1359) + '\x34' + '\x31', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x36' + '\064', 0o10), nzTpIcepk0o8('\060' + chr(111) + '\x31' + '\x32' + '\x35', 0b1000), nzTpIcepk0o8('\060' + chr(11825 - 11714) + chr(518 - 469) + chr(1786 - 1735) + chr(2105 - 2053), 9723 - 9715), nzTpIcepk0o8('\060' + chr(111) + chr(0b100111 + 0o13) + '\x33' + chr(0b10000 + 0o44), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(0b110001) + '\x31', 38888 - 38880), nzTpIcepk0o8(chr(1387 - 1339) + chr(0b1101001 + 0o6) + chr(50) + chr(0b110001) + chr(1951 - 1896), 0b1000), nzTpIcepk0o8(chr(1749 - 1701) + chr(111) + '\x36' + chr(50), 2603 - 2595), nzTpIcepk0o8('\x30' + '\x6f' + chr(87 - 37) + chr(51) + chr(2081 - 2032), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1 + 0o156) + chr(0b110010) + '\x31' + chr(2206 - 2157), 21108 - 21100), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(0b1101111) + '\061' + chr(0b110101) + '\065', 21416 - 21408), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110100) + chr(878 - 829), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(10453 - 10342) + '\x31' + chr(49) + chr(0b110010 + 0o1), 64016 - 64008), nzTpIcepk0o8('\x30' + chr(0b101011 + 0o104) + '\x33' + chr(0b110010) + '\x37', ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(51) + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b11001 + 0o31) + chr(0b11011 + 0o26) + chr(51), 0o10), nzTpIcepk0o8('\x30' + chr(0b1000101 + 0o52) + chr(184 - 129) + chr(756 - 703), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b100010 + 0o115) + '\063' + chr(0b101110 + 0o4), 31608 - 31600), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110010) + chr(0b10100 + 0o35) + chr(0b1110 + 0o45), 8), nzTpIcepk0o8(chr(0b110000) + chr(10785 - 10674) + chr(49) + chr(0b110101) + chr(53), 8), nzTpIcepk0o8('\060' + chr(8712 - 8601) + chr(0b111 + 0o52) + chr(0b101111 + 0o10) + '\066', ord("\x08")), nzTpIcepk0o8(chr(2036 - 1988) + '\x6f' + '\063' + '\060' + chr(0b10100 + 0o42), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(762 - 710) + '\062', 0b1000), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(111) + '\062' + chr(1403 - 1353), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(0b101010 + 0o105) + chr(53) + '\x30', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'H'), chr(0b1100100) + chr(101) + chr(99) + '\x6f' + '\x64' + chr(0b100 + 0o141))(chr(0b101 + 0o160) + '\x74' + chr(6733 - 6631) + chr(45) + chr(604 - 548)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def oJGL_Cds0Noi(SLVB2BPA_mIe, ztC3O2ZXmsJr): Y_nNEzH43vXi = [] CUxaC2NOVhjc = None m9MQLjwzJ7hm = nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(2237 - 2126) + '\060', 33322 - 33314) qQP8sKVIhSoW = None Q8LhwLA5ytju = None for (ZlbFMSG8gCoF, ffiOpFBWGmZU) in _kV_Bomx8PZ4(ztC3O2ZXmsJr, start=nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(111) + chr(0b110001), 0b1000)): ffiOpFBWGmZU = ffiOpFBWGmZU.kdIDrcwZTCs5() if not ffiOpFBWGmZU or roI3spqORKae(ffiOpFBWGmZU, roI3spqORKae(ES5oEprVxulp(b'\x15\xb7\x82\x18\xb4\x18\xf3{l\xee'), chr(100) + '\x65' + chr(0b1100011) + '\157' + '\x64' + chr(10004 - 9903))('\165' + '\x74' + '\146' + '\x2d' + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'E'), chr(0b1100100) + chr(9301 - 9200) + '\143' + chr(0b1101111) + chr(100) + chr(6670 - 6569))('\165' + chr(0b100011 + 0o121) + chr(4637 - 4535) + chr(0b100010 + 0o13) + '\070')): continue if roI3spqORKae(ES5oEprVxulp(b'['), '\144' + '\x65' + chr(0b1001111 + 0o24) + chr(111) + '\144' + chr(9158 - 9057))(chr(117) + '\164' + chr(0b1000101 + 0o41) + '\x2d' + chr(56)) in ffiOpFBWGmZU: if Y_nNEzH43vXi: raise WcuCZt2EFhWM(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'/\xad\x95\x0b\xac\x02\xe02y\xf5q\xc3\x18\xfa\x84\x1a\x8f@u=\xe8i\xe3[\xea\xfdMZj\xa5\xe3\xabQs\xe5\x08^\xbd_(F\xb8\xc2\x18\xbdK\xac}h\xf2k\xc5\x11\xe7\xc9\x12\x94G!|\xfe,\xafV\xfc\xef\x04O.\xb3\xbe\xe9X|\xe4\x1f\x1b\xe6U}\x14\xa7\x90C'), chr(100) + chr(0b1100101) + '\x63' + chr(111) + '\x64' + '\x65')(chr(1721 - 1604) + chr(0b1000010 + 0o62) + chr(102) + chr(45) + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\x17\xf0\xd0!\x87X\xe2}I\xd9A\xe0'), chr(126 - 26) + chr(101) + chr(99) + chr(0b1101111) + chr(0b10111 + 0o115) + '\145')(chr(117) + '\x74' + '\x66' + chr(834 - 789) + '\x38'))(SLVB2BPA_mIe, ZlbFMSG8gCoF, ffiOpFBWGmZU)) try: (hAhcvAlr6Tc_, aRWEOXT2zVXK) = NUKjxND60p6K(ffiOpFBWGmZU) except WbNHlDKpyPtQ as dclkBu6Bdnnh: raise WcuCZt2EFhWM(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'/\xad\x95\x0b\xac\x02\xe02y\xf5q\xc3\x18\xfa\x84\x1a\x8f@u=\xe8i\xe3[\xea\xfdMZj\xa5\xe3\xabQs\xe5\x08^\xbd_(F\xb8\xc2\x18\xbdK\xacie\xaf'), chr(3136 - 3036) + chr(0b1100101) + chr(99) + '\157' + '\x64' + chr(101))('\165' + '\164' + chr(102) + chr(1348 - 1303) + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'\x17\xf0\xd0!\x87X\xe2}I\xd9A\xe0'), chr(0b1100000 + 0o4) + chr(0b1100101) + chr(0b101111 + 0o64) + chr(111) + '\x64' + chr(6837 - 6736))('\165' + '\164' + chr(9977 - 9875) + chr(1742 - 1697) + chr(56)))(SLVB2BPA_mIe, ZlbFMSG8gCoF, ffiOpFBWGmZU, dclkBu6Bdnnh)) if hAhcvAlr6Tc_ == roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'+\x82\xbb5\x8c.\xcaUL\xce'), '\x64' + chr(0b1011 + 0o132) + chr(0b1001000 + 0o33) + chr(0b1010011 + 0o34) + '\144' + chr(0b10101 + 0o120))(chr(117) + chr(0b111011 + 0o71) + '\146' + chr(45) + '\070')): CUxaC2NOVhjc = aRWEOXT2zVXK elif hAhcvAlr6Tc_ == roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'(\x96\xae(\x859\xdb]^\xd9U\xe5-\xd0\xba'), chr(100) + chr(0b1100011 + 0o2) + chr(99) + '\157' + '\x64' + chr(8135 - 8034))(chr(117) + chr(0b1110100) + '\x66' + chr(0b101101) + '\x38')): Q8LhwLA5ytju = aRWEOXT2zVXK continue if not m9MQLjwzJ7hm and roI3spqORKae(Af8y5xmTefsC, roI3spqORKae(ES5oEprVxulp(b'\x0e\xa8\xda%\xa9\x01\xe9{[\xd9x\xeb'), '\144' + chr(101) + '\x63' + chr(0b1101101 + 0o2) + chr(0b1100100) + chr(0b110010 + 0o63))(chr(117) + chr(6279 - 6163) + chr(0b1100110) + chr(0b101101) + '\x38'))(ffiOpFBWGmZU): if CUxaC2NOVhjc is not None and ftfygxgFas5X(ffiOpFBWGmZU) > CUxaC2NOVhjc: raise WcuCZt2EFhWM(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'1\xac\x91\x0e\xe0\x02\xf72l\xe9m\x8a\x13\xfb\x87\x18\xc1U!|\xf0 \xfcF\xb9\xf2LS6\xf7\xf2\xe2S\x7f\xab\x16\x03\xfc\x02iG\xb1\x9e'), chr(100) + chr(131 - 30) + chr(99) + chr(111) + chr(0b1111 + 0o125) + chr(0b101110 + 0o67))(chr(0b1110101) + chr(12184 - 12068) + '\x66' + chr(0b10 + 0o53) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\x17\xf0\xd0!\x87X\xe2}I\xd9A\xe0'), '\144' + chr(4917 - 4816) + '\143' + chr(0b1101111) + '\144' + chr(9616 - 9515))(chr(10478 - 10361) + chr(0b1110100) + chr(102) + chr(0b10101 + 0o30) + '\070'))(SLVB2BPA_mIe, ZlbFMSG8gCoF, ffiOpFBWGmZU)) roI3spqORKae(Y_nNEzH43vXi, roI3spqORKae(ES5oEprVxulp(b'.\x97\xb0^\xb8\x0c\xc3}r\xe9W\x9f'), chr(0b1100100) + chr(101) + '\x63' + chr(0b1101111) + chr(502 - 402) + chr(101))(chr(0b1000111 + 0o56) + chr(2600 - 2484) + '\x66' + chr(342 - 297) + '\x38'))(ffiOpFBWGmZU) elif roI3spqORKae(j59DrrnmhYNr, roI3spqORKae(ES5oEprVxulp(b'\x0e\xa8\xda%\xa9\x01\xe9{[\xd9x\xeb'), chr(0b1100100) + '\x65' + chr(99) + '\x6f' + chr(0b111110 + 0o46) + '\145')('\165' + chr(7491 - 7375) + '\146' + '\055' + '\070'))(ffiOpFBWGmZU): if not m9MQLjwzJ7hm: m9MQLjwzJ7hm = nzTpIcepk0o8(chr(244 - 196) + '\x6f' + chr(0b100000 + 0o21), 8) qQP8sKVIhSoW = ftfygxgFas5X(Y_nNEzH43vXi) Lmp8_Rq7svzn = nfNqtJL5aRaY(ffiOpFBWGmZU.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'F'), chr(0b1111 + 0o125) + chr(101) + chr(0b101000 + 0o73) + chr(3641 - 3530) + chr(100) + chr(101))(chr(0b1011100 + 0o31) + '\164' + chr(102) + '\055' + chr(56)))) if Q8LhwLA5ytju is not None and ftfygxgFas5X(Lmp8_Rq7svzn) != Q8LhwLA5ytju: raise WcuCZt2EFhWM(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'6\xab\x91\x0b\xb3\x0e\xa4zy\xf5"\xd1\x02\xb4\x9e\x10\x93P}/\xb5i\xa7E\xf1\xe0\x01Dk\xb9\xeb\xe6_\x7f\xf92\x11\xa0}e\t\xb1\x87\x19\xfd\x10\xf9;8\xe7v\x8a\x13\xfd\x9a\x0b\xc1Ot.\xe1i\xe3[\xf7\xecMZ6\xed\xbe\xf0\x1ch\xf6'), chr(100) + chr(0b1100101) + chr(0b1100011 + 0o0) + chr(0b1101001 + 0o6) + chr(7555 - 7455) + chr(0b1100101))(chr(1307 - 1190) + chr(116) + chr(0b111000 + 0o56) + chr(0b100111 + 0o6) + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'\x17\xf0\xd0!\x87X\xe2}I\xd9A\xe0'), '\x64' + chr(0b11001 + 0o114) + '\x63' + '\157' + '\144' + chr(0b1100101))('\x75' + chr(0b1100101 + 0o17) + '\x66' + '\055' + chr(2343 - 2287)))(ftfygxgFas5X(Lmp8_Rq7svzn), Q8LhwLA5ytju, SLVB2BPA_mIe, ZlbFMSG8gCoF, ffiOpFBWGmZU)) if CUxaC2NOVhjc is not None and oclC8DLjA_lV((ftfygxgFas5X(bI5jsQ9OkQtj) for bI5jsQ9OkQtj in Lmp8_Rq7svzn)) > CUxaC2NOVhjc: raise WcuCZt2EFhWM(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'6\xab\x91\x0b\xb3\x0e\xa4{k\xa6v\xc5\x10\xb4\x85\x10\x8fSu=\xe8i\xe3[\xea\xfdMZj\xa5\xe3\xabQs\xe5\x08^\xbd_(F\xb8\xc2\x18\xbd'), '\144' + '\x65' + '\x63' + '\x6f' + chr(100) + chr(101))(chr(0b1100010 + 0o23) + chr(0b1010 + 0o152) + '\146' + chr(45) + chr(680 - 624)), roI3spqORKae(ES5oEprVxulp(b'\x17\xf0\xd0!\x87X\xe2}I\xd9A\xe0'), chr(0b10010 + 0o122) + chr(0b1100101) + chr(6858 - 6759) + chr(0b1100011 + 0o14) + chr(100) + '\x65')('\165' + chr(0b1110100) + chr(0b1100110 + 0o0) + '\x2d' + '\070'))(SLVB2BPA_mIe, ZlbFMSG8gCoF, ffiOpFBWGmZU)) roI3spqORKae(Y_nNEzH43vXi, roI3spqORKae(ES5oEprVxulp(b'.\x97\xb0^\xb8\x0c\xc3}r\xe9W\x9f'), chr(0b10101 + 0o117) + chr(0b1100101) + chr(5271 - 5172) + chr(9931 - 9820) + '\144' + chr(0b110100 + 0o61))('\165' + '\164' + '\146' + chr(1129 - 1084) + '\x38'))(Lmp8_Rq7svzn) else: raise WcuCZt2EFhWM(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b"/\xad\x95\x0b\xac\x02\xe02k\xffl\xde\x1e\xec\xc9\x1e\x95\x1495\xef=\xafI\xb8\xfb\x10\x01'\xbe\xf0\xee\x1da\xf6W^\xbd\x03`\x1b"), chr(3969 - 3869) + '\x65' + chr(6222 - 6123) + chr(111) + chr(4738 - 4638) + chr(0b1100101))('\165' + chr(116) + chr(0b1100110) + '\055' + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\x17\xf0\xd0!\x87X\xe2}I\xd9A\xe0'), chr(0b1010100 + 0o20) + '\x65' + '\x63' + chr(111) + chr(100) + chr(3133 - 3032))('\x75' + chr(0b110 + 0o156) + '\146' + chr(1570 - 1525) + '\070'))(SLVB2BPA_mIe, ZlbFMSG8gCoF, ffiOpFBWGmZU)) if m9MQLjwzJ7hm: for ZlbFMSG8gCoF in bbT2xIe5pzk7(nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110000 + 0o0), 8), qQP8sKVIhSoW): Y_nNEzH43vXi[ZlbFMSG8gCoF] = (Y_nNEzH43vXi[ZlbFMSG8gCoF],) POx95m7SPOVy = {konYruLIWsio.FIELD.rFTLz5KWYQRT: konYruLIWsio.TYPE.PHRASES, konYruLIWsio.FIELD.PHRASES: Y_nNEzH43vXi} if Q8LhwLA5ytju is not None: POx95m7SPOVy[konYruLIWsio.FIELD.brdHv8G_9_CN] = Q8LhwLA5ytju else: POx95m7SPOVy = {konYruLIWsio.FIELD.rFTLz5KWYQRT: konYruLIWsio.TYPE.WORDS, konYruLIWsio.FIELD.WORDS: Y_nNEzH43vXi} if CUxaC2NOVhjc is not None: POx95m7SPOVy[konYruLIWsio.FIELD.lGQuxQqRr8Ej] = CUxaC2NOVhjc return POx95m7SPOVy
alexanderlukanin13/coolname
coolname/impl.py
_validate_config
def _validate_config(config): """ A big and ugly method for config validation. It would be nice to use cerberus, but we don't want to introduce dependencies just for that. """ try: referenced_sublists = set() for key, listdef in list(config.items()): # Check if section is a list if not isinstance(listdef, dict): raise ValueError('Value at key {!r} is not a dict' .format(key)) # Check if it has correct type if _CONF.FIELD.TYPE not in listdef: raise ValueError('Config at key {!r} has no {!r}' .format(key, _CONF.FIELD.TYPE)) # Nested or Cartesian if listdef[_CONF.FIELD.TYPE] in (_CONF.TYPE.NESTED, _CONF.TYPE.CARTESIAN): sublists = listdef.get(_CONF.FIELD.LISTS) if sublists is None: raise ValueError('Config at key {!r} has no {!r}' .format(key, _CONF.FIELD.LISTS)) if (not isinstance(sublists, list) or not sublists or not all(_is_str(x) for x in sublists)): raise ValueError('Config at key {!r} has invalid {!r}' .format(key, _CONF.FIELD.LISTS)) referenced_sublists.update(sublists) # Const elif listdef[_CONF.FIELD.TYPE] == _CONF.TYPE.CONST: try: value = listdef[_CONF.FIELD.VALUE] except KeyError: raise ValueError('Config at key {!r} has no {!r}' .format(key, _CONF.FIELD.VALUE)) if not _is_str(value): raise ValueError('Config at key {!r} has invalid {!r}' .format(key, _CONF.FIELD.VALUE)) # Words elif listdef[_CONF.FIELD.TYPE] == _CONF.TYPE.WORDS: try: words = listdef[_CONF.FIELD.WORDS] except KeyError: raise ValueError('Config at key {!r} has no {!r}' .format(key, _CONF.FIELD.WORDS)) if not isinstance(words, list) or not words: raise ValueError('Config at key {!r} has invalid {!r}' .format(key, _CONF.FIELD.WORDS)) # Validate word length try: max_length = int(listdef[_CONF.FIELD.MAX_LENGTH]) except KeyError: max_length = None if max_length is not None: for word in words: if len(word) > max_length: raise ValueError('Config at key {!r} has invalid word {!r} ' '(longer than {} characters)' .format(key, word, max_length)) # Phrases (sequences of one or more words) elif listdef[_CONF.FIELD.TYPE] == _CONF.TYPE.PHRASES: try: phrases = listdef[_CONF.FIELD.PHRASES] except KeyError: raise ValueError('Config at key {!r} has no {!r}' .format(key, _CONF.FIELD.PHRASES)) if not isinstance(phrases, list) or not phrases: raise ValueError('Config at key {!r} has invalid {!r}' .format(key, _CONF.FIELD.PHRASES)) # Validate multi-word and max length try: number_of_words = int(listdef[_CONF.FIELD.NUMBER_OF_WORDS]) except KeyError: number_of_words = None try: max_length = int(listdef[_CONF.FIELD.MAX_LENGTH]) except KeyError: max_length = None for phrase in phrases: phrase = _split_phrase(phrase) # str -> sequence, if necessary if not isinstance(phrase, (tuple, list)) or not all(isinstance(x, _str_types) for x in phrase): raise ValueError('Config at key {!r} has invalid {!r}: ' 'must be all string/tuple/list' .format(key, _CONF.FIELD.PHRASES)) if number_of_words is not None and len(phrase) != number_of_words: raise ValueError('Config at key {!r} has invalid phrase {!r} ' '({} word(s) but {}={})' .format(key, ' '.join(phrase), len(phrase), _CONF.FIELD.NUMBER_OF_WORDS, number_of_words)) if max_length is not None and sum(len(word) for word in phrase) > max_length: raise ValueError('Config at key {!r} has invalid phrase {!r} ' '(longer than {} characters)' .format(key, ' '.join(phrase), max_length)) else: raise ValueError('Config at key {!r} has invalid {!r}' .format(key, _CONF.FIELD.TYPE)) # Check that all sublists are defined diff = referenced_sublists.difference(config.keys()) if diff: raise ValueError('Lists are referenced but not defined: {}' .format(', '.join(sorted(diff)[:10]))) except (KeyError, ValueError) as ex: raise ConfigurationError(str(ex))
python
def _validate_config(config): """ A big and ugly method for config validation. It would be nice to use cerberus, but we don't want to introduce dependencies just for that. """ try: referenced_sublists = set() for key, listdef in list(config.items()): # Check if section is a list if not isinstance(listdef, dict): raise ValueError('Value at key {!r} is not a dict' .format(key)) # Check if it has correct type if _CONF.FIELD.TYPE not in listdef: raise ValueError('Config at key {!r} has no {!r}' .format(key, _CONF.FIELD.TYPE)) # Nested or Cartesian if listdef[_CONF.FIELD.TYPE] in (_CONF.TYPE.NESTED, _CONF.TYPE.CARTESIAN): sublists = listdef.get(_CONF.FIELD.LISTS) if sublists is None: raise ValueError('Config at key {!r} has no {!r}' .format(key, _CONF.FIELD.LISTS)) if (not isinstance(sublists, list) or not sublists or not all(_is_str(x) for x in sublists)): raise ValueError('Config at key {!r} has invalid {!r}' .format(key, _CONF.FIELD.LISTS)) referenced_sublists.update(sublists) # Const elif listdef[_CONF.FIELD.TYPE] == _CONF.TYPE.CONST: try: value = listdef[_CONF.FIELD.VALUE] except KeyError: raise ValueError('Config at key {!r} has no {!r}' .format(key, _CONF.FIELD.VALUE)) if not _is_str(value): raise ValueError('Config at key {!r} has invalid {!r}' .format(key, _CONF.FIELD.VALUE)) # Words elif listdef[_CONF.FIELD.TYPE] == _CONF.TYPE.WORDS: try: words = listdef[_CONF.FIELD.WORDS] except KeyError: raise ValueError('Config at key {!r} has no {!r}' .format(key, _CONF.FIELD.WORDS)) if not isinstance(words, list) or not words: raise ValueError('Config at key {!r} has invalid {!r}' .format(key, _CONF.FIELD.WORDS)) # Validate word length try: max_length = int(listdef[_CONF.FIELD.MAX_LENGTH]) except KeyError: max_length = None if max_length is not None: for word in words: if len(word) > max_length: raise ValueError('Config at key {!r} has invalid word {!r} ' '(longer than {} characters)' .format(key, word, max_length)) # Phrases (sequences of one or more words) elif listdef[_CONF.FIELD.TYPE] == _CONF.TYPE.PHRASES: try: phrases = listdef[_CONF.FIELD.PHRASES] except KeyError: raise ValueError('Config at key {!r} has no {!r}' .format(key, _CONF.FIELD.PHRASES)) if not isinstance(phrases, list) or not phrases: raise ValueError('Config at key {!r} has invalid {!r}' .format(key, _CONF.FIELD.PHRASES)) # Validate multi-word and max length try: number_of_words = int(listdef[_CONF.FIELD.NUMBER_OF_WORDS]) except KeyError: number_of_words = None try: max_length = int(listdef[_CONF.FIELD.MAX_LENGTH]) except KeyError: max_length = None for phrase in phrases: phrase = _split_phrase(phrase) # str -> sequence, if necessary if not isinstance(phrase, (tuple, list)) or not all(isinstance(x, _str_types) for x in phrase): raise ValueError('Config at key {!r} has invalid {!r}: ' 'must be all string/tuple/list' .format(key, _CONF.FIELD.PHRASES)) if number_of_words is not None and len(phrase) != number_of_words: raise ValueError('Config at key {!r} has invalid phrase {!r} ' '({} word(s) but {}={})' .format(key, ' '.join(phrase), len(phrase), _CONF.FIELD.NUMBER_OF_WORDS, number_of_words)) if max_length is not None and sum(len(word) for word in phrase) > max_length: raise ValueError('Config at key {!r} has invalid phrase {!r} ' '(longer than {} characters)' .format(key, ' '.join(phrase), max_length)) else: raise ValueError('Config at key {!r} has invalid {!r}' .format(key, _CONF.FIELD.TYPE)) # Check that all sublists are defined diff = referenced_sublists.difference(config.keys()) if diff: raise ValueError('Lists are referenced but not defined: {}' .format(', '.join(sorted(diff)[:10]))) except (KeyError, ValueError) as ex: raise ConfigurationError(str(ex))
[ "def", "_validate_config", "(", "config", ")", ":", "try", ":", "referenced_sublists", "=", "set", "(", ")", "for", "key", ",", "listdef", "in", "list", "(", "config", ".", "items", "(", ")", ")", ":", "# Check if section is a list", "if", "not", "isinstance", "(", "listdef", ",", "dict", ")", ":", "raise", "ValueError", "(", "'Value at key {!r} is not a dict'", ".", "format", "(", "key", ")", ")", "# Check if it has correct type", "if", "_CONF", ".", "FIELD", ".", "TYPE", "not", "in", "listdef", ":", "raise", "ValueError", "(", "'Config at key {!r} has no {!r}'", ".", "format", "(", "key", ",", "_CONF", ".", "FIELD", ".", "TYPE", ")", ")", "# Nested or Cartesian", "if", "listdef", "[", "_CONF", ".", "FIELD", ".", "TYPE", "]", "in", "(", "_CONF", ".", "TYPE", ".", "NESTED", ",", "_CONF", ".", "TYPE", ".", "CARTESIAN", ")", ":", "sublists", "=", "listdef", ".", "get", "(", "_CONF", ".", "FIELD", ".", "LISTS", ")", "if", "sublists", "is", "None", ":", "raise", "ValueError", "(", "'Config at key {!r} has no {!r}'", ".", "format", "(", "key", ",", "_CONF", ".", "FIELD", ".", "LISTS", ")", ")", "if", "(", "not", "isinstance", "(", "sublists", ",", "list", ")", "or", "not", "sublists", "or", "not", "all", "(", "_is_str", "(", "x", ")", "for", "x", "in", "sublists", ")", ")", ":", "raise", "ValueError", "(", "'Config at key {!r} has invalid {!r}'", ".", "format", "(", "key", ",", "_CONF", ".", "FIELD", ".", "LISTS", ")", ")", "referenced_sublists", ".", "update", "(", "sublists", ")", "# Const", "elif", "listdef", "[", "_CONF", ".", "FIELD", ".", "TYPE", "]", "==", "_CONF", ".", "TYPE", ".", "CONST", ":", "try", ":", "value", "=", "listdef", "[", "_CONF", ".", "FIELD", ".", "VALUE", "]", "except", "KeyError", ":", "raise", "ValueError", "(", "'Config at key {!r} has no {!r}'", ".", "format", "(", "key", ",", "_CONF", ".", "FIELD", ".", "VALUE", ")", ")", "if", "not", "_is_str", "(", "value", ")", ":", "raise", "ValueError", "(", "'Config at key {!r} has invalid {!r}'", ".", "format", "(", "key", ",", "_CONF", ".", "FIELD", ".", "VALUE", ")", ")", "# Words", "elif", "listdef", "[", "_CONF", ".", "FIELD", ".", "TYPE", "]", "==", "_CONF", ".", "TYPE", ".", "WORDS", ":", "try", ":", "words", "=", "listdef", "[", "_CONF", ".", "FIELD", ".", "WORDS", "]", "except", "KeyError", ":", "raise", "ValueError", "(", "'Config at key {!r} has no {!r}'", ".", "format", "(", "key", ",", "_CONF", ".", "FIELD", ".", "WORDS", ")", ")", "if", "not", "isinstance", "(", "words", ",", "list", ")", "or", "not", "words", ":", "raise", "ValueError", "(", "'Config at key {!r} has invalid {!r}'", ".", "format", "(", "key", ",", "_CONF", ".", "FIELD", ".", "WORDS", ")", ")", "# Validate word length", "try", ":", "max_length", "=", "int", "(", "listdef", "[", "_CONF", ".", "FIELD", ".", "MAX_LENGTH", "]", ")", "except", "KeyError", ":", "max_length", "=", "None", "if", "max_length", "is", "not", "None", ":", "for", "word", "in", "words", ":", "if", "len", "(", "word", ")", ">", "max_length", ":", "raise", "ValueError", "(", "'Config at key {!r} has invalid word {!r} '", "'(longer than {} characters)'", ".", "format", "(", "key", ",", "word", ",", "max_length", ")", ")", "# Phrases (sequences of one or more words)", "elif", "listdef", "[", "_CONF", ".", "FIELD", ".", "TYPE", "]", "==", "_CONF", ".", "TYPE", ".", "PHRASES", ":", "try", ":", "phrases", "=", "listdef", "[", "_CONF", ".", "FIELD", ".", "PHRASES", "]", "except", "KeyError", ":", "raise", "ValueError", "(", "'Config at key {!r} has no {!r}'", ".", "format", "(", "key", ",", "_CONF", ".", "FIELD", ".", "PHRASES", ")", ")", "if", "not", "isinstance", "(", "phrases", ",", "list", ")", "or", "not", "phrases", ":", "raise", "ValueError", "(", "'Config at key {!r} has invalid {!r}'", ".", "format", "(", "key", ",", "_CONF", ".", "FIELD", ".", "PHRASES", ")", ")", "# Validate multi-word and max length", "try", ":", "number_of_words", "=", "int", "(", "listdef", "[", "_CONF", ".", "FIELD", ".", "NUMBER_OF_WORDS", "]", ")", "except", "KeyError", ":", "number_of_words", "=", "None", "try", ":", "max_length", "=", "int", "(", "listdef", "[", "_CONF", ".", "FIELD", ".", "MAX_LENGTH", "]", ")", "except", "KeyError", ":", "max_length", "=", "None", "for", "phrase", "in", "phrases", ":", "phrase", "=", "_split_phrase", "(", "phrase", ")", "# str -> sequence, if necessary", "if", "not", "isinstance", "(", "phrase", ",", "(", "tuple", ",", "list", ")", ")", "or", "not", "all", "(", "isinstance", "(", "x", ",", "_str_types", ")", "for", "x", "in", "phrase", ")", ":", "raise", "ValueError", "(", "'Config at key {!r} has invalid {!r}: '", "'must be all string/tuple/list'", ".", "format", "(", "key", ",", "_CONF", ".", "FIELD", ".", "PHRASES", ")", ")", "if", "number_of_words", "is", "not", "None", "and", "len", "(", "phrase", ")", "!=", "number_of_words", ":", "raise", "ValueError", "(", "'Config at key {!r} has invalid phrase {!r} '", "'({} word(s) but {}={})'", ".", "format", "(", "key", ",", "' '", ".", "join", "(", "phrase", ")", ",", "len", "(", "phrase", ")", ",", "_CONF", ".", "FIELD", ".", "NUMBER_OF_WORDS", ",", "number_of_words", ")", ")", "if", "max_length", "is", "not", "None", "and", "sum", "(", "len", "(", "word", ")", "for", "word", "in", "phrase", ")", ">", "max_length", ":", "raise", "ValueError", "(", "'Config at key {!r} has invalid phrase {!r} '", "'(longer than {} characters)'", ".", "format", "(", "key", ",", "' '", ".", "join", "(", "phrase", ")", ",", "max_length", ")", ")", "else", ":", "raise", "ValueError", "(", "'Config at key {!r} has invalid {!r}'", ".", "format", "(", "key", ",", "_CONF", ".", "FIELD", ".", "TYPE", ")", ")", "# Check that all sublists are defined", "diff", "=", "referenced_sublists", ".", "difference", "(", "config", ".", "keys", "(", ")", ")", "if", "diff", ":", "raise", "ValueError", "(", "'Lists are referenced but not defined: {}'", ".", "format", "(", "', '", ".", "join", "(", "sorted", "(", "diff", ")", "[", ":", "10", "]", ")", ")", ")", "except", "(", "KeyError", ",", "ValueError", ")", "as", "ex", ":", "raise", "ConfigurationError", "(", "str", "(", "ex", ")", ")" ]
A big and ugly method for config validation. It would be nice to use cerberus, but we don't want to introduce dependencies just for that.
[ "A", "big", "and", "ugly", "method", "for", "config", "validation", ".", "It", "would", "be", "nice", "to", "use", "cerberus", "but", "we", "don", "t", "want", "to", "introduce", "dependencies", "just", "for", "that", "." ]
416cc39254ab9e921fd5be77dfe6cdafbad0300c
https://github.com/alexanderlukanin13/coolname/blob/416cc39254ab9e921fd5be77dfe6cdafbad0300c/coolname/impl.py#L403-L505
train
Validate the config and return a set of all the relevant resources.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,u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_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b100101 + 0o14) + chr(55) + '\x30', 30573 - 30565), nzTpIcepk0o8(chr(48) + chr(0b1000101 + 0o52) + chr(49) + '\067' + chr(48), 8), nzTpIcepk0o8(chr(680 - 632) + '\157' + chr(0b10000 + 0o42) + '\061' + chr(0b110100), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\063' + chr(0b110010) + chr(637 - 588), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(1869 - 1821) + '\157' + '\x32' + '\065' + chr(52), 0o10), nzTpIcepk0o8(chr(183 - 135) + chr(0b1101111) + '\x31' + '\x36' + chr(49), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + chr(50) + chr(55), 50799 - 50791), nzTpIcepk0o8(chr(48) + chr(111) + chr(1409 - 1359) + chr(0b110010 + 0o3) + '\x37', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101000 + 0o7) + chr(0b1011 + 0o50) + '\x32' + chr(0b1001 + 0o51), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110001) + chr(2210 - 2162) + '\x34', 0b1000), nzTpIcepk0o8('\x30' + chr(6631 - 6520) + '\x33' + chr(0b110110) + chr(0b110110), 45554 - 45546), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + chr(0b11101 + 0o24) + chr(0b1010 + 0o46), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\064' + chr(0b100110 + 0o17), 0o10), nzTpIcepk0o8('\060' + chr(111) + '\x33' + '\064', 0o10), nzTpIcepk0o8(chr(2013 - 1965) + '\x6f' + chr(0b110010 + 0o0) + chr(0b110100) + chr(246 - 194), ord("\x08")), nzTpIcepk0o8('\060' + chr(6949 - 6838) + chr(0b11011 + 0o30) + '\060' + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(0b1010 + 0o145) + chr(0b11001 + 0o32) + chr(0b110101) + chr(0b110001), 4800 - 4792), nzTpIcepk0o8(chr(48) + chr(0b1001001 + 0o46) + chr(49) + chr(49) + chr(51), 0o10), nzTpIcepk0o8(chr(48) + chr(0b11101 + 0o122) + chr(0b100101 + 0o15) + '\x37' + chr(0b101 + 0o62), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + '\x35', 39274 - 39266), nzTpIcepk0o8(chr(48) + chr(2901 - 2790) + chr(0b10110 + 0o41) + chr(50), 0b1000), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(6384 - 6273) + chr(0b110001) + '\064' + '\063', 53087 - 53079), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(951 - 900) + chr(1791 - 1736) + '\067', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110010) + '\x34' + '\064', 8), nzTpIcepk0o8('\x30' + '\x6f' + chr(692 - 642) + chr(0b1000 + 0o53), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\063' + chr(0b10110 + 0o40), 29790 - 29782), nzTpIcepk0o8(chr(0b110000) + chr(0b110000 + 0o77) + chr(0b110001) + chr(0b110011) + '\x34', 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011) + '\063' + chr(0b110111), 0o10), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(0b1011011 + 0o24) + chr(0b110010) + chr(0b100111 + 0o13) + '\062', 62278 - 62270), nzTpIcepk0o8('\060' + chr(1071 - 960) + chr(0b101001 + 0o14) + '\x35', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1000111 + 0o50) + chr(52) + chr(51), 0b1000), nzTpIcepk0o8(chr(1359 - 1311) + chr(0b1101111) + '\x37' + chr(0b10100 + 0o43), 0b1000), nzTpIcepk0o8(chr(1013 - 965) + '\x6f' + chr(0b101100 + 0o7), 0o10), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(0b1101111) + chr(0b1001 + 0o50) + '\067' + chr(0b11010 + 0o27), 58520 - 58512), nzTpIcepk0o8('\060' + '\157' + chr(51) + '\x33' + '\066', 0o10), nzTpIcepk0o8(chr(0b101110 + 0o2) + '\x6f' + chr(0b10110 + 0o33) + chr(0b110000) + chr(0b10 + 0o60), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\x32' + chr(0b100111 + 0o20) + '\x34', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(1352 - 1301) + chr(0b110001) + chr(0b110001), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\062' + '\065' + chr(53), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(871 - 818) + chr(0b110000), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'V'), chr(0b1100100) + chr(529 - 428) + chr(0b1100011) + chr(0b10101 + 0o132) + chr(0b1100100) + chr(0b100100 + 0o101))('\165' + chr(0b10011 + 0o141) + chr(4592 - 4490) + chr(45) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def nu9rp9GaV7Sm(kgkKUcD36lls): try: vAbmySWUHU7s = Bvi71nNyvlqO() for (QYodcsDtoGq7, bXJ4kffR7D8e) in H4NoA26ON7iG(roI3spqORKae(kgkKUcD36lls, roI3spqORKae(ES5oEprVxulp(b"!'\xe2\x9f^\xd69\xa3\x9c\xa4\x1c\x9f"), chr(0b110100 + 0o60) + chr(101) + chr(0b1010111 + 0o14) + '\x6f' + '\x64' + '\x65')(chr(117) + chr(116) + '\x66' + chr(0b10011 + 0o32) + chr(0b101111 + 0o11)))()): if not suIjIS24Zkqw(bXJ4kffR7D8e, znjnJWK64FDT): raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'.\x19\xe0\xa4~\x8c\x10\xe3\x8f\xb9!\x8fh^=\xd6\xbd\xc9"\xcc5T\x0c\x8b\x84r>8\xb6\xf1Y'), '\x64' + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(0b110101 + 0o60))(chr(1345 - 1228) + chr(0b1110001 + 0o3) + chr(0b1011001 + 0o15) + '\x2d' + chr(0b101 + 0o63)), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), '\x64' + '\x65' + chr(0b100101 + 0o76) + '\x6f' + '\144' + '\x65')(chr(0b1110101) + chr(0b1000101 + 0o57) + chr(3948 - 3846) + chr(45) + '\x38'))(QYodcsDtoGq7)) if roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'\n>\xd8\x9da\x99:\xc0\xf6\x83\x16\xa2'), chr(0b1010100 + 0o20) + chr(4710 - 4609) + chr(1145 - 1046) + '\157' + '\144' + chr(101))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(0b10 + 0o53) + '\070')) not in bXJ4kffR7D8e: raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b';\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x91\xcb3e}\xad\xef'), chr(0b111110 + 0o46) + '\145' + '\143' + '\x6f' + chr(0b1100100) + chr(0b11010 + 0o113))(chr(7452 - 7335) + '\164' + '\146' + chr(0b101101) + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), chr(100) + chr(0b1100101) + chr(3783 - 3684) + chr(11550 - 11439) + chr(0b1100100) + chr(0b1100101))(chr(0b100010 + 0o123) + '\164' + chr(102) + chr(0b101011 + 0o2) + '\x38'))(QYodcsDtoGq7, roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'\n>\xd8\x9da\x99:\xc0\xf6\x83\x16\xa2'), chr(3381 - 3281) + chr(0b1100101) + chr(9045 - 8946) + '\157' + chr(100) + '\x65')(chr(0b1110101) + chr(2461 - 2345) + chr(0b1100110) + chr(45) + '\070')))) if bXJ4kffR7D8e[roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'\n>\xd8\x9da\x99:\xc0\xf6\x83\x16\xa2'), chr(0b1100100) + '\x65' + chr(99) + chr(9154 - 9043) + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(0b11100 + 0o130) + '\x66' + '\055' + chr(0b111000)))] in (roI3spqORKae(konYruLIWsio.TYPE, roI3spqORKae(ES5oEprVxulp(b'6=\xdf\x85^\xe8'), chr(7174 - 7074) + '\145' + '\x63' + chr(111) + chr(0b1100100) + chr(4059 - 3958))(chr(117) + '\164' + chr(0b1100110) + '\055' + chr(2937 - 2881))), roI3spqORKae(konYruLIWsio.TYPE, roI3spqORKae(ES5oEprVxulp(b';9\xde\x85^\xff8\xd6\xe1'), chr(0b1100100) + chr(101) + '\x63' + chr(111) + chr(0b1010 + 0o132) + chr(7821 - 7720))(chr(2653 - 2536) + chr(116) + chr(0b1100 + 0o132) + chr(0b10011 + 0o32) + chr(0b100101 + 0o23)))): h1odELaweRhD = bXJ4kffR7D8e.GUKetu4xaGsJ(konYruLIWsio.FIELD.LISTS) if h1odELaweRhD is None: raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b';\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x91\xcb3e}\xad\xef'), chr(0b11001 + 0o113) + chr(6661 - 6560) + chr(0b1100011) + '\x6f' + '\x64' + chr(101))(chr(0b1101011 + 0o12) + chr(0b1 + 0o163) + chr(102) + chr(0b101000 + 0o5) + chr(0b1010 + 0o56)), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), chr(100) + '\145' + '\143' + chr(6016 - 5905) + chr(100) + chr(0b100101 + 0o100))(chr(0b101100 + 0o111) + '\x74' + '\146' + chr(45) + chr(0b111000)))(QYodcsDtoGq7, roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'41\xdf\x85H'), '\144' + chr(101) + '\x63' + chr(111) + chr(8639 - 8539) + chr(10042 - 9941))(chr(117) + '\x74' + chr(5261 - 5159) + chr(45) + chr(325 - 269))))) if not suIjIS24Zkqw(h1odELaweRhD, H4NoA26ON7iG) or not h1odELaweRhD or (not qX60lO1lgHA5((iMCl2A6JaKc0(bI5jsQ9OkQtj) for bI5jsQ9OkQtj in h1odELaweRhD))): raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b';\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x96\xcae\x7f0\xb6\xf6\rX\x1eq\x04'), chr(100) + chr(0b10 + 0o143) + chr(0b1100011) + chr(1559 - 1448) + chr(0b1100100) + chr(0b11 + 0o142))(chr(0b1110101) + chr(8790 - 8674) + chr(6277 - 6175) + chr(45) + chr(0b11011 + 0o35)), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), chr(361 - 261) + '\145' + chr(3203 - 3104) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(4243 - 4127) + chr(0b101000 + 0o76) + chr(45) + '\x38'))(QYodcsDtoGq7, roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'41\xdf\x85H'), '\x64' + chr(0b1100101) + '\143' + chr(111) + chr(2620 - 2520) + chr(0b1100101))('\165' + chr(116) + chr(102) + chr(1185 - 1140) + '\x38')))) roI3spqORKae(vAbmySWUHU7s, roI3spqORKae(ES5oEprVxulp(b"2'\xe7\xe3R\xf53\xa6\xcc\xb75\x98"), chr(8864 - 8764) + chr(0b10 + 0o143) + chr(99) + '\x6f' + chr(0b1111 + 0o125) + chr(101))(chr(0b1110101) + chr(13298 - 13182) + chr(2325 - 2223) + '\x2d' + chr(874 - 818)))(h1odELaweRhD) elif bXJ4kffR7D8e[roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'\n>\xd8\x9da\x99:\xc0\xf6\x83\x16\xa2'), chr(100) + chr(0b1100101) + chr(0b110110 + 0o55) + chr(5829 - 5718) + '\144' + '\145')(chr(0b1110101) + chr(0b101001 + 0o113) + chr(0b1100110) + chr(45) + chr(0b100001 + 0o27)))] == roI3spqORKae(konYruLIWsio.TYPE, roI3spqORKae(ES5oEprVxulp(b';7\xc2\x82O'), '\x64' + chr(101) + chr(99) + chr(894 - 783) + chr(100) + chr(0b1100101))(chr(117) + '\164' + chr(0b1100110) + chr(1141 - 1096) + chr(0b111000))): try: uV9iBiw0y_Mp = bXJ4kffR7D8e[konYruLIWsio.FIELD.VALUE] except knUxyjfq07F9: raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b';\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x91\xcb3e}\xad\xef'), chr(0b1100100) + '\145' + '\x63' + chr(0b1011000 + 0o27) + chr(1251 - 1151) + '\x65')('\165' + '\164' + chr(102) + chr(45) + chr(675 - 619)), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), chr(100) + '\145' + chr(0b100001 + 0o102) + chr(111) + chr(0b1100100) + chr(0b1000001 + 0o44))(chr(117) + '\x74' + chr(0b1011111 + 0o7) + chr(931 - 886) + chr(2616 - 2560)))(QYodcsDtoGq7, roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'.9\xc0\x84^'), chr(3179 - 3079) + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\x64' + chr(0b1011000 + 0o15))('\x75' + chr(11876 - 11760) + chr(8987 - 8885) + chr(0b101011 + 0o2) + '\070')))) if not iMCl2A6JaKc0(uV9iBiw0y_Mp): raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b';\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x96\xcae\x7f0\xb6\xf6\rX\x1eq\x04'), '\x64' + chr(101) + chr(0b100000 + 0o103) + chr(3268 - 3157) + chr(100) + chr(101))(chr(0b1110101) + '\x74' + '\x66' + '\x2d' + chr(535 - 479)), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), chr(0b1001011 + 0o31) + chr(0b110110 + 0o57) + chr(99) + chr(0b1101111) + chr(4551 - 4451) + '\145')(chr(0b10110 + 0o137) + chr(6139 - 6023) + chr(102) + '\x2d' + chr(0b111000)))(QYodcsDtoGq7, roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'.9\xc0\x84^'), '\x64' + chr(1048 - 947) + '\143' + '\x6f' + chr(0b1010101 + 0o17) + chr(101))('\165' + chr(116) + chr(10239 - 10137) + '\x2d' + chr(56))))) elif bXJ4kffR7D8e[roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'\n>\xd8\x9da\x99:\xc0\xf6\x83\x16\xa2'), '\x64' + chr(5392 - 5291) + chr(3054 - 2955) + chr(0b10110 + 0o131) + '\x64' + chr(0b1001011 + 0o32))(chr(0b100000 + 0o125) + '\164' + '\146' + chr(1828 - 1783) + chr(56)))] == roI3spqORKae(konYruLIWsio.TYPE, roI3spqORKae(ES5oEprVxulp(b'/7\xde\x95H'), '\144' + chr(0b1100101) + chr(0b1010000 + 0o23) + chr(111) + '\144' + '\145')('\x75' + '\x74' + chr(10270 - 10168) + '\055' + chr(0b111000))): try: cHmedxd8XMtK = bXJ4kffR7D8e[konYruLIWsio.FIELD.WORDS] except knUxyjfq07F9: raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b';\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x91\xcb3e}\xad\xef'), chr(0b1 + 0o143) + chr(0b1011110 + 0o7) + chr(6619 - 6520) + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1110101) + '\164' + '\x66' + chr(0b101101) + '\070'), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), '\x64' + chr(0b1100101) + '\143' + chr(0b1001010 + 0o45) + chr(100) + chr(0b1100101))('\x75' + chr(12488 - 12372) + '\x66' + chr(45) + '\x38'))(QYodcsDtoGq7, roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'/7\xde\x95H'), chr(0b1100100) + chr(0b110010 + 0o63) + chr(0b100100 + 0o77) + chr(9855 - 9744) + chr(100) + chr(8216 - 8115))(chr(117) + chr(116) + chr(0b1100110) + chr(45) + chr(0b111000))))) if not suIjIS24Zkqw(cHmedxd8XMtK, H4NoA26ON7iG) or not cHmedxd8XMtK: raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b';\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x96\xcae\x7f0\xb6\xf6\rX\x1eq\x04'), chr(100) + '\x65' + '\x63' + chr(111) + chr(100) + chr(1887 - 1786))(chr(9392 - 9275) + chr(6497 - 6381) + chr(0b1011101 + 0o11) + chr(0b101101) + chr(2642 - 2586)), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), chr(3173 - 3073) + '\145' + chr(0b110011 + 0o60) + chr(0b1101111) + '\144' + chr(0b1101 + 0o130))(chr(117) + '\164' + chr(1803 - 1701) + chr(528 - 483) + chr(56)))(QYodcsDtoGq7, roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'/7\xde\x95H'), '\x64' + chr(5914 - 5813) + chr(0b1100011) + chr(111) + chr(0b1000000 + 0o44) + chr(0b1100101))(chr(117) + chr(10065 - 9949) + '\146' + chr(703 - 658) + chr(0b111000))))) try: CUxaC2NOVhjc = nzTpIcepk0o8(bXJ4kffR7D8e[konYruLIWsio.FIELD.lGQuxQqRr8Ej]) except knUxyjfq07F9: CUxaC2NOVhjc = None if CUxaC2NOVhjc is not None: for JXVFyF8k4nGR in cHmedxd8XMtK: if ftfygxgFas5X(JXVFyF8k4nGR) > CUxaC2NOVhjc: raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b';\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x96\xcae\x7f0\xb6\xf6\rTPq\x1d\xfe9\x9d\xbb\xd0XP\xe0\xbeu\xcb\x14\xe5\x8f\xa6,\x97&\x05g\xd9\xe0\x8a#\xdeg[\x00\x8b\xc1amu'), chr(0b111000 + 0o54) + chr(0b10101 + 0o120) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(101))(chr(0b101000 + 0o115) + '\164' + chr(0b1100110) + '\x2d' + '\070'), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), chr(0b1100100) + chr(101) + chr(0b1100011) + '\157' + '\144' + chr(4172 - 4071))(chr(0b1110010 + 0o3) + '\x74' + chr(102) + '\055' + '\070'))(QYodcsDtoGq7, JXVFyF8k4nGR, CUxaC2NOVhjc)) elif bXJ4kffR7D8e[roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'\n>\xd8\x9da\x99:\xc0\xf6\x83\x16\xa2'), '\144' + chr(0b11010 + 0o113) + chr(0b1100011) + '\x6f' + chr(0b10101 + 0o117) + '\x65')(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(45) + chr(113 - 57)))] == roI3spqORKae(konYruLIWsio.TYPE, roI3spqORKae(ES5oEprVxulp(b'(0\xde\x90H\xe9"'), chr(0b1100100) + chr(8817 - 8716) + chr(0b1100011) + chr(0b1001111 + 0o40) + chr(9534 - 9434) + chr(0b10001 + 0o124))('\x75' + chr(0b1110100) + chr(102) + chr(0b11110 + 0o17) + chr(2753 - 2697))): try: mVQWSnnvsw8W = bXJ4kffR7D8e[konYruLIWsio.FIELD.PHRASES] except knUxyjfq07F9: raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b';\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x91\xcb3e}\xad\xef'), '\x64' + chr(0b1001 + 0o134) + '\x63' + chr(111) + chr(0b1100100) + chr(0b110100 + 0o61))(chr(0b1110101) + chr(116) + '\x66' + chr(632 - 587) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), chr(0b1001000 + 0o34) + chr(6721 - 6620) + chr(5856 - 5757) + chr(9359 - 9248) + chr(3639 - 3539) + '\145')(chr(0b1011 + 0o152) + chr(116) + chr(102) + chr(45) + '\070'))(QYodcsDtoGq7, roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'(0\xde\x90H\xe9"'), '\144' + chr(1363 - 1262) + chr(0b1110 + 0o125) + chr(8721 - 8610) + chr(100) + chr(0b1100101))(chr(117) + chr(116) + '\x66' + chr(0b1011 + 0o42) + chr(0b11010 + 0o36))))) if not suIjIS24Zkqw(mVQWSnnvsw8W, H4NoA26ON7iG) or not mVQWSnnvsw8W: raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b';\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x96\xcae\x7f0\xb6\xf6\rX\x1eq\x04'), chr(100) + chr(101) + chr(0b101 + 0o136) + chr(0b1000101 + 0o52) + chr(4292 - 4192) + '\x65')(chr(117) + chr(0b101 + 0o157) + chr(6906 - 6804) + chr(0b1110 + 0o37) + chr(0b11101 + 0o33)), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), '\x64' + chr(0b1111 + 0o126) + chr(3099 - 3000) + '\x6f' + chr(0b11011 + 0o111) + '\x65')('\165' + '\164' + chr(0b1100110) + chr(0b101101) + chr(56)))(QYodcsDtoGq7, roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'(0\xde\x90H\xe9"'), chr(128 - 28) + chr(0b1111 + 0o126) + chr(0b1100011) + chr(0b1101010 + 0o5) + '\x64' + chr(101))(chr(117) + '\164' + '\x66' + '\055' + '\x38')))) try: Q8LhwLA5ytju = nzTpIcepk0o8(bXJ4kffR7D8e[konYruLIWsio.FIELD.brdHv8G_9_CN]) except knUxyjfq07F9: Q8LhwLA5ytju = None try: CUxaC2NOVhjc = nzTpIcepk0o8(bXJ4kffR7D8e[konYruLIWsio.FIELD.lGQuxQqRr8Ej]) except knUxyjfq07F9: CUxaC2NOVhjc = None for Lmp8_Rq7svzn in mVQWSnnvsw8W: Lmp8_Rq7svzn = buktJQorKqZA(Lmp8_Rq7svzn) if not suIjIS24Zkqw(Lmp8_Rq7svzn, (nfNqtJL5aRaY, H4NoA26ON7iG)) or not qX60lO1lgHA5((suIjIS24Zkqw(bI5jsQ9OkQtj, jNXm_takpofM) for bI5jsQ9OkQtj in Lmp8_Rq7svzn)): raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b';\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x96\xcae\x7f0\xb6\xf6\rX\x1eq\x04\xe4b\xd1\xbc\xde\x0cX\xee\xb4;\xcd\x1d\xfb\x8f\xa10\x84!K{\x8b\xb4\x9c;\xd3p\x15\x0f\x96\xd7g'), '\x64' + chr(0b101011 + 0o72) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(2007 - 1906))(chr(10305 - 10188) + chr(0b101000 + 0o114) + chr(8959 - 8857) + '\x2d' + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), chr(0b1100100) + chr(0b1100101) + chr(8666 - 8567) + chr(0b1101111) + '\144' + chr(0b1100001 + 0o4))(chr(117) + chr(9031 - 8915) + chr(0b1100011 + 0o3) + chr(0b11101 + 0o20) + chr(1071 - 1015)))(QYodcsDtoGq7, roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'(0\xde\x90H\xe9"'), chr(0b10101 + 0o117) + '\145' + chr(0b1100011) + chr(111) + chr(0b1000101 + 0o37) + chr(0b1100101))(chr(117) + '\164' + chr(0b1100110) + chr(45) + chr(56))))) if Q8LhwLA5ytju is not None and ftfygxgFas5X(Lmp8_Rq7svzn) != Q8LhwLA5ytju: raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b";\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x96\xcae\x7f0\xb6\xf6\rSWq\x18\xad'\x9c\xb2\x8c\n\x05\xac\xf9`\xd1Q\xe0\xc0\xa0 \xde;\x0c<\xc6\xb5\x9dk\xc4h\x07\x18\x82\x8d"), chr(0b1100100) + chr(101) + chr(99) + '\x6f' + chr(0b1100100) + chr(0b100011 + 0o102))(chr(3712 - 3595) + chr(3773 - 3657) + chr(0b1100110) + '\x2d' + chr(0b11100 + 0o34)), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), '\144' + chr(0b1100010 + 0o3) + chr(0b10101 + 0o116) + '\x6f' + chr(2128 - 2028) + chr(101))(chr(0b11110 + 0o127) + chr(0b1110100) + '\146' + chr(0b101101) + '\070'))(QYodcsDtoGq7, roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'X'), chr(100) + '\x65' + chr(99) + '\x6f' + chr(8157 - 8057) + chr(101))(chr(500 - 383) + chr(0b1010011 + 0o41) + chr(102) + chr(550 - 505) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'!L\xf5\x9c"\xee\x12\xf1\xfb\x91\n\x87'), chr(4744 - 4644) + '\145' + '\143' + chr(0b1101111) + '\x64' + chr(0b10 + 0o143))(chr(10975 - 10858) + '\164' + chr(0b1100110) + chr(1459 - 1414) + '\070'))(Lmp8_Rq7svzn), ftfygxgFas5X(Lmp8_Rq7svzn), roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'\x1a\n\xe8\x99m\x946\xc8\x96\x8d\x07\xb8'), chr(9999 - 9899) + '\x65' + chr(0b1010001 + 0o22) + chr(0b1101111) + chr(6896 - 6796) + chr(5283 - 5182))(chr(117) + '\164' + '\x66' + '\x2d' + '\x38')), Q8LhwLA5ytju)) if CUxaC2NOVhjc is not None and oclC8DLjA_lV((ftfygxgFas5X(JXVFyF8k4nGR) for JXVFyF8k4nGR in Lmp8_Rq7svzn)) > CUxaC2NOVhjc: raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b";\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x96\xcae\x7f0\xb6\xf6\rSWq\x18\xad'\x9c\xb2\x8c\n\x05\xac\xf9w\xc3\x1f\xf0\xca\xa0d\x82 Dr\x84\xbb\x94k\xdc}[\x11\x9e\xc7g{.\xac\xbb"), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(0b10111 + 0o130) + chr(0b101000 + 0o74) + chr(101))(chr(0b101111 + 0o106) + '\x74' + '\x66' + chr(45) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), chr(7049 - 6949) + '\x65' + chr(99) + chr(751 - 640) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(0b1101111 + 0o5) + '\x66' + chr(45) + chr(56)))(QYodcsDtoGq7, roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'X'), '\x64' + '\145' + '\x63' + chr(2608 - 2497) + '\144' + chr(101))(chr(10473 - 10356) + chr(0b100011 + 0o121) + chr(3278 - 3176) + '\x2d' + chr(538 - 482)), roI3spqORKae(ES5oEprVxulp(b'!L\xf5\x9c"\xee\x12\xf1\xfb\x91\n\x87'), '\144' + chr(0b101101 + 0o70) + '\x63' + chr(0b1011101 + 0o22) + '\144' + chr(9070 - 8969))(chr(0b111111 + 0o66) + '\164' + chr(9690 - 9588) + chr(351 - 306) + '\070'))(Lmp8_Rq7svzn), CUxaC2NOVhjc)) else: raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b';\x17\xe2\xb7r\xcbQ\xf6\xdb\xf2/\x931\x05g\x85\xb2\x94k\xd7tIC\x96\xcae\x7f0\xb6\xf6\rX\x1eq\x04'), chr(100) + chr(4244 - 4143) + chr(99) + chr(111) + '\144' + '\145')('\x75' + '\164' + chr(0b1100110) + '\x2d' + chr(0b11110 + 0o32)), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), chr(100) + '\145' + chr(0b111 + 0o134) + '\157' + chr(0b1010 + 0o132) + chr(0b1010111 + 0o16))(chr(0b100111 + 0o116) + '\x74' + chr(0b1100110) + '\055' + chr(56)))(QYodcsDtoGq7, roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'\n>\xd8\x9da\x99:\xc0\xf6\x83\x16\xa2'), chr(0b1011011 + 0o11) + chr(101) + '\x63' + chr(10224 - 10113) + chr(0b10011 + 0o121) + chr(0b1100101))('\165' + chr(0b1000111 + 0o55) + chr(0b1000111 + 0o37) + '\x2d' + '\070')))) H5XQ4iF_jpSm = vAbmySWUHU7s.difference(kgkKUcD36lls.keys()) if H5XQ4iF_jpSm: raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'4\x11\xff\xa5h\x8c\x10\xe5\xca\xf26\x93.@n\xc1\xae\x8a.\xdb5X\x16\x8b\x84}q(\xff\xf6HEVm\x1c\xbax\x9c\xb2\xd0'), chr(100) + '\145' + chr(0b1100011) + '\x6f' + chr(6827 - 6727) + chr(0b1100101))(chr(5407 - 5290) + '\164' + '\146' + chr(0b1111 + 0o36) + '\070'), roI3spqORKae(ES5oEprVxulp(b'\tK\xbf\x9a\\\x9f\x17\xf8\xfe\x8d\x07\xbc'), chr(100) + chr(0b1011 + 0o132) + '\x63' + chr(0b11011 + 0o124) + chr(0b101010 + 0o72) + '\x65')('\165' + chr(4142 - 4026) + chr(0b1100110) + chr(45) + chr(2258 - 2202)))(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'TX'), chr(100) + chr(0b1011001 + 0o14) + '\143' + chr(8942 - 8831) + chr(0b1100100) + chr(0b110 + 0o137))(chr(0b1110101) + '\x74' + chr(0b1001011 + 0o33) + '\055' + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'!L\xf5\x9c"\xee\x12\xf1\xfb\x91\n\x87'), '\144' + '\145' + '\143' + chr(0b1101110 + 0o1) + chr(100) + chr(0b1100101))(chr(117) + chr(2406 - 2290) + chr(8960 - 8858) + chr(0b101101) + '\x38'))(V3OlOVg98A85(H5XQ4iF_jpSm)[:nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(1025 - 975), 16574 - 16566)]))) except (knUxyjfq07F9, WbNHlDKpyPtQ) as dclkBu6Bdnnh: raise WcuCZt2EFhWM(N9zlRy29S1SS(dclkBu6Bdnnh))
alexanderlukanin13/coolname
coolname/impl.py
_create_lists
def _create_lists(config, results, current, stack, inside_cartesian=None): """ An ugly recursive method to transform config dict into a tree of AbstractNestedList. """ # Have we done it already? try: return results[current] except KeyError: pass # Check recursion depth and detect loops if current in stack: raise ConfigurationError('Rule {!r} is recursive: {!r}'.format(stack[0], stack)) if len(stack) > 99: raise ConfigurationError('Rule {!r} is too deep'.format(stack[0])) # Track recursion depth stack.append(current) try: # Check what kind of list we have listdef = config[current] list_type = listdef[_CONF.FIELD.TYPE] # 1. List of words if list_type == _CONF.TYPE.WORDS: results[current] = WordList(listdef['words']) # List of phrases elif list_type == _CONF.TYPE.PHRASES: results[current] = PhraseList(listdef['phrases']) # 2. Simple list of lists elif list_type == _CONF.TYPE.NESTED: results[current] = NestedList([_create_lists(config, results, x, stack, inside_cartesian=inside_cartesian) for x in listdef[_CONF.FIELD.LISTS]]) # 3. Cartesian list of lists elif list_type == _CONF.TYPE.CARTESIAN: if inside_cartesian is not None: raise ConfigurationError("Cartesian list {!r} contains another Cartesian list " "{!r}. Nested Cartesian lists are not allowed." .format(inside_cartesian, current)) results[current] = CartesianList([_create_lists(config, results, x, stack, inside_cartesian=current) for x in listdef[_CONF.FIELD.LISTS]]) # 4. Scalar elif list_type == _CONF.TYPE.CONST: results[current] = Scalar(listdef[_CONF.FIELD.VALUE]) # Unknown type else: raise InitializationError("Unknown list type: {!r}".format(list_type)) # Return the result return results[current] finally: stack.pop()
python
def _create_lists(config, results, current, stack, inside_cartesian=None): """ An ugly recursive method to transform config dict into a tree of AbstractNestedList. """ # Have we done it already? try: return results[current] except KeyError: pass # Check recursion depth and detect loops if current in stack: raise ConfigurationError('Rule {!r} is recursive: {!r}'.format(stack[0], stack)) if len(stack) > 99: raise ConfigurationError('Rule {!r} is too deep'.format(stack[0])) # Track recursion depth stack.append(current) try: # Check what kind of list we have listdef = config[current] list_type = listdef[_CONF.FIELD.TYPE] # 1. List of words if list_type == _CONF.TYPE.WORDS: results[current] = WordList(listdef['words']) # List of phrases elif list_type == _CONF.TYPE.PHRASES: results[current] = PhraseList(listdef['phrases']) # 2. Simple list of lists elif list_type == _CONF.TYPE.NESTED: results[current] = NestedList([_create_lists(config, results, x, stack, inside_cartesian=inside_cartesian) for x in listdef[_CONF.FIELD.LISTS]]) # 3. Cartesian list of lists elif list_type == _CONF.TYPE.CARTESIAN: if inside_cartesian is not None: raise ConfigurationError("Cartesian list {!r} contains another Cartesian list " "{!r}. Nested Cartesian lists are not allowed." .format(inside_cartesian, current)) results[current] = CartesianList([_create_lists(config, results, x, stack, inside_cartesian=current) for x in listdef[_CONF.FIELD.LISTS]]) # 4. Scalar elif list_type == _CONF.TYPE.CONST: results[current] = Scalar(listdef[_CONF.FIELD.VALUE]) # Unknown type else: raise InitializationError("Unknown list type: {!r}".format(list_type)) # Return the result return results[current] finally: stack.pop()
[ "def", "_create_lists", "(", "config", ",", "results", ",", "current", ",", "stack", ",", "inside_cartesian", "=", "None", ")", ":", "# Have we done it already?", "try", ":", "return", "results", "[", "current", "]", "except", "KeyError", ":", "pass", "# Check recursion depth and detect loops", "if", "current", "in", "stack", ":", "raise", "ConfigurationError", "(", "'Rule {!r} is recursive: {!r}'", ".", "format", "(", "stack", "[", "0", "]", ",", "stack", ")", ")", "if", "len", "(", "stack", ")", ">", "99", ":", "raise", "ConfigurationError", "(", "'Rule {!r} is too deep'", ".", "format", "(", "stack", "[", "0", "]", ")", ")", "# Track recursion depth", "stack", ".", "append", "(", "current", ")", "try", ":", "# Check what kind of list we have", "listdef", "=", "config", "[", "current", "]", "list_type", "=", "listdef", "[", "_CONF", ".", "FIELD", ".", "TYPE", "]", "# 1. List of words", "if", "list_type", "==", "_CONF", ".", "TYPE", ".", "WORDS", ":", "results", "[", "current", "]", "=", "WordList", "(", "listdef", "[", "'words'", "]", ")", "# List of phrases", "elif", "list_type", "==", "_CONF", ".", "TYPE", ".", "PHRASES", ":", "results", "[", "current", "]", "=", "PhraseList", "(", "listdef", "[", "'phrases'", "]", ")", "# 2. Simple list of lists", "elif", "list_type", "==", "_CONF", ".", "TYPE", ".", "NESTED", ":", "results", "[", "current", "]", "=", "NestedList", "(", "[", "_create_lists", "(", "config", ",", "results", ",", "x", ",", "stack", ",", "inside_cartesian", "=", "inside_cartesian", ")", "for", "x", "in", "listdef", "[", "_CONF", ".", "FIELD", ".", "LISTS", "]", "]", ")", "# 3. Cartesian list of lists", "elif", "list_type", "==", "_CONF", ".", "TYPE", ".", "CARTESIAN", ":", "if", "inside_cartesian", "is", "not", "None", ":", "raise", "ConfigurationError", "(", "\"Cartesian list {!r} contains another Cartesian list \"", "\"{!r}. Nested Cartesian lists are not allowed.\"", ".", "format", "(", "inside_cartesian", ",", "current", ")", ")", "results", "[", "current", "]", "=", "CartesianList", "(", "[", "_create_lists", "(", "config", ",", "results", ",", "x", ",", "stack", ",", "inside_cartesian", "=", "current", ")", "for", "x", "in", "listdef", "[", "_CONF", ".", "FIELD", ".", "LISTS", "]", "]", ")", "# 4. Scalar", "elif", "list_type", "==", "_CONF", ".", "TYPE", ".", "CONST", ":", "results", "[", "current", "]", "=", "Scalar", "(", "listdef", "[", "_CONF", ".", "FIELD", ".", "VALUE", "]", ")", "# Unknown type", "else", ":", "raise", "InitializationError", "(", "\"Unknown list type: {!r}\"", ".", "format", "(", "list_type", ")", ")", "# Return the result", "return", "results", "[", "current", "]", "finally", ":", "stack", ".", "pop", "(", ")" ]
An ugly recursive method to transform config dict into a tree of AbstractNestedList.
[ "An", "ugly", "recursive", "method", "to", "transform", "config", "dict", "into", "a", "tree", "of", "AbstractNestedList", "." ]
416cc39254ab9e921fd5be77dfe6cdafbad0300c
https://github.com/alexanderlukanin13/coolname/blob/416cc39254ab9e921fd5be77dfe6cdafbad0300c/coolname/impl.py#L508-L559
train
Create a tree of lists for the current rule.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,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gO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b11010 + 0o30) + chr(1393 - 1341) + chr(0b100111 + 0o17), 0b1000), nzTpIcepk0o8(chr(1920 - 1872) + chr(0b1101111) + '\061' + '\061' + '\062', 51320 - 51312), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + '\061' + '\064', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(955 - 905) + chr(0b100011 + 0o17) + chr(0b1000 + 0o52), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110010) + chr(0b110111) + chr(2583 - 2530), 38069 - 38061), nzTpIcepk0o8(chr(352 - 304) + chr(0b1101111) + '\x31' + chr(2312 - 2259), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b111010 + 0o65) + chr(743 - 693) + chr(53) + '\x34', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\061' + chr(48) + chr(54), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\062' + '\061' + '\063', 53787 - 53779), nzTpIcepk0o8(chr(1873 - 1825) + chr(0b1101111) + chr(228 - 178) + '\x37' + chr(0b101000 + 0o11), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110111) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(1144 - 1095) + chr(662 - 609) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(1420 - 1372) + chr(0b1101110 + 0o1) + chr(0b110011) + '\062' + chr(748 - 700), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\063' + '\062' + '\x37', 13540 - 13532), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b10000 + 0o45) + '\x37', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\x36' + chr(0b11 + 0o60), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(50) + chr(53) + '\x33', 60381 - 60373), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b10000 + 0o43) + '\061' + '\x30', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(11983 - 11872) + chr(1324 - 1274) + '\x34' + '\062', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b101010 + 0o11) + chr(0b110100) + '\061', 0o10), nzTpIcepk0o8(chr(0b10 + 0o56) + '\157' + chr(50) + chr(50) + chr(237 - 184), ord("\x08")), nzTpIcepk0o8(chr(0b11101 + 0o23) + '\157' + '\x32' + '\060' + '\066', 0o10), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(0b1101001 + 0o6) + chr(0b11100 + 0o30) + '\x32', 34928 - 34920), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001) + '\064' + chr(54), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(50) + chr(0b110101) + '\061', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(226 - 175) + chr(0b100010 + 0o25) + '\x34', 49193 - 49185), nzTpIcepk0o8('\060' + chr(0b1000011 + 0o54) + chr(837 - 786) + '\060' + '\x30', 57373 - 57365), nzTpIcepk0o8('\060' + chr(111) + chr(50) + chr(0b101100 + 0o12) + '\062', 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b110110) + chr(0b110000), 0o10), nzTpIcepk0o8('\060' + chr(260 - 149) + chr(0b110110) + '\060', 8), nzTpIcepk0o8('\060' + '\157' + '\x32' + chr(0b110000) + chr(1139 - 1089), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(49) + '\x33' + chr(0b110101), 0o10), nzTpIcepk0o8('\060' + chr(0b11 + 0o154) + chr(49) + chr(0b101000 + 0o12) + chr(164 - 114), 45193 - 45185), nzTpIcepk0o8(chr(1361 - 1313) + chr(0b1101111) + chr(190 - 140) + chr(0b110001 + 0o0) + chr(49), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110011) + '\065' + chr(52), 0b1000), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b110011 + 0o74) + '\062', 8936 - 8928), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + chr(2490 - 2439), 0o10), nzTpIcepk0o8('\060' + chr(111) + '\063' + chr(0b110010) + '\062', ord("\x08")), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b1101111) + '\x33' + chr(51) + chr(190 - 137), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b111111 + 0o60) + chr(1816 - 1766) + '\066' + '\062', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\157' + chr(53) + '\x30', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x88'), '\144' + '\x65' + chr(0b1100011) + chr(0b1101100 + 0o3) + chr(0b1100100) + '\145')(chr(13599 - 13482) + '\x74' + chr(0b11000 + 0o116) + chr(1788 - 1743) + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def DaO7_xVPC0If(kgkKUcD36lls, v3B6eeO_B_ws, btnZMuSDwyyx, GmJYyzXaQAzC, lcxWYwk72jO8=None): try: return v3B6eeO_B_ws[btnZMuSDwyyx] except knUxyjfq07F9: pass if btnZMuSDwyyx in GmJYyzXaQAzC: raise WcuCZt2EFhWM(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xf4?\xe0\xf7\x9dv\x8d4\xf6\x99Q\x1a\xf0\xa5JP\xde\xba\xd1\x88\xe3\xe3\x18F\xd2\xdd\xb2\xcf'), chr(100) + chr(5506 - 5405) + '\143' + '\x6f' + chr(0b1001001 + 0o33) + '\145')('\165' + chr(0b1110100) + '\x66' + chr(45) + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'\xd7y\xbf\xd9\xfa>\xca)\xda\xe6{#'), chr(100) + chr(1250 - 1149) + chr(99) + chr(111) + chr(226 - 126) + '\145')('\x75' + chr(0b101010 + 0o112) + chr(0b1100110) + '\x2d' + chr(0b101001 + 0o17)))(GmJYyzXaQAzC[nzTpIcepk0o8(chr(48) + chr(111) + '\060', 0o10)], GmJYyzXaQAzC)) if ftfygxgFas5X(GmJYyzXaQAzC) > nzTpIcepk0o8(chr(0b110000) + chr(5752 - 5641) + chr(2155 - 2106) + chr(0b10000 + 0o44) + chr(0b101110 + 0o5), 8953 - 8945): raise WcuCZt2EFhWM(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xf4?\xe0\xf7\x9dv\x8d4\xf6\x99Q\x1a\xf0\xa3@\\\x8b\xac\xc7\x84\xe5'), chr(0b1010 + 0o132) + '\x65' + '\143' + chr(0b1101111) + chr(100) + chr(101))(chr(117) + chr(0b1001001 + 0o53) + '\x66' + chr(1639 - 1594) + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\xd7y\xbf\xd9\xfa>\xca)\xda\xe6{#'), '\x64' + '\145' + chr(99) + chr(0b100010 + 0o115) + '\144' + chr(101))(chr(117) + '\164' + '\x66' + chr(0b1110 + 0o37) + chr(56)))(GmJYyzXaQAzC[nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b1101111) + chr(48), 8)])) roI3spqORKae(GmJYyzXaQAzC, roI3spqORKae(ES5oEprVxulp(b'\xee\x1e\xdf\xa6\xc5j\xeb)\xe1\xd6m\\'), '\144' + '\145' + chr(6071 - 5972) + chr(111) + chr(0b111010 + 0o52) + chr(0b101001 + 0o74))(chr(117) + chr(116) + chr(0b1001111 + 0o27) + chr(216 - 171) + chr(0b100001 + 0o27)))(btnZMuSDwyyx) try: bXJ4kffR7D8e = kgkKUcD36lls[btnZMuSDwyyx] PLuKmt1HSVt6 = bXJ4kffR7D8e[konYruLIWsio.FIELD.rFTLz5KWYQRT] if PLuKmt1HSVt6 == roI3spqORKae(konYruLIWsio.TYPE, roI3spqORKae(ES5oEprVxulp(b'\xf1\x05\xde\xd6\xee'), chr(0b1100100) + chr(3980 - 3879) + chr(0b111000 + 0o53) + chr(0b101011 + 0o104) + chr(100) + chr(101))(chr(117) + '\x74' + chr(102) + chr(0b101101) + chr(56))): v3B6eeO_B_ws[btnZMuSDwyyx] = Z3UWNY3vYkEs(bXJ4kffR7D8e[roI3spqORKae(ES5oEprVxulp(b'\xd1%\xfe\xf6\xce'), chr(100) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(0b1000011 + 0o41) + '\x65')('\x75' + chr(116) + chr(0b1100100 + 0o2) + '\055' + '\070')]) elif PLuKmt1HSVt6 == roI3spqORKae(konYruLIWsio.TYPE, roI3spqORKae(ES5oEprVxulp(b'\xf6\x02\xde\xd3\xeeH\xff'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(0b100111 + 0o76))(chr(9119 - 9002) + '\x74' + '\x66' + chr(45) + chr(1414 - 1358))): v3B6eeO_B_ws[btnZMuSDwyyx] = QYqVGBRhVkkZ(bXJ4kffR7D8e[roI3spqORKae(ES5oEprVxulp(b'\xd6"\xfe\xf3\xceh\xdf'), chr(2737 - 2637) + chr(0b100010 + 0o103) + '\143' + chr(111) + '\x64' + chr(1537 - 1436))(chr(0b1000 + 0o155) + '\164' + chr(0b100111 + 0o77) + chr(45) + chr(1112 - 1056))]) elif PLuKmt1HSVt6 == roI3spqORKae(konYruLIWsio.TYPE, roI3spqORKae(ES5oEprVxulp(b'\xe8\x0f\xdf\xc6\xf8I'), '\144' + '\145' + '\143' + '\157' + '\144' + chr(0b111111 + 0o46))(chr(0b111 + 0o156) + chr(0b1110100) + chr(0b100000 + 0o106) + '\055' + chr(0b111000))): v3B6eeO_B_ws[btnZMuSDwyyx] = jWkmGDp_ccNL([DaO7_xVPC0If(kgkKUcD36lls, v3B6eeO_B_ws, bI5jsQ9OkQtj, GmJYyzXaQAzC, inside_cartesian=lcxWYwk72jO8) for bI5jsQ9OkQtj in bXJ4kffR7D8e[konYruLIWsio.FIELD.LISTS]]) elif PLuKmt1HSVt6 == roI3spqORKae(konYruLIWsio.TYPE, roI3spqORKae(ES5oEprVxulp(b'\xe5\x0b\xde\xc6\xf8^\xe5\x07\xc5'), '\144' + chr(504 - 403) + chr(0b1100011) + chr(111) + '\x64' + chr(0b1100101))('\165' + chr(538 - 422) + chr(0b1100110) + chr(646 - 601) + '\x38')): if lcxWYwk72jO8 is not None: raise WcuCZt2EFhWM(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b"\xe5+\xfe\xe6\xd8~\xc5'\xe5\x99T\x00\xa3\xa3\x0fH\x8a\xba\xdf\xc1\xf6\xe9L\x12\xc8\x95\xae\xc1\x10Q\xec2&\xe1\x89p3\x91\xbc\xc0\xd2/\xff\xfb\xdcc\x8c*\xe2\xcaLI\xab\xf6]N\x85\xe8\xec\x84\xe6\xf2G\x02\x89\xbf\xa1\xc0DU\xf143\xe7\xccnz\xa1\xa9\xc1\x86+\xfe\xf7\x9dc\xc32\xab\xd8T\x05\xbf\xa0JW\x85"), '\144' + chr(9640 - 9539) + chr(1120 - 1021) + chr(111) + '\144' + chr(0b101101 + 0o70))('\165' + chr(0b1110100) + chr(0b10110 + 0o120) + chr(0b101101) + chr(0b101100 + 0o14)), roI3spqORKae(ES5oEprVxulp(b'\xd7y\xbf\xd9\xfa>\xca)\xda\xe6{#'), chr(100) + chr(101) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(9959 - 9858))(chr(0b111101 + 0o70) + '\x74' + '\146' + chr(0b10 + 0o53) + '\x38'))(lcxWYwk72jO8, btnZMuSDwyyx)) v3B6eeO_B_ws[btnZMuSDwyyx] = F3273qrmJSoX([DaO7_xVPC0If(kgkKUcD36lls, v3B6eeO_B_ws, bI5jsQ9OkQtj, GmJYyzXaQAzC, inside_cartesian=btnZMuSDwyyx) for bI5jsQ9OkQtj in bXJ4kffR7D8e[konYruLIWsio.FIELD.LISTS]]) elif PLuKmt1HSVt6 == roI3spqORKae(konYruLIWsio.TYPE, roI3spqORKae(ES5oEprVxulp(b'\xe5\x05\xc2\xc1\xe9'), '\144' + chr(0b1011001 + 0o14) + chr(99) + chr(0b1101101 + 0o2) + chr(0b1001110 + 0o26) + chr(0b1100101))('\165' + chr(0b1100111 + 0o15) + '\x66' + chr(0b101101) + chr(0b111000 + 0o0))): v3B6eeO_B_ws[btnZMuSDwyyx] = KYFP7t9iWY1W(bXJ4kffR7D8e[konYruLIWsio.FIELD.VALUE]) else: raise b2IAKyD1qsnO(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xf3$\xe7\xfc\xd2z\xc2f\xe7\xd0K\x1d\xf0\xa3VC\xce\xf2\x82\x9a\xb4\xf4_'), '\144' + '\x65' + '\143' + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(6258 - 6141) + chr(0b1110100) + chr(102) + '\x2d' + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\xd7y\xbf\xd9\xfa>\xca)\xda\xe6{#'), chr(0b1100100) + '\145' + '\x63' + chr(111) + chr(0b1001110 + 0o26) + chr(101))('\165' + chr(5420 - 5304) + chr(0b1100110) + '\055' + chr(0b111000)))(PLuKmt1HSVt6)) return v3B6eeO_B_ws[btnZMuSDwyyx] finally: roI3spqORKae(GmJYyzXaQAzC, roI3spqORKae(ES5oEprVxulp(b'\xd3\t\xd3\xcb\xd2t\xce>\xbc\xf3\x08 '), chr(100) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b11111 + 0o105) + chr(101))(chr(10557 - 10440) + chr(0b1001001 + 0o53) + '\146' + chr(0b1000 + 0o45) + '\070'))()
alexanderlukanin13/coolname
coolname/impl.py
RandomGenerator.generate
def generate(self, pattern=None): """ Generates and returns random name as a list of strings. """ lst = self._lists[pattern] while True: result = lst[self._randrange(lst.length)] # 1. Check that there are no duplicates # 2. Check that there are no duplicate prefixes # 3. Check max slug length n = len(result) if (self._ensure_unique and len(set(result)) != n or self._check_prefix and len(set(x[:self._check_prefix] for x in result)) != n or self._max_slug_length and sum(len(x) for x in result) + n - 1 > self._max_slug_length): continue return result
python
def generate(self, pattern=None): """ Generates and returns random name as a list of strings. """ lst = self._lists[pattern] while True: result = lst[self._randrange(lst.length)] # 1. Check that there are no duplicates # 2. Check that there are no duplicate prefixes # 3. Check max slug length n = len(result) if (self._ensure_unique and len(set(result)) != n or self._check_prefix and len(set(x[:self._check_prefix] for x in result)) != n or self._max_slug_length and sum(len(x) for x in result) + n - 1 > self._max_slug_length): continue return result
[ "def", "generate", "(", "self", ",", "pattern", "=", "None", ")", ":", "lst", "=", "self", ".", "_lists", "[", "pattern", "]", "while", "True", ":", "result", "=", "lst", "[", "self", ".", "_randrange", "(", "lst", ".", "length", ")", "]", "# 1. Check that there are no duplicates", "# 2. Check that there are no duplicate prefixes", "# 3. Check max slug length", "n", "=", "len", "(", "result", ")", "if", "(", "self", ".", "_ensure_unique", "and", "len", "(", "set", "(", "result", ")", ")", "!=", "n", "or", "self", ".", "_check_prefix", "and", "len", "(", "set", "(", "x", "[", ":", "self", ".", "_check_prefix", "]", "for", "x", "in", "result", ")", ")", "!=", "n", "or", "self", ".", "_max_slug_length", "and", "sum", "(", "len", "(", "x", ")", "for", "x", "in", "result", ")", "+", "n", "-", "1", ">", "self", ".", "_max_slug_length", ")", ":", "continue", "return", "result" ]
Generates and returns random name as a list of strings.
[ "Generates", "and", "returns", "random", "name", "as", "a", "list", "of", "strings", "." ]
416cc39254ab9e921fd5be77dfe6cdafbad0300c
https://github.com/alexanderlukanin13/coolname/blob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PEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b110010) + chr(535 - 480), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b1000 + 0o57) + '\x37', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001) + chr(54) + '\064', 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b10000 + 0o44) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(1111 - 1063) + '\x6f' + '\061' + '\x34' + chr(51), 0o10), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(2785 - 2674) + '\x34' + chr(1396 - 1348), 49862 - 49854), nzTpIcepk0o8(chr(892 - 844) + '\157' + '\063' + chr(48) + chr(0b101111 + 0o7), 0o10), nzTpIcepk0o8('\060' + chr(10810 - 10699) + chr(50) + '\062' + chr(0b1100 + 0o52), 0o10), nzTpIcepk0o8('\x30' + chr(4476 - 4365) + chr(49) + chr(0b110111), 13113 - 13105), nzTpIcepk0o8(chr(0b1001 + 0o47) + '\157' + chr(1715 - 1666) + chr(0b110110) + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(50) + chr(424 - 370) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x33' + '\x34' + chr(0b100111 + 0o13), ord("\x08")), nzTpIcepk0o8('\060' + chr(1866 - 1755) + chr(1190 - 1139) + '\064' + chr(1225 - 1174), 58666 - 58658), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(0b1000000 + 0o57) + chr(0b1000 + 0o52) + chr(440 - 390) + chr(806 - 758), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\x31' + '\x32' + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(329 - 281) + chr(0b1101111) + '\062' + chr(0b110101) + chr(1817 - 1766), ord("\x08")), nzTpIcepk0o8(chr(61 - 13) + '\157' + chr(1685 - 1635) + chr(52) + chr(0b110101), 37342 - 37334), nzTpIcepk0o8('\x30' + '\157' + chr(49) + '\x36' + chr(254 - 205), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b101011 + 0o10) + chr(716 - 667) + '\066', 20423 - 20415), nzTpIcepk0o8(chr(0b110000) + chr(0b1101 + 0o142) + chr(49) + chr(52) + chr(0b110000), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\062' + chr(0b110100) + '\060', 0o10), nzTpIcepk0o8(chr(1165 - 1117) + chr(111) + chr(0b110010) + chr(55) + chr(0b10001 + 0o45), 16935 - 16927), nzTpIcepk0o8(chr(0b110000) + chr(3304 - 3193) + chr(53) + '\062', ord("\x08")), nzTpIcepk0o8(chr(1517 - 1469) + '\x6f' + chr(0b0 + 0o62) + chr(48) + chr(51), ord("\x08")), nzTpIcepk0o8('\x30' + chr(12314 - 12203) + chr(50) + chr(2787 - 2733), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b101100 + 0o103) + chr(50) + chr(0b110110) + chr(0b110100), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\x31' + chr(0b11100 + 0o32) + '\x34', 8), nzTpIcepk0o8(chr(0b11010 + 0o26) + '\157' + chr(0b11001 + 0o31) + '\061' + chr(50), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(51) + '\065' + '\x33', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(0b10000 + 0o46) + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b1101111) + chr(0b10111 + 0o32) + chr(48) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(246 - 198) + '\x6f' + '\x33' + '\x31' + '\x36', 8), nzTpIcepk0o8('\060' + '\x6f' + chr(0b11101 + 0o26) + chr(50) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + chr(0b1110 + 0o47) + chr(0b101100 + 0o13), 0b1000), nzTpIcepk0o8(chr(963 - 915) + chr(0b1101111) + chr(0b11111 + 0o22) + '\x33' + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(0b101 + 0o53) + '\157' + '\061' + '\063' + '\062', 8), nzTpIcepk0o8('\060' + chr(0b1101111) + '\063' + '\065', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(379 - 327) + chr(0b100111 + 0o13), 8), nzTpIcepk0o8(chr(2076 - 2028) + chr(111) + chr(1976 - 1926) + chr(48) + chr(49), 0o10), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(111) + chr(51) + chr(0b110010) + chr(50), 36816 - 36808)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(111) + chr(0b110101) + chr(0b110000), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'y'), chr(0b111100 + 0o50) + '\145' + '\143' + chr(111) + chr(0b100011 + 0o101) + '\145')('\165' + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b100110 + 0o22)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def oOKT6lggWhPk(hXMPsSrOQzbh, UYtHA0XyNB9C=None): qqHCejBNy7jf = hXMPsSrOQzbh.r0McDNgRCmXR[UYtHA0XyNB9C] while nzTpIcepk0o8(chr(48) + '\157' + '\x31', 36589 - 36581): POx95m7SPOVy = qqHCejBNy7jf[hXMPsSrOQzbh._randrange(qqHCejBNy7jf.a1RCQZREo3Kd)] NoZxuO7wjArS = ftfygxgFas5X(POx95m7SPOVy) if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x08Z\x1aR\x16R\xa3\xc9z\x1f\xde\x93\x96\xf5'), '\144' + chr(235 - 134) + chr(0b1100011) + chr(111) + '\144' + chr(2900 - 2799))('\165' + '\164' + chr(8178 - 8076) + chr(45) + '\070')) and ftfygxgFas5X(Bvi71nNyvlqO(POx95m7SPOVy)) != NoZxuO7wjArS or (roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x08\\\x1cD\x00K\x99\xe6}\x14\xd1\x8b\x9b'), '\144' + chr(0b1100101) + chr(1464 - 1365) + '\157' + '\x64' + chr(0b100 + 0o141))('\165' + chr(0b101000 + 0o114) + '\146' + chr(0b101101) + chr(0b111000))) and ftfygxgFas5X(Bvi71nNyvlqO((bI5jsQ9OkQtj[:roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x08\\\x1cD\x00K\x99\xe6}\x14\xd1\x8b\x9b'), '\x64' + '\x65' + chr(0b1011100 + 0o7) + '\x6f' + chr(7074 - 6974) + '\x65')('\165' + chr(6385 - 6269) + chr(102) + chr(45) + chr(0b1001 + 0o57)))] for bI5jsQ9OkQtj in POx95m7SPOVy))) != NoZxuO7wjArS) or (roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x08R\x15Y<S\xaa\xe3h.\xdb\x87\x8d\xf7!\xc3'), chr(0b1100100) + chr(101) + '\143' + chr(8415 - 8304) + chr(0b1100100) + '\x65')(chr(0b10101 + 0o140) + chr(116) + chr(0b110000 + 0o66) + chr(45) + chr(2427 - 2371))) and oclC8DLjA_lV((ftfygxgFas5X(bI5jsQ9OkQtj) for bI5jsQ9OkQtj in POx95m7SPOVy)) + NoZxuO7wjArS - nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001), 8) > roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x08R\x15Y<S\xaa\xe3h.\xdb\x87\x8d\xf7!\xc3'), chr(3362 - 3262) + chr(101) + chr(8070 - 7971) + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(117) + chr(1355 - 1239) + chr(1544 - 1442) + chr(0b11011 + 0o22) + '\x38'))): continue return POx95m7SPOVy
alexanderlukanin13/coolname
coolname/impl.py
RandomGenerator._dump
def _dump(self, stream, pattern=None, object_ids=False): """Dumps current tree into a text stream.""" return self._lists[pattern]._dump(stream, '', object_ids=object_ids)
python
def _dump(self, stream, pattern=None, object_ids=False): """Dumps current tree into a text stream.""" return self._lists[pattern]._dump(stream, '', object_ids=object_ids)
[ "def", "_dump", "(", "self", ",", "stream", ",", "pattern", "=", "None", ",", "object_ids", "=", "False", ")", ":", "return", "self", ".", "_lists", "[", "pattern", "]", ".", "_dump", "(", "stream", ",", "''", ",", "object_ids", "=", "object_ids", ")" ]
Dumps current tree into a text stream.
[ "Dumps", "current", "tree", "into", "a", "text", "stream", "." ]
416cc39254ab9e921fd5be77dfe6cdafbad0300c
https://github.com/alexanderlukanin13/coolname/blob/416cc39254ab9e921fd5be77dfe6cdafbad0300c/coolname/impl.py#L337-L339
train
Dumps the current tree into a text stream.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1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EWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1783 - 1735) + chr(11388 - 11277) + '\062' + chr(143 - 93) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(10577 - 10466) + '\x32' + chr(1384 - 1332) + chr(182 - 131), 0b1000), nzTpIcepk0o8(chr(1453 - 1405) + chr(7405 - 7294) + '\063' + chr(0b110101) + chr(54), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + '\x32' + chr(0b101100 + 0o12), 42229 - 42221), nzTpIcepk0o8('\x30' + '\157' + '\062' + '\x37' + chr(0b110011), 62245 - 62237), nzTpIcepk0o8(chr(48) + '\x6f' + chr(54), 0b1000), nzTpIcepk0o8(chr(2156 - 2108) + chr(0b1010000 + 0o37) + chr(0b11111 + 0o23) + chr(0b1110 + 0o50), 0b1000), nzTpIcepk0o8(chr(1074 - 1026) + '\157' + '\066' + chr(0b100010 + 0o24), 29898 - 29890), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b11011 + 0o30) + chr(0b110000) + '\060', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(3009 - 2898) + chr(50) + chr(0b110100), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(1020 - 969) + chr(0b110100) + '\x35', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + chr(857 - 806) + '\065', 0o10), nzTpIcepk0o8(chr(1254 - 1206) + chr(6320 - 6209) + chr(1986 - 1937) + '\061' + '\067', 0o10), nzTpIcepk0o8(chr(0b101100 + 0o4) + '\x6f' + chr(0b110100) + '\065', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + '\x35' + chr(555 - 504), ord("\x08")), nzTpIcepk0o8(chr(256 - 208) + chr(111) + chr(0b110000 + 0o3) + '\x35' + chr(0b100100 + 0o16), 3181 - 3173), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1516 - 1463) + chr(563 - 513), 46316 - 46308), nzTpIcepk0o8(chr(1372 - 1324) + '\x6f' + chr(49) + chr(2031 - 1978) + '\066', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(1400 - 1351) + '\064' + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\063' + chr(48) + chr(1649 - 1596), ord("\x08")), nzTpIcepk0o8('\x30' + chr(4408 - 4297) + '\x33' + chr(0b110010) + chr(0b10100 + 0o42), ord("\x08")), nzTpIcepk0o8(chr(480 - 432) + '\157' + '\062' + '\061' + '\x30', 0b1000), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(6134 - 6023) + '\066' + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\063' + '\x30' + chr(2788 - 2735), 8), nzTpIcepk0o8('\x30' + '\157' + chr(0b101000 + 0o12) + chr(0b11110 + 0o25) + '\x37', 0o10), nzTpIcepk0o8(chr(1280 - 1232) + '\157' + chr(1511 - 1462) + chr(0b100000 + 0o24) + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + '\064' + '\067', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + chr(0b101111 + 0o1) + chr(2486 - 2434), 0o10), nzTpIcepk0o8(chr(435 - 387) + chr(0b1010010 + 0o35) + chr(0b110001) + chr(0b110111) + chr(1049 - 1001), 0o10), nzTpIcepk0o8('\060' + chr(0b100010 + 0o115) + '\x31' + chr(0b10010 + 0o44) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(1936 - 1888) + chr(0b1101111) + '\065' + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b101010 + 0o6) + '\157' + chr(51) + chr(48) + chr(0b1101 + 0o45), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110010) + chr(0b110110) + chr(2050 - 2002), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b10110 + 0o33) + chr(53) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110100) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(254 - 206) + chr(0b1101111) + chr(49) + chr(0b1001 + 0o53) + '\x36', 0o10), nzTpIcepk0o8('\060' + chr(0b1100000 + 0o17) + chr(0b110011 + 0o3) + chr(2004 - 1949), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1790 - 1739) + chr(220 - 165), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\063' + '\063' + chr(905 - 852), 0b1000), nzTpIcepk0o8(chr(1926 - 1878) + chr(2008 - 1897) + chr(51) + chr(2481 - 2428) + chr(54), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110000 + 0o5) + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xb9'), chr(100) + '\x65' + chr(99) + chr(5951 - 5840) + chr(5844 - 5744) + '\145')(chr(4385 - 4268) + '\164' + chr(0b1100110) + '\x2d' + '\x38') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def EMYuo9OX1Zc0(hXMPsSrOQzbh, ztC3O2ZXmsJr, UYtHA0XyNB9C=None, PHA9V6wQW0Kw=nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x30', 14769 - 14761)): return roI3spqORKae(hXMPsSrOQzbh._lists[UYtHA0XyNB9C], roI3spqORKae(ES5oEprVxulp(b'\xc8\xc7\x9b;\xcb'), chr(0b100 + 0o140) + chr(101) + '\x63' + chr(0b1001000 + 0o47) + chr(0b110110 + 0o56) + '\x65')('\x75' + chr(118 - 2) + chr(102) + chr(0b101101) + chr(0b111000)))(ztC3O2ZXmsJr, roI3spqORKae(ES5oEprVxulp(b''), chr(7503 - 7403) + chr(101) + chr(99) + '\x6f' + '\x64' + '\x65')(chr(10732 - 10615) + chr(0b1110100) + chr(102) + '\055' + '\070'), object_ids=PHA9V6wQW0Kw)
alexanderlukanin13/coolname
coolname/impl.py
RandomGenerator._check_not_hanging
def _check_not_hanging(self): """ Rough check that generate() will not hang or be very slow. Raises ConfigurationError if generate() spends too much time in retry loop. Issues a warning.warn() if there is a risk of slowdown. """ # (field_name, predicate, warning_msg, exception_msg) # predicate(g) is a function that returns True if generated combination g must be rejected, # see checks in generate() checks = [] # ensure_unique can lead to infinite loops for some tiny erroneous configs if self._ensure_unique: checks.append(( _CONF.FIELD.ENSURE_UNIQUE, self._ensure_unique, lambda g: len(set(g)) != len(g), '{generate} may be slow because a significant fraction of combinations contain repeating words and {field_name} is set', # noqa 'Impossible to generate with {field_name}' )) # # max_slug_length can easily slow down or block generation if set too small if self._max_slug_length: checks.append(( _CONF.FIELD.MAX_SLUG_LENGTH, self._max_slug_length, lambda g: sum(len(x) for x in g) + len(g) - 1 > self._max_slug_length, '{generate} may be slow because a significant fraction of combinations exceed {field_name}={field_value}', # noqa 'Impossible to generate with {field_name}={field_value}' )) # Perform the relevant checks for all generators, starting from 'all' n = 100 warning_treshold = 20 # fail probability: 0.04 for 2 attempts, 0.008 for 3 attempts, etc. for lst_id, lst in sorted(self._lists.items(), key=lambda x: '' if x is None else str(x)): context = {'generate': 'coolname.generate({})'.format('' if lst_id is None else repr(lst_id))} # For each generator, perform checks for field_name, field_value, predicate, warning_msg, exception_msg in checks: context.update({'field_name': field_name, 'field_value': field_value}) bad_count = 0 for i in range(n): g = lst[randrange(lst.length)] if predicate(g): bad_count += 1 if bad_count >= n: raise ConfigurationError(exception_msg.format(**context)) elif bad_count >= warning_treshold: import warnings warnings.warn(warning_msg.format(**context))
python
def _check_not_hanging(self): """ Rough check that generate() will not hang or be very slow. Raises ConfigurationError if generate() spends too much time in retry loop. Issues a warning.warn() if there is a risk of slowdown. """ # (field_name, predicate, warning_msg, exception_msg) # predicate(g) is a function that returns True if generated combination g must be rejected, # see checks in generate() checks = [] # ensure_unique can lead to infinite loops for some tiny erroneous configs if self._ensure_unique: checks.append(( _CONF.FIELD.ENSURE_UNIQUE, self._ensure_unique, lambda g: len(set(g)) != len(g), '{generate} may be slow because a significant fraction of combinations contain repeating words and {field_name} is set', # noqa 'Impossible to generate with {field_name}' )) # # max_slug_length can easily slow down or block generation if set too small if self._max_slug_length: checks.append(( _CONF.FIELD.MAX_SLUG_LENGTH, self._max_slug_length, lambda g: sum(len(x) for x in g) + len(g) - 1 > self._max_slug_length, '{generate} may be slow because a significant fraction of combinations exceed {field_name}={field_value}', # noqa 'Impossible to generate with {field_name}={field_value}' )) # Perform the relevant checks for all generators, starting from 'all' n = 100 warning_treshold = 20 # fail probability: 0.04 for 2 attempts, 0.008 for 3 attempts, etc. for lst_id, lst in sorted(self._lists.items(), key=lambda x: '' if x is None else str(x)): context = {'generate': 'coolname.generate({})'.format('' if lst_id is None else repr(lst_id))} # For each generator, perform checks for field_name, field_value, predicate, warning_msg, exception_msg in checks: context.update({'field_name': field_name, 'field_value': field_value}) bad_count = 0 for i in range(n): g = lst[randrange(lst.length)] if predicate(g): bad_count += 1 if bad_count >= n: raise ConfigurationError(exception_msg.format(**context)) elif bad_count >= warning_treshold: import warnings warnings.warn(warning_msg.format(**context))
[ "def", "_check_not_hanging", "(", "self", ")", ":", "# (field_name, predicate, warning_msg, exception_msg)", "# predicate(g) is a function that returns True if generated combination g must be rejected,", "# see checks in generate()", "checks", "=", "[", "]", "# ensure_unique can lead to infinite loops for some tiny erroneous configs", "if", "self", ".", "_ensure_unique", ":", "checks", ".", "append", "(", "(", "_CONF", ".", "FIELD", ".", "ENSURE_UNIQUE", ",", "self", ".", "_ensure_unique", ",", "lambda", "g", ":", "len", "(", "set", "(", "g", ")", ")", "!=", "len", "(", "g", ")", ",", "'{generate} may be slow because a significant fraction of combinations contain repeating words and {field_name} is set'", ",", "# noqa", "'Impossible to generate with {field_name}'", ")", ")", "#", "# max_slug_length can easily slow down or block generation if set too small", "if", "self", ".", "_max_slug_length", ":", "checks", ".", "append", "(", "(", "_CONF", ".", "FIELD", ".", "MAX_SLUG_LENGTH", ",", "self", ".", "_max_slug_length", ",", "lambda", "g", ":", "sum", "(", "len", "(", "x", ")", "for", "x", "in", "g", ")", "+", "len", "(", "g", ")", "-", "1", ">", "self", ".", "_max_slug_length", ",", "'{generate} may be slow because a significant fraction of combinations exceed {field_name}={field_value}'", ",", "# noqa", "'Impossible to generate with {field_name}={field_value}'", ")", ")", "# Perform the relevant checks for all generators, starting from 'all'", "n", "=", "100", "warning_treshold", "=", "20", "# fail probability: 0.04 for 2 attempts, 0.008 for 3 attempts, etc.", "for", "lst_id", ",", "lst", "in", "sorted", "(", "self", ".", "_lists", ".", "items", "(", ")", ",", "key", "=", "lambda", "x", ":", "''", "if", "x", "is", "None", "else", "str", "(", "x", ")", ")", ":", "context", "=", "{", "'generate'", ":", "'coolname.generate({})'", ".", "format", "(", "''", "if", "lst_id", "is", "None", "else", "repr", "(", "lst_id", ")", ")", "}", "# For each generator, perform checks", "for", "field_name", ",", "field_value", ",", "predicate", ",", "warning_msg", ",", "exception_msg", "in", "checks", ":", "context", ".", "update", "(", "{", "'field_name'", ":", "field_name", ",", "'field_value'", ":", "field_value", "}", ")", "bad_count", "=", "0", "for", "i", "in", "range", "(", "n", ")", ":", "g", "=", "lst", "[", "randrange", "(", "lst", ".", "length", ")", "]", "if", "predicate", "(", "g", ")", ":", "bad_count", "+=", "1", "if", "bad_count", ">=", "n", ":", "raise", "ConfigurationError", "(", "exception_msg", ".", "format", "(", "*", "*", "context", ")", ")", "elif", "bad_count", ">=", "warning_treshold", ":", "import", "warnings", "warnings", ".", "warn", "(", "warning_msg", ".", "format", "(", "*", "*", "context", ")", ")" ]
Rough check that generate() will not hang or be very slow. Raises ConfigurationError if generate() spends too much time in retry loop. Issues a warning.warn() if there is a risk of slowdown.
[ "Rough", "check", "that", "generate", "()", "will", "not", "hang", "or", "be", "very", "slow", "." ]
416cc39254ab9e921fd5be77dfe6cdafbad0300c
https://github.com/alexanderlukanin13/coolname/blob/416cc39254ab9e921fd5be77dfe6cdafbad0300c/coolname/impl.py#L341-L388
train
Checks that the generator is not hanging.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOx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Yf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(719 - 671) + '\x6f' + chr(0b110010) + chr(50) + chr(0b101010 + 0o6), 0o10), nzTpIcepk0o8('\060' + chr(9256 - 9145) + chr(0b110110) + chr(48), 0o10), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(8619 - 8508) + '\x32' + chr(0b110101) + '\064', 0b1000), nzTpIcepk0o8('\x30' + chr(10188 - 10077) + '\062' + '\067' + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(111) + chr(1645 - 1595) + '\x37', 10387 - 10379), nzTpIcepk0o8('\060' + chr(0b1001101 + 0o42) + chr(0b11100 + 0o26) + chr(54), 5911 - 5903), nzTpIcepk0o8('\060' + '\157' + chr(0b110100), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b11110 + 0o23) + '\061' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b11000 + 0o34) + '\065', ord("\x08")), nzTpIcepk0o8(chr(1145 - 1097) + chr(8710 - 8599) + chr(49) + '\x34' + chr(0b11011 + 0o33), 45085 - 45077), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(221 - 170) + chr(0b101 + 0o60) + chr(2463 - 2409), 0o10), nzTpIcepk0o8(chr(1631 - 1583) + chr(0b1101111) + chr(2086 - 2036) + chr(52) + '\066', 12572 - 12564), nzTpIcepk0o8(chr(0b1000 + 0o50) + '\157' + chr(502 - 452) + chr(0b100010 + 0o16) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110011) + chr(0b1110 + 0o42) + '\063', ord("\x08")), nzTpIcepk0o8(chr(0b11101 + 0o23) + '\157' + chr(710 - 661) + chr(49) + chr(0b110111), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(51) + chr(0b110011) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(2415 - 2365) + '\063', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110010) + '\x30' + chr(2630 - 2576), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\061' + chr(48) + '\065', 0b1000), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(10251 - 10140) + chr(0b101101 + 0o5) + '\x30' + chr(0b110010), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\x34' + chr(53), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + '\061' + '\x34', ord("\x08")), nzTpIcepk0o8(chr(2128 - 2080) + '\157' + '\063' + '\x34' + chr(1398 - 1348), 0o10), nzTpIcepk0o8(chr(1220 - 1172) + '\x6f' + '\061' + chr(0b110001 + 0o5), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(49) + chr(0b101011 + 0o5) + chr(54), 15724 - 15716), nzTpIcepk0o8(chr(0b110000) + chr(0b111 + 0o150) + chr(49) + '\063' + '\x35', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(10827 - 10716) + chr(174 - 125) + chr(2193 - 2143) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110011) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(119 - 71) + chr(0b1000110 + 0o51) + chr(0b100001 + 0o20) + chr(51) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(0b1101111) + '\064' + chr(55), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\061' + '\x37' + chr(0b110101), 55094 - 55086), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31' + chr(0b110101) + chr(52), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(54) + chr(1202 - 1149), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + '\060' + chr(0b110001), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\063' + chr(48) + '\x32', 0o10), nzTpIcepk0o8(chr(48) + chr(11776 - 11665) + '\063' + chr(49) + chr(974 - 921), 0b1000), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(10936 - 10825) + chr(0b110010) + chr(0b110001 + 0o4) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(2145 - 2097) + chr(0b1101111) + chr(50) + chr(257 - 203) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\x33' + chr(2042 - 1990) + '\065', 0b1000), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(111) + chr(0b110001) + chr(2815 - 2760) + '\x30', ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1794 - 1746) + '\157' + chr(0b11100 + 0o31) + chr(0b101 + 0o53), 47129 - 47121)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xbe'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(0b1010111 + 0o30) + chr(7563 - 7463) + chr(0b10111 + 0o116))(chr(13306 - 13189) + chr(0b111 + 0o155) + '\146' + chr(0b101101) + '\x38') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def zros4_fLz76g(hXMPsSrOQzbh): NVULxIHSU5SZ = [] if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xcfU\xc2\xcdbda\x16\x10\x08\x87\xd7\xf6\xa6'), chr(100) + chr(0b1100010 + 0o3) + chr(0b1100011) + chr(10055 - 9944) + chr(5730 - 5630) + '\145')(chr(117) + chr(0b1011000 + 0o34) + chr(7659 - 7557) + chr(462 - 417) + chr(56))): roI3spqORKae(NVULxIHSU5SZ, roI3spqORKae(ES5oEprVxulp(b'\xd8d\xff\x8aoqC&\x0f\t\xbb\x93'), chr(4806 - 4706) + chr(0b1100101 + 0o0) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(5168 - 5067))(chr(117) + '\x74' + '\x66' + chr(45) + '\070'))((roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'\xd5~\xff\xebES[\x1c+/\xbf\xf3\xc6'), chr(0b1100100) + chr(6917 - 6816) + '\143' + chr(111) + chr(0b1100100) + '\x65')(chr(0b11000 + 0o135) + chr(0b1110100) + chr(102) + chr(45) + chr(0b111000))), roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xcfU\xc2\xcdbda\x16\x10\x08\x87\xd7\xf6\xa6'), chr(0b1111 + 0o125) + chr(9433 - 9332) + '\x63' + chr(111) + chr(0b1100100) + chr(0b1001100 + 0o31))(chr(7489 - 7372) + chr(7266 - 7150) + chr(0b1100110) + chr(130 - 85) + '\x38')), lambda KQq7Z9J63zv1: ftfygxgFas5X(Bvi71nNyvlqO(KQq7Z9J63zv1)) != ftfygxgFas5X(KQq7Z9J63zv1), roI3spqORKae(ES5oEprVxulp(b'\xebW\xc9\xd0rde=\x00\x1b\xce\xcb\xe2\xbao\xbfv\xa66\xeeJ{\xc2l#>2k)B]\rU\xb2\xab\xaa\xc0\xda\x83\x11\xf3Q\xc2\xca7pv(\x06\x12\x87\xc9\xed\xe3 \xbb3\xe5*\xefGe\x8co24<p)\x07\x1e\x03\x1b\xb5\xa3\xa4\xc0\x93\x97\x1d\xe0U\xcd\xca~xci\x12\t\x9c\xc2\xf0\xe3.\xb3w\xa6>\xe4Li\x8ej\x1932s?Z]\x05\x06\xe1\xb1\xa8\xda'), chr(100) + '\145' + chr(0b100101 + 0o76) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(4684 - 4568) + '\146' + chr(45) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\xd9]\xdc\xd1dem+\t\x03\xce\xd2\xec\xe3(\xb8}\xe37\xe3Qi\xc2y/);>!A\x14\t\x19\xa5\x9d\xa3\xcf\xde\x80\x05'), chr(0b1001010 + 0o32) + chr(0b1100101 + 0o0) + chr(0b1010100 + 0o17) + chr(4750 - 4639) + '\x64' + '\x65')(chr(117) + chr(0b1000000 + 0o64) + chr(0b1100110) + chr(0b101011 + 0o2) + chr(0b111000)))) if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xcf]\xcd\xc6Heh<\x029\x82\xc3\xed\xa4;\xb5'), chr(0b1100100) + chr(0b111010 + 0o53) + chr(8118 - 8019) + chr(0b1101111) + chr(3136 - 3036) + '\145')(chr(0b1001001 + 0o54) + chr(0b110011 + 0o101) + chr(102) + chr(0b101101) + chr(0b111000))): roI3spqORKae(NVULxIHSU5SZ, roI3spqORKae(ES5oEprVxulp(b'\xd8d\xff\x8aoqC&\x0f\t\xbb\x93'), '\144' + chr(934 - 833) + '\143' + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1110101) + '\164' + chr(0b1100110) + chr(0b11100 + 0o21) + chr(0b111000 + 0o0)))((roI3spqORKae(konYruLIWsio.FIELD, roI3spqORKae(ES5oEprVxulp(b'\xddq\xf4\xe1DZQ\x0e:*\xab\xe8\xc4\x97\x07'), chr(0b1011100 + 0o10) + chr(0b0 + 0o145) + '\143' + chr(6914 - 6803) + chr(476 - 376) + chr(0b100110 + 0o77))('\165' + '\164' + chr(1654 - 1552) + chr(45) + chr(56))), roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xcf]\xcd\xc6Heh<\x029\x82\xc3\xed\xa4;\xb5'), '\144' + chr(0b1010001 + 0o24) + chr(99) + chr(0b110000 + 0o77) + chr(0b100010 + 0o102) + '\145')(chr(0b1110101) + chr(116) + chr(0b1011000 + 0o16) + chr(45) + '\070')), lambda KQq7Z9J63zv1: oclC8DLjA_lV((ftfygxgFas5X(bI5jsQ9OkQtj) for bI5jsQ9OkQtj in KQq7Z9J63zv1)) + ftfygxgFas5X(KQq7Z9J63zv1) - nzTpIcepk0o8(chr(48) + '\157' + chr(503 - 454), 29270 - 29262) > roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xcf]\xcd\xc6Heh<\x029\x82\xc3\xed\xa4;\xb5'), chr(6577 - 6477) + '\145' + '\143' + chr(0b1101111) + chr(0b1100100) + '\145')('\x75' + '\164' + chr(0b10100 + 0o122) + '\x2d' + '\x38')), roI3spqORKae(ES5oEprVxulp(b'\xebW\xc9\xd0rde=\x00\x1b\xce\xcb\xe2\xbao\xbfv\xa66\xeeJ{\xc2l#>2k)B]\rU\xb2\xab\xaa\xc0\xda\x83\x11\xf3Q\xc2\xca7pv(\x06\x12\x87\xc9\xed\xe3 \xbb3\xe5*\xefGe\x8co24<p)\x07\x18\x14\x16\xa4\xa7\xa9\x8e\xc8\x83\x11\xf5\\\xc8\xe1ywi,\x18[\x95\xc0\xea\xa6#\xb9L\xf0$\xeePi\x9f'), '\144' + chr(101) + '\x63' + chr(111) + chr(100) + chr(101))('\165' + chr(0b1110100) + chr(0b1100110 + 0o0) + chr(0b100 + 0o51) + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'\xd9]\xdc\xd1dem+\t\x03\xce\xd2\xec\xe3(\xb8}\xe37\xe3Qi\xc2y/);>!A\x14\t\x19\xa5\x9d\xa3\xcf\xde\x80\x05\xadK\xca\xd7rz`\x16\x13\x07\x82\xd3\xe6\xbe'), '\144' + '\145' + chr(0b1100011) + chr(0b1011111 + 0o20) + chr(100) + chr(101))('\x75' + chr(0b1110100) + chr(0b111001 + 0o55) + chr(45) + chr(0b111000)))) NoZxuO7wjArS = nzTpIcepk0o8(chr(1669 - 1621) + '\157' + chr(49) + chr(52) + chr(0b100000 + 0o24), 0o10) KMQtBxHsKvqK = nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + '\x34', 0b1000) for (cB_EsX6N6M10, qqHCejBNy7jf) in V3OlOVg98A85(roI3spqORKae(hXMPsSrOQzbh._lists, roI3spqORKae(ES5oEprVxulp(b'\xc9o\xc2\xf0RlL}V\x10\xb6\xcf'), '\x64' + '\145' + '\143' + chr(0b1101111) + chr(100) + chr(7466 - 7365))(chr(2322 - 2205) + '\x74' + '\146' + chr(0b101101) + '\x38'))(), key=lambda bI5jsQ9OkQtj: roI3spqORKae(ES5oEprVxulp(b''), '\144' + chr(101) + chr(99) + chr(0b1101111) + chr(0b101111 + 0o65) + '\x65')(chr(4030 - 3913) + chr(0b1010001 + 0o43) + chr(3798 - 3696) + '\055' + chr(0b101000 + 0o20)) if bI5jsQ9OkQtj is None else N9zlRy29S1SS(bI5jsQ9OkQtj)): xwFiQMStTnzU = {roI3spqORKae(ES5oEprVxulp(b'\xf7U\xc2\xdbewp,'), '\x64' + chr(0b1100101) + chr(99) + '\157' + '\144' + chr(9183 - 9082))(chr(117) + chr(0b1010010 + 0o42) + chr(0b1100110) + chr(286 - 241) + '\070'): roI3spqORKae(ES5oEprVxulp(b'\xf3_\xc3\xd2ywi,K\x01\x8b\xc8\xe6\xb1.\xa9v\xae>\xff\x0c'), chr(100) + '\145' + chr(99) + chr(0b1101111) + '\144' + chr(5623 - 5522))('\165' + chr(0b1110100) + chr(0b1100110) + '\055' + chr(56)).q33KG3foQ_CJ(roI3spqORKae(ES5oEprVxulp(b''), '\144' + chr(9396 - 9295) + chr(2058 - 1959) + '\157' + chr(7354 - 7254) + chr(101))(chr(0b1110101) + chr(0b100100 + 0o120) + chr(5359 - 5257) + '\x2d' + '\x38') if cB_EsX6N6M10 is None else VWshwTzZfwvC(cB_EsX6N6M10))} for (XTg7r9SbyaPD, BTrUvRmXXDfx, pwkvr_uUvsDv, iJbJ6gFMY9o0, xlGH3AobY7B6) in NVULxIHSU5SZ: roI3spqORKae(xwFiQMStTnzU, roI3spqORKae(ES5oEprVxulp(b'\xdao\xc7\x8c^OFx\x06\x03\x9f\xc8'), chr(100) + chr(101) + '\x63' + '\x6f' + chr(0b1100100) + chr(4057 - 3956))('\x75' + chr(11161 - 11045) + chr(8790 - 8688) + '\055' + chr(56)))({roI3spqORKae(ES5oEprVxulp(b'\xf6Y\xc9\xd2sIj(\x08\x03'), chr(100) + chr(0b1100101) + chr(7483 - 7384) + chr(111) + chr(100) + chr(101))('\165' + chr(0b111000 + 0o74) + chr(0b1100110) + '\x2d' + chr(0b111000)): XTg7r9SbyaPD, roI3spqORKae(ES5oEprVxulp(b'\xf6Y\xc9\xd2sIr(\t\x13\x8b'), chr(0b1100100) + chr(0b10010 + 0o123) + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b1101010 + 0o12) + '\x66' + chr(45) + chr(56)): BTrUvRmXXDfx}) nRyoNZDYK0U2 = nzTpIcepk0o8(chr(544 - 496) + '\157' + chr(0b100010 + 0o16), 15674 - 15666) for ZlbFMSG8gCoF in bbT2xIe5pzk7(NoZxuO7wjArS): KQq7Z9J63zv1 = qqHCejBNy7jf[oZGubT8gCeSP(qqHCejBNy7jf.a1RCQZREo3Kd)] if pwkvr_uUvsDv(KQq7Z9J63zv1): nRyoNZDYK0U2 += nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(473 - 424), 8) if nRyoNZDYK0U2 >= NoZxuO7wjArS: raise WcuCZt2EFhWM(roI3spqORKae(xlGH3AobY7B6, roI3spqORKae(ES5oEprVxulp(b'\xe1\x03\x9f\xf5P%b&49\xad\xec'), '\x64' + '\x65' + '\x63' + '\157' + chr(100) + '\145')(chr(0b1110101) + chr(0b1100100 + 0o20) + chr(0b10 + 0o144) + chr(0b101101) + '\x38'))(**xwFiQMStTnzU)) elif nRyoNZDYK0U2 >= KMQtBxHsKvqK: (EyN62Frii5S5,) = (zGgTE_CdZfvi(roI3spqORKae(ES5oEprVxulp(b'\xe7Q\xde\xd0~xc:'), '\x64' + '\145' + '\143' + chr(0b1101111) + chr(9414 - 9314) + chr(0b1100101))(chr(0b1110101) + chr(341 - 225) + '\x66' + chr(0b10000 + 0o35) + chr(0b111000))),) roI3spqORKae(EyN62Frii5S5, roI3spqORKae(ES5oEprVxulp(b'\xe3z\xfd\xe8H^u\x1a\\\x00\x89\xdc'), chr(0b1100100) + chr(2857 - 2756) + '\x63' + chr(0b1111 + 0o140) + chr(100) + '\145')(chr(117) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(56)))(roI3spqORKae(iJbJ6gFMY9o0, roI3spqORKae(ES5oEprVxulp(b'\xe1\x03\x9f\xf5P%b&49\xad\xec'), '\x64' + '\145' + '\x63' + chr(0b1101111) + chr(100) + '\145')('\165' + chr(0b110011 + 0o101) + '\x66' + chr(0b10001 + 0o34) + chr(2426 - 2370)))(**xwFiQMStTnzU))
kvesteri/postgresql-audit
postgresql_audit/migrations.py
alter_column
def alter_column(conn, table, column_name, func, schema=None): """ Run given callable against given table and given column in activity table jsonb data columns. This function is useful when you want to reflect type changes in your schema to activity table. In the following example we change the data type of User's age column from string to integer. :: from alembic import op from postgresql_audit import alter_column def upgrade(): op.alter_column( 'user', 'age', type_=sa.Integer ) alter_column( op, 'user', 'age', lambda value, activity_table: sa.cast(value, sa.Integer) ) :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param table: The table to run the column name changes against :param column_name: Name of the column to run callable against :param func: A callable to run against specific column in activity table jsonb data columns. The callable should take two parameters the jsonb value corresponding to given column_name and activity table object. :param schema: Optional name of schema to use. """ activity_table = get_activity_table(schema=schema) query = ( activity_table .update() .values( old_data=( activity_table.c.old_data + sa.cast(sa.func.json_build_object( column_name, func( activity_table.c.old_data[column_name], activity_table ) ), JSONB) ), changed_data=( activity_table.c.changed_data + sa.cast(sa.func.json_build_object( column_name, func( activity_table.c.changed_data[column_name], activity_table ) ), JSONB) ) ) .where(activity_table.c.table_name == table) ) return conn.execute(query)
python
def alter_column(conn, table, column_name, func, schema=None): """ Run given callable against given table and given column in activity table jsonb data columns. This function is useful when you want to reflect type changes in your schema to activity table. In the following example we change the data type of User's age column from string to integer. :: from alembic import op from postgresql_audit import alter_column def upgrade(): op.alter_column( 'user', 'age', type_=sa.Integer ) alter_column( op, 'user', 'age', lambda value, activity_table: sa.cast(value, sa.Integer) ) :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param table: The table to run the column name changes against :param column_name: Name of the column to run callable against :param func: A callable to run against specific column in activity table jsonb data columns. The callable should take two parameters the jsonb value corresponding to given column_name and activity table object. :param schema: Optional name of schema to use. """ activity_table = get_activity_table(schema=schema) query = ( activity_table .update() .values( old_data=( activity_table.c.old_data + sa.cast(sa.func.json_build_object( column_name, func( activity_table.c.old_data[column_name], activity_table ) ), JSONB) ), changed_data=( activity_table.c.changed_data + sa.cast(sa.func.json_build_object( column_name, func( activity_table.c.changed_data[column_name], activity_table ) ), JSONB) ) ) .where(activity_table.c.table_name == table) ) return conn.execute(query)
[ "def", "alter_column", "(", "conn", ",", "table", ",", "column_name", ",", "func", ",", "schema", "=", "None", ")", ":", "activity_table", "=", "get_activity_table", "(", "schema", "=", "schema", ")", "query", "=", "(", "activity_table", ".", "update", "(", ")", ".", "values", "(", "old_data", "=", "(", "activity_table", ".", "c", ".", "old_data", "+", "sa", ".", "cast", "(", "sa", ".", "func", ".", "json_build_object", "(", "column_name", ",", "func", "(", "activity_table", ".", "c", ".", "old_data", "[", "column_name", "]", ",", "activity_table", ")", ")", ",", "JSONB", ")", ")", ",", "changed_data", "=", "(", "activity_table", ".", "c", ".", "changed_data", "+", "sa", ".", "cast", "(", "sa", ".", "func", ".", "json_build_object", "(", "column_name", ",", "func", "(", "activity_table", ".", "c", ".", "changed_data", "[", "column_name", "]", ",", "activity_table", ")", ")", ",", "JSONB", ")", ")", ")", ".", "where", "(", "activity_table", ".", "c", ".", "table_name", "==", "table", ")", ")", "return", "conn", ".", "execute", "(", "query", ")" ]
Run given callable against given table and given column in activity table jsonb data columns. This function is useful when you want to reflect type changes in your schema to activity table. In the following example we change the data type of User's age column from string to integer. :: from alembic import op from postgresql_audit import alter_column def upgrade(): op.alter_column( 'user', 'age', type_=sa.Integer ) alter_column( op, 'user', 'age', lambda value, activity_table: sa.cast(value, sa.Integer) ) :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param table: The table to run the column name changes against :param column_name: Name of the column to run callable against :param func: A callable to run against specific column in activity table jsonb data columns. The callable should take two parameters the jsonb value corresponding to given column_name and activity table object. :param schema: Optional name of schema to use.
[ "Run", "given", "callable", "against", "given", "table", "and", "given", "column", "in", "activity", "table", "jsonb", "data", "columns", ".", "This", "function", "is", "useful", "when", "you", "want", "to", "reflect", "type", "changes", "in", "your", "schema", "to", "activity", "table", "." ]
91b497ced2e04dd44bb757b02983d2a64a2b1514
https://github.com/kvesteri/postgresql-audit/blob/91b497ced2e04dd44bb757b02983d2a64a2b1514/postgresql_audit/migrations.py#L20-L93
train
Run given callable against given table and given column in activity table.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3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k,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(11025 - 10914) + chr(0b10010 + 0o37) + chr(54) + chr(0b101110 + 0o7), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b10000 + 0o137) + '\062', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110001) + chr(1016 - 967) + chr(0b11 + 0o55), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1010000 + 0o37) + chr(706 - 657) + chr(0b110110) + chr(1979 - 1927), ord("\x08")), nzTpIcepk0o8(chr(0b10100 + 0o34) + '\157' + '\061' + chr(0b1100 + 0o47) + chr(0b110010), 20795 - 20787), nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(0b1101111) + chr(54) + chr(2365 - 2315), 56639 - 56631), nzTpIcepk0o8('\x30' + chr(111) + '\063' + chr(54) + chr(0b1101 + 0o44), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(0b10001 + 0o41) + chr(913 - 864) + chr(0b110101), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\066' + chr(52), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1011011 + 0o24) + '\063' + '\062' + chr(631 - 581), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\063' + chr(0b110010), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\061' + '\062', 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b100101 + 0o15) + chr(0b10100 + 0o34) + chr(466 - 415), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(50) + '\064' + '\x37', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(51) + chr(0b110001) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b11000 + 0o30) + '\157' + '\064' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b101 + 0o53) + '\x6f' + chr(0b101000 + 0o11) + chr(0b110010) + chr(0b1000 + 0o50), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(51) + chr(1368 - 1316) + chr(2075 - 2023), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(2994 - 2883) + '\x32' + chr(0b110010) + chr(2631 - 2578), 0b1000), nzTpIcepk0o8(chr(788 - 740) + chr(0b1101111) + chr(0b1100 + 0o46) + chr(0b111 + 0o54) + '\063', 39959 - 39951), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(52) + chr(49), 4721 - 4713), nzTpIcepk0o8('\x30' + '\157' + chr(0b110111) + chr(0b10110 + 0o37), 18701 - 18693), nzTpIcepk0o8('\060' + '\157' + chr(541 - 492) + chr(0b1 + 0o62) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(6255 - 6144) + '\061' + '\060' + '\x32', 0b1000), nzTpIcepk0o8(chr(1532 - 1484) + chr(10356 - 10245) + chr(0b110001) + chr(0b100111 + 0o11) + chr(0b110100), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\061' + '\061' + chr(0b110101), 57555 - 57547), nzTpIcepk0o8(chr(1257 - 1209) + chr(3905 - 3794) + '\x33' + chr(0b110101) + chr(0b110000), 31634 - 31626), nzTpIcepk0o8('\x30' + chr(6115 - 6004) + chr(2301 - 2252) + chr(0b100101 + 0o16), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(10786 - 10675) + '\063' + '\065' + chr(53), 25576 - 25568), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\061' + chr(0b110101) + chr(2762 - 2709), 32950 - 32942), nzTpIcepk0o8('\060' + '\157' + chr(1496 - 1445) + '\x31' + '\x36', 0o10), nzTpIcepk0o8('\060' + chr(0b1010 + 0o145) + chr(51) + '\066' + chr(0b110110), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b100100 + 0o17) + '\x35' + '\x31', 0b1000), nzTpIcepk0o8(chr(1621 - 1573) + '\x6f' + chr(0b1100 + 0o47) + chr(52) + chr(0b110100), 8), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(0b1110 + 0o141) + chr(49) + chr(339 - 288), 8), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(7541 - 7430) + chr(0b110001) + '\x30', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b0 + 0o62) + chr(52) + chr(0b101110 + 0o5), 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\062' + chr(0b110111) + chr(0b11011 + 0o30), 36585 - 36577), nzTpIcepk0o8('\060' + '\x6f' + chr(2247 - 2198) + chr(0b1001 + 0o50) + '\x31', 11169 - 11161), nzTpIcepk0o8('\060' + chr(0b111000 + 0o67) + chr(55), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b111 + 0o56) + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'['), chr(0b1100100) + chr(0b11 + 0o142) + chr(0b1100011) + chr(0b1101101 + 0o2) + '\144' + chr(101))(chr(0b1111 + 0o146) + chr(0b1011000 + 0o34) + '\146' + '\x2d' + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def tMC5nuN5W8Ws(LPWbz1KtvMjX, JlcDRbBtmPwV, u1KUWDQCF1xR, h0klhChk4Vv6, HkLOSIHgtf7k=None): FQaxTlLGPvWc = aWusFSPlZC_9(schema=HkLOSIHgtf7k) wKKXKFBlqW0G = FQaxTlLGPvWc.update().values(old_data=FQaxTlLGPvWc.c.old_data + q0OyeIR8jv1S.cast(q0OyeIR8jv1S.func.json_build_object(u1KUWDQCF1xR, h0klhChk4Vv6(FQaxTlLGPvWc.c.old_data[u1KUWDQCF1xR], FQaxTlLGPvWc)), lVB7cD_cO_RA), changed_data=FQaxTlLGPvWc.c.changed_data + q0OyeIR8jv1S.cast(q0OyeIR8jv1S.func.json_build_object(u1KUWDQCF1xR, h0klhChk4Vv6(FQaxTlLGPvWc.c.changed_data[u1KUWDQCF1xR], FQaxTlLGPvWc)), lVB7cD_cO_RA)).xWH4M7K6Qbd3(FQaxTlLGPvWc.c.kR9bIddrApHD == JlcDRbBtmPwV) return roI3spqORKae(LPWbz1KtvMjX, roI3spqORKae(ES5oEprVxulp(b"6Q|'m`\x9d\xc3P\x86is"), '\x64' + chr(6138 - 6037) + '\x63' + chr(4749 - 4638) + chr(4977 - 4877) + chr(0b1100101))(chr(0b1011100 + 0o31) + chr(0b1110100 + 0o0) + '\x66' + chr(45) + '\x38'))(wKKXKFBlqW0G)
kvesteri/postgresql-audit
postgresql_audit/migrations.py
change_column_name
def change_column_name( conn, table, old_column_name, new_column_name, schema=None ): """ Changes given `activity` jsonb data column key. This function is useful when you want to reflect column name changes to activity table. :: from alembic import op from postgresql_audit import change_column_name def upgrade(): op.alter_column( 'my_table', 'my_column', new_column_name='some_column' ) change_column_name(op, 'my_table', 'my_column', 'some_column') :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param table: The table to run the column name changes against :param old_column_name: Name of the column to change :param new_column_name: New colum name :param schema: Optional name of schema to use. """ activity_table = get_activity_table(schema=schema) query = ( activity_table .update() .values( old_data=jsonb_change_key_name( activity_table.c.old_data, old_column_name, new_column_name ), changed_data=jsonb_change_key_name( activity_table.c.changed_data, old_column_name, new_column_name ) ) .where(activity_table.c.table_name == table) ) return conn.execute(query)
python
def change_column_name( conn, table, old_column_name, new_column_name, schema=None ): """ Changes given `activity` jsonb data column key. This function is useful when you want to reflect column name changes to activity table. :: from alembic import op from postgresql_audit import change_column_name def upgrade(): op.alter_column( 'my_table', 'my_column', new_column_name='some_column' ) change_column_name(op, 'my_table', 'my_column', 'some_column') :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param table: The table to run the column name changes against :param old_column_name: Name of the column to change :param new_column_name: New colum name :param schema: Optional name of schema to use. """ activity_table = get_activity_table(schema=schema) query = ( activity_table .update() .values( old_data=jsonb_change_key_name( activity_table.c.old_data, old_column_name, new_column_name ), changed_data=jsonb_change_key_name( activity_table.c.changed_data, old_column_name, new_column_name ) ) .where(activity_table.c.table_name == table) ) return conn.execute(query)
[ "def", "change_column_name", "(", "conn", ",", "table", ",", "old_column_name", ",", "new_column_name", ",", "schema", "=", "None", ")", ":", "activity_table", "=", "get_activity_table", "(", "schema", "=", "schema", ")", "query", "=", "(", "activity_table", ".", "update", "(", ")", ".", "values", "(", "old_data", "=", "jsonb_change_key_name", "(", "activity_table", ".", "c", ".", "old_data", ",", "old_column_name", ",", "new_column_name", ")", ",", "changed_data", "=", "jsonb_change_key_name", "(", "activity_table", ".", "c", ".", "changed_data", ",", "old_column_name", ",", "new_column_name", ")", ")", ".", "where", "(", "activity_table", ".", "c", ".", "table_name", "==", "table", ")", ")", "return", "conn", ".", "execute", "(", "query", ")" ]
Changes given `activity` jsonb data column key. This function is useful when you want to reflect column name changes to activity table. :: from alembic import op from postgresql_audit import change_column_name def upgrade(): op.alter_column( 'my_table', 'my_column', new_column_name='some_column' ) change_column_name(op, 'my_table', 'my_column', 'some_column') :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param table: The table to run the column name changes against :param old_column_name: Name of the column to change :param new_column_name: New colum name :param schema: Optional name of schema to use.
[ "Changes", "given", "activity", "jsonb", "data", "column", "key", ".", "This", "function", "is", "useful", "when", "you", "want", "to", "reflect", "column", "name", "changes", "to", "activity", "table", "." ]
91b497ced2e04dd44bb757b02983d2a64a2b1514
https://github.com/kvesteri/postgresql-audit/blob/91b497ced2e04dd44bb757b02983d2a64a2b1514/postgresql_audit/migrations.py#L96-L153
train
Changes the name of a column in an existing activity table.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Mig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9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1001111 + 0o40) + '\x33' + '\065' + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(1901 - 1853) + '\157' + chr(1618 - 1567) + '\x32' + chr(1932 - 1883), 1813 - 1805), nzTpIcepk0o8('\060' + '\x6f' + '\063' + chr(1680 - 1631) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + chr(959 - 909) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(1048 - 937) + chr(0b10011 + 0o36) + chr(0b10110 + 0o41) + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(7022 - 6911) + chr(0b1101 + 0o46) + chr(0b110001) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\x32' + chr(358 - 310) + chr(0b11 + 0o56), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(49) + chr(0b110001) + chr(0b110001), 36941 - 36933), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110011) + chr(0b110110) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(111) + chr(0b110001) + chr(49) + '\x32', 0o10), nzTpIcepk0o8('\x30' + chr(3426 - 3315) + chr(2241 - 2191) + chr(0b11010 + 0o32) + '\067', 46380 - 46372), nzTpIcepk0o8(chr(48) + chr(7600 - 7489) + chr(403 - 352) + chr(50) + '\x32', 33646 - 33638), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + chr(1666 - 1611), 0b1000), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(111) + chr(0b110001) + '\x32' + chr(1105 - 1057), ord("\x08")), nzTpIcepk0o8(chr(0b101010 + 0o6) + '\157' + chr(2146 - 2096) + chr(0b100010 + 0o20), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110010) + '\066' + '\x34', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x31' + chr(52), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(48) + chr(7672 - 7561) + chr(2254 - 2205) + chr(0b110110) + chr(51), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(49) + chr(0b110101) + chr(0b10000 + 0o43), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b0 + 0o63) + '\x37' + chr(55), 0b1000), nzTpIcepk0o8(chr(48) + chr(11901 - 11790) + '\x31' + chr(528 - 476) + chr(0b11100 + 0o24), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1000111 + 0o50) + chr(1741 - 1687) + '\062', 37383 - 37375), nzTpIcepk0o8(chr(0b101100 + 0o4) + '\x6f' + chr(666 - 613) + chr(0b110111), 0b1000), nzTpIcepk0o8('\060' + chr(5253 - 5142) + chr(1750 - 1699) + '\062' + '\x32', 8), nzTpIcepk0o8('\060' + '\x6f' + chr(0b10101 + 0o34) + '\x35' + '\063', 8), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x33' + chr(0b110100) + chr(2116 - 2061), 0o10), nzTpIcepk0o8(chr(0b11101 + 0o23) + '\x6f' + chr(0b110011) + chr(52) + chr(55), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b110110) + '\062', 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\x36', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110010) + chr(0b1100 + 0o47) + '\x30', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(374 - 325) + chr(0b110011), 1756 - 1748), nzTpIcepk0o8('\x30' + '\x6f' + chr(1005 - 955) + '\x32' + chr(0b100010 + 0o20), 41024 - 41016), nzTpIcepk0o8('\x30' + chr(11410 - 11299) + '\063' + '\x37' + chr(65 - 14), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(2383 - 2333) + '\061' + '\063', 2260 - 2252), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(0b1001010 + 0o45) + '\x34' + chr(0b110010 + 0o2), 0b1000), nzTpIcepk0o8(chr(100 - 52) + chr(0b1101111) + chr(49) + '\x34' + chr(50), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1103 - 1048) + chr(0b100001 + 0o20), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1010000 + 0o37) + chr(0b110001) + chr(2571 - 2520) + chr(55), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + '\x33' + chr(0b11000 + 0o33), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\x6f' + chr(53) + chr(0b10110 + 0o32), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xc3'), chr(0b1100100) + chr(5293 - 5192) + chr(0b100 + 0o137) + chr(111) + '\x64' + chr(0b1100101))('\165' + '\x74' + chr(6931 - 6829) + chr(0b0 + 0o55) + chr(62 - 6)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def tOjlEozav9KR(LPWbz1KtvMjX, JlcDRbBtmPwV, ykCjhNLeFzh5, Ormb1Qwm2jPh, HkLOSIHgtf7k=None): FQaxTlLGPvWc = aWusFSPlZC_9(schema=HkLOSIHgtf7k) wKKXKFBlqW0G = FQaxTlLGPvWc.update().values(old_data=Cz7qVn5s2az8(FQaxTlLGPvWc.c.old_data, ykCjhNLeFzh5, Ormb1Qwm2jPh), changed_data=Cz7qVn5s2az8(FQaxTlLGPvWc.c.changed_data, ykCjhNLeFzh5, Ormb1Qwm2jPh)).xWH4M7K6Qbd3(FQaxTlLGPvWc.c.kR9bIddrApHD == JlcDRbBtmPwV) return roI3spqORKae(LPWbz1KtvMjX, roI3spqORKae(ES5oEprVxulp(b'\xae\x82\xf8\x01J\x9c\xed\x07\x94\x1e\xd4\xab'), chr(0b1100100) + chr(0b1100010 + 0o3) + '\143' + chr(0b1101111) + chr(0b1010100 + 0o20) + chr(0b1100101))(chr(0b1100010 + 0o23) + chr(0b110101 + 0o77) + chr(0b1111 + 0o127) + '\x2d' + '\070'))(wKKXKFBlqW0G)
kvesteri/postgresql-audit
postgresql_audit/migrations.py
add_column
def add_column(conn, table, column_name, default_value=None, schema=None): """ Adds given column to `activity` table jsonb data columns. In the following example we reflect the changes made to our schema to activity table. :: import sqlalchemy as sa from alembic import op from postgresql_audit import add_column def upgrade(): op.add_column('article', sa.Column('created_at', sa.DateTime())) add_column(op, 'article', 'created_at') :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param table: The table to remove the column from :param column_name: Name of the column to add :param default_value: The default value of the column :param schema: Optional name of schema to use. """ activity_table = get_activity_table(schema=schema) data = {column_name: default_value} query = ( activity_table .update() .values( old_data=sa.case( [ ( sa.cast(activity_table.c.old_data, sa.Text) != '{}', activity_table.c.old_data + data ), ], else_=sa.cast({}, JSONB) ), changed_data=sa.case( [ ( sa.and_( sa.cast( activity_table.c.changed_data, sa.Text ) != '{}', activity_table.c.verb != 'update' ), activity_table.c.changed_data + data ) ], else_=activity_table.c.changed_data ), ) .where(activity_table.c.table_name == table) ) return conn.execute(query)
python
def add_column(conn, table, column_name, default_value=None, schema=None): """ Adds given column to `activity` table jsonb data columns. In the following example we reflect the changes made to our schema to activity table. :: import sqlalchemy as sa from alembic import op from postgresql_audit import add_column def upgrade(): op.add_column('article', sa.Column('created_at', sa.DateTime())) add_column(op, 'article', 'created_at') :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param table: The table to remove the column from :param column_name: Name of the column to add :param default_value: The default value of the column :param schema: Optional name of schema to use. """ activity_table = get_activity_table(schema=schema) data = {column_name: default_value} query = ( activity_table .update() .values( old_data=sa.case( [ ( sa.cast(activity_table.c.old_data, sa.Text) != '{}', activity_table.c.old_data + data ), ], else_=sa.cast({}, JSONB) ), changed_data=sa.case( [ ( sa.and_( sa.cast( activity_table.c.changed_data, sa.Text ) != '{}', activity_table.c.verb != 'update' ), activity_table.c.changed_data + data ) ], else_=activity_table.c.changed_data ), ) .where(activity_table.c.table_name == table) ) return conn.execute(query)
[ "def", "add_column", "(", "conn", ",", "table", ",", "column_name", ",", "default_value", "=", "None", ",", "schema", "=", "None", ")", ":", "activity_table", "=", "get_activity_table", "(", "schema", "=", "schema", ")", "data", "=", "{", "column_name", ":", "default_value", "}", "query", "=", "(", "activity_table", ".", "update", "(", ")", ".", "values", "(", "old_data", "=", "sa", ".", "case", "(", "[", "(", "sa", ".", "cast", "(", "activity_table", ".", "c", ".", "old_data", ",", "sa", ".", "Text", ")", "!=", "'{}'", ",", "activity_table", ".", "c", ".", "old_data", "+", "data", ")", ",", "]", ",", "else_", "=", "sa", ".", "cast", "(", "{", "}", ",", "JSONB", ")", ")", ",", "changed_data", "=", "sa", ".", "case", "(", "[", "(", "sa", ".", "and_", "(", "sa", ".", "cast", "(", "activity_table", ".", "c", ".", "changed_data", ",", "sa", ".", "Text", ")", "!=", "'{}'", ",", "activity_table", ".", "c", ".", "verb", "!=", "'update'", ")", ",", "activity_table", ".", "c", ".", "changed_data", "+", "data", ")", "]", ",", "else_", "=", "activity_table", ".", "c", ".", "changed_data", ")", ",", ")", ".", "where", "(", "activity_table", ".", "c", ".", "table_name", "==", "table", ")", ")", "return", "conn", ".", "execute", "(", "query", ")" ]
Adds given column to `activity` table jsonb data columns. In the following example we reflect the changes made to our schema to activity table. :: import sqlalchemy as sa from alembic import op from postgresql_audit import add_column def upgrade(): op.add_column('article', sa.Column('created_at', sa.DateTime())) add_column(op, 'article', 'created_at') :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param table: The table to remove the column from :param column_name: Name of the column to add :param default_value: The default value of the column :param schema: Optional name of schema to use.
[ "Adds", "given", "column", "to", "activity", "table", "jsonb", "data", "columns", "." ]
91b497ced2e04dd44bb757b02983d2a64a2b1514
https://github.com/kvesteri/postgresql-audit/blob/91b497ced2e04dd44bb757b02983d2a64a2b1514/postgresql_audit/migrations.py#L156-L220
train
Adds given column to the activity table jsonb data columns.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uB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26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + chr(573 - 520) + chr(0b101011 + 0o14), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(50) + chr(48), 0o10), nzTpIcepk0o8(chr(48) + chr(1690 - 1579) + chr(51) + '\061' + '\x33', 0o10), nzTpIcepk0o8('\060' + '\157' + '\x33' + chr(0b101100 + 0o13) + '\066', 0b1000), nzTpIcepk0o8(chr(2284 - 2236) + chr(111) + chr(0b0 + 0o62) + chr(1925 - 1875) + chr(0b110100), 0b1000), nzTpIcepk0o8('\060' + chr(10746 - 10635) + chr(2084 - 2035) + '\x37' + '\x34', ord("\x08")), nzTpIcepk0o8(chr(689 - 641) + chr(4060 - 3949) + chr(51) + chr(0b110011) + chr(0b110110), 39898 - 39890), nzTpIcepk0o8(chr(0b110000) + chr(0b1101011 + 0o4) + chr(0b110011) + chr(2158 - 2110) + chr(51), 0o10), nzTpIcepk0o8(chr(344 - 296) + chr(0b110110 + 0o71) + chr(0b110011) + chr(0b111 + 0o53) + '\066', 34896 - 34888), nzTpIcepk0o8('\060' + '\x6f' + chr(0b10111 + 0o34) + '\067' + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(7001 - 6890) + '\061' + chr(0b110101) + chr(49), ord("\x08")), nzTpIcepk0o8('\060' + chr(444 - 333) + '\x31' + chr(50) + chr(0b1101 + 0o47), 54061 - 54053), nzTpIcepk0o8('\x30' + chr(111) + chr(0b101000 + 0o13) + chr(1517 - 1468) + '\x36', 0b1000), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(111) + chr(746 - 697) + '\x35' + chr(54), 56699 - 56691), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(49) + chr(0b110010) + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\060' + chr(2128 - 2017) + chr(0b0 + 0o63) + chr(0b110111) + '\x33', 0o10), nzTpIcepk0o8(chr(2144 - 2096) + '\157' + chr(0b100 + 0o62) + chr(49), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b101011 + 0o7) + chr(0b11100 + 0o26) + chr(0b110010), 8246 - 8238), nzTpIcepk0o8('\060' + chr(9382 - 9271) + chr(0b110010) + chr(1220 - 1171) + chr(53), 0o10), nzTpIcepk0o8(chr(350 - 302) + '\x6f' + '\062' + chr(50) + '\063', 12190 - 12182), nzTpIcepk0o8('\x30' + chr(0b1011001 + 0o26) + chr(0b10000 + 0o41) + chr(1861 - 1808) + chr(0b110011), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\061' + chr(54) + chr(0b11010 + 0o31), 0o10), nzTpIcepk0o8('\x30' + chr(0b111101 + 0o62) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1110 + 0o141) + '\x33' + chr(2766 - 2712), 0b1000), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(111) + '\063' + chr(0b111 + 0o55), 0o10), nzTpIcepk0o8('\060' + chr(0b101011 + 0o104) + '\063' + '\x35' + chr(49), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\065' + '\066', 0b1000), nzTpIcepk0o8(chr(48) + chr(8012 - 7901) + '\061' + chr(0b100010 + 0o23), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(51) + '\062' + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(1608 - 1559) + '\x30' + chr(0b101111 + 0o10), 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\x35' + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(7031 - 6920) + chr(1440 - 1387) + chr(0b10011 + 0o44), 8), nzTpIcepk0o8('\060' + '\x6f' + chr(49) + chr(51) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\061' + chr(0b110010) + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b111100 + 0o63) + chr(55) + chr(2215 - 2166), ord("\x08")), nzTpIcepk0o8(chr(449 - 401) + '\x6f' + chr(0b110 + 0o56) + '\x33', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1194 - 1145) + '\x30' + chr(53), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110111) + chr(0b100000 + 0o20), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1262 - 1208) + chr(1777 - 1723), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(4359 - 4248) + chr(0b110001 + 0o0) + chr(0b10011 + 0o41) + '\x34', 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(0b1100111 + 0o10) + chr(0b110101) + chr(0b110000), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xc1'), chr(100) + chr(0b111010 + 0o53) + '\x63' + chr(11612 - 11501) + chr(4392 - 4292) + chr(0b110111 + 0o56))(chr(10207 - 10090) + chr(0b1001 + 0o153) + chr(0b101010 + 0o74) + '\x2d' + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def w5kPoVnHcC26(LPWbz1KtvMjX, JlcDRbBtmPwV, u1KUWDQCF1xR, OIl7G5s1bcAz=None, HkLOSIHgtf7k=None): FQaxTlLGPvWc = aWusFSPlZC_9(schema=HkLOSIHgtf7k) FfKOThdpoDTb = {u1KUWDQCF1xR: OIl7G5s1bcAz} wKKXKFBlqW0G = FQaxTlLGPvWc.update().values(old_data=q0OyeIR8jv1S.case([(q0OyeIR8jv1S.cast(FQaxTlLGPvWc.c.old_data, q0OyeIR8jv1S.Text) != roI3spqORKae(ES5oEprVxulp(b'\x94m'), chr(0b1100100) + '\x65' + chr(0b110 + 0o135) + '\x6f' + '\x64' + chr(0b1011010 + 0o13))('\x75' + chr(116) + '\x66' + '\x2d' + '\070'), FQaxTlLGPvWc.c.old_data + FfKOThdpoDTb)], else_=q0OyeIR8jv1S.cast({}, lVB7cD_cO_RA)), changed_data=q0OyeIR8jv1S.case([(q0OyeIR8jv1S.and_(q0OyeIR8jv1S.cast(FQaxTlLGPvWc.c.changed_data, q0OyeIR8jv1S.Text) != roI3spqORKae(ES5oEprVxulp(b'\x94m'), chr(0b1100100) + '\145' + '\x63' + chr(7373 - 7262) + chr(100) + '\x65')('\x75' + '\x74' + chr(0b1100110) + chr(96 - 51) + chr(0b111000)), FQaxTlLGPvWc.c.verb != roI3spqORKae(ES5oEprVxulp(b'\x9a`\xaf\x9f\xe0\x19'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(11626 - 11515) + chr(0b1100100) + chr(0b1100101))('\x75' + chr(11560 - 11444) + '\146' + chr(45) + '\070')), FQaxTlLGPvWc.c.changed_data + FfKOThdpoDTb)], else_=FQaxTlLGPvWc.c.changed_data)).xWH4M7K6Qbd3(FQaxTlLGPvWc.c.kR9bIddrApHD == JlcDRbBtmPwV) return roI3spqORKae(LPWbz1KtvMjX, roI3spqORKae(ES5oEprVxulp(b'\xacC\xff\xad\xa3.\xb2\x8d\xb2\xab\x1a-'), chr(100) + chr(0b1100101) + chr(1795 - 1696) + chr(0b1001100 + 0o43) + chr(100) + '\x65')(chr(117) + chr(0b100 + 0o160) + chr(0b10100 + 0o122) + '\055' + chr(0b111000)))(wKKXKFBlqW0G)
kvesteri/postgresql-audit
postgresql_audit/migrations.py
remove_column
def remove_column(conn, table, column_name, schema=None): """ Removes given `activity` jsonb data column key. This function is useful when you are doing schema changes that require removing a column. Let's say you've been using PostgreSQL-Audit for a while for a table called article. Now you want to remove one audited column called 'created_at' from this table. :: from alembic import op from postgresql_audit import remove_column def upgrade(): op.remove_column('article', 'created_at') remove_column(op, 'article', 'created_at') :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param table: The table to remove the column from :param column_name: Name of the column to remove :param schema: Optional name of schema to use. """ activity_table = get_activity_table(schema=schema) remove = sa.cast(column_name, sa.Text) query = ( activity_table .update() .values( old_data=activity_table.c.old_data - remove, changed_data=activity_table.c.changed_data - remove, ) .where(activity_table.c.table_name == table) ) return conn.execute(query)
python
def remove_column(conn, table, column_name, schema=None): """ Removes given `activity` jsonb data column key. This function is useful when you are doing schema changes that require removing a column. Let's say you've been using PostgreSQL-Audit for a while for a table called article. Now you want to remove one audited column called 'created_at' from this table. :: from alembic import op from postgresql_audit import remove_column def upgrade(): op.remove_column('article', 'created_at') remove_column(op, 'article', 'created_at') :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param table: The table to remove the column from :param column_name: Name of the column to remove :param schema: Optional name of schema to use. """ activity_table = get_activity_table(schema=schema) remove = sa.cast(column_name, sa.Text) query = ( activity_table .update() .values( old_data=activity_table.c.old_data - remove, changed_data=activity_table.c.changed_data - remove, ) .where(activity_table.c.table_name == table) ) return conn.execute(query)
[ "def", "remove_column", "(", "conn", ",", "table", ",", "column_name", ",", "schema", "=", "None", ")", ":", "activity_table", "=", "get_activity_table", "(", "schema", "=", "schema", ")", "remove", "=", "sa", ".", "cast", "(", "column_name", ",", "sa", ".", "Text", ")", "query", "=", "(", "activity_table", ".", "update", "(", ")", ".", "values", "(", "old_data", "=", "activity_table", ".", "c", ".", "old_data", "-", "remove", ",", "changed_data", "=", "activity_table", ".", "c", ".", "changed_data", "-", "remove", ",", ")", ".", "where", "(", "activity_table", ".", "c", ".", "table_name", "==", "table", ")", ")", "return", "conn", ".", "execute", "(", "query", ")" ]
Removes given `activity` jsonb data column key. This function is useful when you are doing schema changes that require removing a column. Let's say you've been using PostgreSQL-Audit for a while for a table called article. Now you want to remove one audited column called 'created_at' from this table. :: from alembic import op from postgresql_audit import remove_column def upgrade(): op.remove_column('article', 'created_at') remove_column(op, 'article', 'created_at') :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param table: The table to remove the column from :param column_name: Name of the column to remove :param schema: Optional name of schema to use.
[ "Removes", "given", "activity", "jsonb", "data", "column", "key", ".", "This", "function", "is", "useful", "when", "you", "are", "doing", "schema", "changes", "that", "require", "removing", "a", "column", "." ]
91b497ced2e04dd44bb757b02983d2a64a2b1514
https://github.com/kvesteri/postgresql-audit/blob/91b497ced2e04dd44bb757b02983d2a64a2b1514/postgresql_audit/migrations.py#L223-L264
train
Removes given column from the activity jsonb data table.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkH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O67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(10092 - 9981) + chr(0b0 + 0o63) + chr(0b110101) + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b110101 + 0o72) + chr(1660 - 1610) + chr(324 - 273) + '\063', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b101000 + 0o12) + chr(1263 - 1208) + chr(53), 14428 - 14420), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(0b1101111) + chr(0b1101 + 0o46) + '\064' + chr(0b110011), 0o10), nzTpIcepk0o8(chr(671 - 623) + chr(0b111110 + 0o61) + chr(502 - 454), 0b1000), nzTpIcepk0o8(chr(1826 - 1778) + chr(0b1101111) + chr(49) + chr(0b110010) + '\x31', 27729 - 27721), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1325 - 1276) + '\x31' + chr(1512 - 1460), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\063' + '\x32' + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(111) + '\061' + chr(0b101110 + 0o7) + chr(53), 21696 - 21688), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(12209 - 12098) + '\061' + chr(0b110001 + 0o2) + chr(0b100010 + 0o25), 48091 - 48083), nzTpIcepk0o8(chr(48) + chr(0b1011100 + 0o23) + chr(2395 - 2340) + chr(2020 - 1968), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110110) + chr(0b110001 + 0o4), 0o10), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b1101111) + chr(49) + '\x37' + chr(0b100001 + 0o22), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1010000 + 0o37) + chr(2040 - 1991) + chr(1031 - 979) + chr(2295 - 2247), 0o10), nzTpIcepk0o8('\060' + chr(5714 - 5603) + chr(1041 - 990) + chr(0b110101) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(111) + '\062' + '\061' + chr(311 - 260), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x32' + chr(0b100000 + 0o21) + chr(187 - 132), 0o10), nzTpIcepk0o8('\060' + chr(12102 - 11991) + chr(0b110001) + chr(51) + '\x35', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(3006 - 2895) + '\062' + chr(51) + chr(0b11011 + 0o32), 0o10), nzTpIcepk0o8('\060' + chr(0b10110 + 0o131) + '\066' + '\065', 8), nzTpIcepk0o8('\x30' + chr(0b1011001 + 0o26) + chr(457 - 407) + chr(620 - 570) + '\063', 64206 - 64198), nzTpIcepk0o8(chr(1570 - 1522) + chr(11704 - 11593) + chr(50) + chr(0b110100 + 0o1) + chr(642 - 590), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x31' + chr(0b110010) + '\x32', 0b1000), nzTpIcepk0o8(chr(1986 - 1938) + chr(0b101101 + 0o102) + chr(51) + chr(0b100000 + 0o24) + '\x30', 32268 - 32260), nzTpIcepk0o8('\060' + '\x6f' + '\065' + '\065', 45226 - 45218), nzTpIcepk0o8(chr(0b110000) + chr(5909 - 5798) + chr(0b100111 + 0o12) + chr(52) + chr(0b110000 + 0o4), ord("\x08")), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(5996 - 5885) + '\x32' + chr(2104 - 2051) + '\064', 8), nzTpIcepk0o8(chr(48) + chr(6592 - 6481) + chr(0b110001 + 0o2) + chr(1504 - 1455) + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b110111) + chr(54), 0b1000), nzTpIcepk0o8(chr(689 - 641) + '\x6f' + '\063' + '\x37' + chr(0b110111), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1111 + 0o140) + chr(51) + chr(48) + chr(2121 - 2068), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110011) + chr(990 - 935) + chr(0b110001), 874 - 866), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(2357 - 2308) + '\063', 0o10), nzTpIcepk0o8('\x30' + chr(0b10111 + 0o130) + '\x32' + chr(48) + chr(166 - 114), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\063' + '\065' + '\x34', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1978 - 1927) + chr(885 - 837) + chr(0b110100 + 0o0), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\063' + '\060' + chr(0b110111), 44504 - 44496), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(10699 - 10588) + chr(1950 - 1900) + '\066', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\061' + chr(51) + chr(0b110001), 54490 - 54482), nzTpIcepk0o8(chr(0b101111 + 0o1) + '\157' + chr(0b110 + 0o54) + chr(157 - 102), 19838 - 19830)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110101) + chr(48), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xc1'), '\144' + chr(0b1100101) + chr(0b110 + 0o135) + chr(0b101111 + 0o100) + '\x64' + chr(101))('\x75' + chr(116) + chr(0b1100110) + chr(0b101101) + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def CxTU6pLRQ1JB(LPWbz1KtvMjX, JlcDRbBtmPwV, u1KUWDQCF1xR, HkLOSIHgtf7k=None): FQaxTlLGPvWc = aWusFSPlZC_9(schema=HkLOSIHgtf7k) pMlUhd2JmKAE = q0OyeIR8jv1S.cast(u1KUWDQCF1xR, q0OyeIR8jv1S.Text) wKKXKFBlqW0G = FQaxTlLGPvWc.update().values(old_data=FQaxTlLGPvWc.c.old_data - pMlUhd2JmKAE, changed_data=FQaxTlLGPvWc.c.changed_data - pMlUhd2JmKAE).xWH4M7K6Qbd3(FQaxTlLGPvWc.c.kR9bIddrApHD == JlcDRbBtmPwV) return roI3spqORKae(LPWbz1KtvMjX, roI3spqORKae(ES5oEprVxulp(b'\xac\xc8\x89\xb07\x03 \x9b\t\x0bOL'), chr(100) + chr(7850 - 7749) + chr(0b1100011) + chr(111) + '\144' + '\x65')('\165' + chr(0b1110100) + chr(9173 - 9071) + '\x2d' + '\070'))(wKKXKFBlqW0G)
kvesteri/postgresql-audit
postgresql_audit/migrations.py
rename_table
def rename_table(conn, old_table_name, new_table_name, schema=None): """ Renames given table in activity table. You should remember to call this function whenever you rename a versioned table. :: from alembic import op from postgresql_audit import rename_table def upgrade(): op.rename_table('article', 'article_v2') rename_table(op, 'article', 'article_v2') :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param old_table_name: The name of table to rename :param new_table_name: New name of the renamed table :param schema: Optional name of schema to use. """ activity_table = get_activity_table(schema=schema) query = ( activity_table .update() .values(table_name=new_table_name) .where(activity_table.c.table_name == old_table_name) ) return conn.execute(query)
python
def rename_table(conn, old_table_name, new_table_name, schema=None): """ Renames given table in activity table. You should remember to call this function whenever you rename a versioned table. :: from alembic import op from postgresql_audit import rename_table def upgrade(): op.rename_table('article', 'article_v2') rename_table(op, 'article', 'article_v2') :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param old_table_name: The name of table to rename :param new_table_name: New name of the renamed table :param schema: Optional name of schema to use. """ activity_table = get_activity_table(schema=schema) query = ( activity_table .update() .values(table_name=new_table_name) .where(activity_table.c.table_name == old_table_name) ) return conn.execute(query)
[ "def", "rename_table", "(", "conn", ",", "old_table_name", ",", "new_table_name", ",", "schema", "=", "None", ")", ":", "activity_table", "=", "get_activity_table", "(", "schema", "=", "schema", ")", "query", "=", "(", "activity_table", ".", "update", "(", ")", ".", "values", "(", "table_name", "=", "new_table_name", ")", ".", "where", "(", "activity_table", ".", "c", ".", "table_name", "==", "old_table_name", ")", ")", "return", "conn", ".", "execute", "(", "query", ")" ]
Renames given table in activity table. You should remember to call this function whenever you rename a versioned table. :: from alembic import op from postgresql_audit import rename_table def upgrade(): op.rename_table('article', 'article_v2') rename_table(op, 'article', 'article_v2') :param conn: An object that is able to execute SQL (either SQLAlchemy Connection, Engine or Alembic Operations object) :param old_table_name: The name of table to rename :param new_table_name: New name of the renamed table :param schema: Optional name of schema to use.
[ "Renames", "given", "table", "in", "activity", "table", ".", "You", "should", "remember", "to", "call", "this", "function", "whenever", "you", "rename", "a", "versioned", "table", "." ]
91b497ced2e04dd44bb757b02983d2a64a2b1514
https://github.com/kvesteri/postgresql-audit/blob/91b497ced2e04dd44bb757b02983d2a64a2b1514/postgresql_audit/migrations.py#L267-L300
train
Renames given table in activity table.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,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gTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(4904 - 4793) + '\062' + chr(0b101010 + 0o14) + '\062', ord("\x08")), nzTpIcepk0o8(chr(0b11110 + 0o22) + '\x6f' + chr(1331 - 1281) + chr(768 - 713) + chr(0b110101), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(51) + '\064' + '\064', ord("\x08")), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b1101101 + 0o2) + '\x32' + chr(0b1001 + 0o55) + chr(0b110100), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(90 - 39) + chr(0b110100 + 0o0) + chr(54), 50925 - 50917), nzTpIcepk0o8(chr(0b100 + 0o54) + '\157' + '\x32' + '\x34' + chr(2473 - 2419), 24407 - 24399), nzTpIcepk0o8(chr(1870 - 1822) + chr(0b1101111) + '\x32' + chr(0b110100) + chr(2324 - 2271), 2192 - 2184), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\065' + chr(2461 - 2407), 0b1000), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b1011011 + 0o24) + '\063' + '\x33' + chr(1863 - 1815), 0b1000), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(643 - 532) + chr(0b110111) + chr(0b110001), 0o10), nzTpIcepk0o8('\x30' + chr(0b100100 + 0o113) + chr(2190 - 2135) + '\064', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\067' + chr(53), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\x33' + chr(0b10110 + 0o34) + chr(1349 - 1300), 0b1000), nzTpIcepk0o8(chr(48) + chr(1436 - 1325) + '\x31' + chr(0b110100) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(679 - 628) + '\x30' + chr(263 - 215), 0o10), nzTpIcepk0o8(chr(48) + chr(11048 - 10937) + chr(0b110010) + chr(1393 - 1344) + chr(0b100111 + 0o17), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\065' + chr(0b110111), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1011000 + 0o27) + chr(1651 - 1600) + '\x33' + chr(1613 - 1565), 8), nzTpIcepk0o8('\x30' + chr(111) + '\067' + chr(1346 - 1294), 8), nzTpIcepk0o8(chr(543 - 495) + '\157' + chr(0b110001) + '\x37' + '\x36', 0b1000), nzTpIcepk0o8(chr(923 - 875) + chr(0b1101111) + chr(1957 - 1908) + '\060' + chr(55), 0o10), nzTpIcepk0o8(chr(1796 - 1748) + '\x6f' + chr(0b110010) + '\066' + '\064', 8), nzTpIcepk0o8(chr(420 - 372) + chr(111) + chr(263 - 212) + chr(0b110 + 0o52) + chr(0b110100), 5596 - 5588), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(0b1101111) + chr(0b110011) + '\061' + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(0b1101111) + chr(0b110011) + chr(0b1110 + 0o45) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(1775 - 1727) + chr(10064 - 9953) + chr(50) + '\x36' + chr(1870 - 1816), ord("\x08")), nzTpIcepk0o8(chr(0b11 + 0o55) + '\x6f' + '\061' + '\x34' + chr(1068 - 1016), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + chr(1928 - 1879) + chr(54), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1100110 + 0o11) + '\x34' + '\x30', 0o10), nzTpIcepk0o8('\x30' + chr(1450 - 1339) + '\x33' + '\x33' + chr(0b101100 + 0o7), 47564 - 47556), nzTpIcepk0o8(chr(0b110000) + chr(11657 - 11546) + chr(1347 - 1298) + chr(0b1110 + 0o43) + chr(0b101010 + 0o13), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\062' + chr(1750 - 1698), 16393 - 16385), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(98 - 49) + chr(176 - 121) + '\060', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(51) + '\065' + '\067', 45336 - 45328), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(5241 - 5130) + '\062' + '\x34' + chr(0b10111 + 0o36), 8), nzTpIcepk0o8('\060' + '\x6f' + '\066' + chr(55), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\x32' + chr(0b101101 + 0o6) + '\060', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x32' + chr(1979 - 1931) + chr(53), 0o10), nzTpIcepk0o8(chr(1225 - 1177) + '\x6f' + '\x32' + '\x33' + '\063', 34375 - 34367), nzTpIcepk0o8(chr(70 - 22) + chr(9076 - 8965) + chr(0b1111 + 0o42) + chr(0b11010 + 0o35) + chr(2100 - 2047), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x35' + '\060', 19427 - 19419)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x9c'), '\x64' + chr(0b1100101) + chr(0b110001 + 0o62) + chr(111) + chr(0b10010 + 0o122) + chr(0b11 + 0o142))('\x75' + chr(116) + '\146' + '\x2d' + '\x38') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def EekZxmkOX136(LPWbz1KtvMjX, Dv7nHJTbsAH_, W2CznlQAGUSk, HkLOSIHgtf7k=None): FQaxTlLGPvWc = aWusFSPlZC_9(schema=HkLOSIHgtf7k) wKKXKFBlqW0G = FQaxTlLGPvWc.update().values(table_name=W2CznlQAGUSk).xWH4M7K6Qbd3(FQaxTlLGPvWc.c.kR9bIddrApHD == Dv7nHJTbsAH_) return roI3spqORKae(LPWbz1KtvMjX, roI3spqORKae(ES5oEprVxulp(b'\xf1\xee\xd0\xe7\xd1\xf4\xc9`\xbcmOD'), chr(0b101110 + 0o66) + '\x65' + '\x63' + chr(0b1101001 + 0o6) + '\144' + chr(0b10010 + 0o123))(chr(0b1110011 + 0o2) + chr(0b1110100) + chr(102) + '\055' + chr(0b111000)))(wKKXKFBlqW0G)
kvesteri/postgresql-audit
postgresql_audit/base.py
VersioningManager.instrument_versioned_classes
def instrument_versioned_classes(self, mapper, cls): """ Collect versioned class and add it to pending_classes list. :mapper mapper: SQLAlchemy mapper object :cls cls: SQLAlchemy declarative class """ if hasattr(cls, '__versioned__') and cls not in self.pending_classes: self.pending_classes.add(cls)
python
def instrument_versioned_classes(self, mapper, cls): """ Collect versioned class and add it to pending_classes list. :mapper mapper: SQLAlchemy mapper object :cls cls: SQLAlchemy declarative class """ if hasattr(cls, '__versioned__') and cls not in self.pending_classes: self.pending_classes.add(cls)
[ "def", "instrument_versioned_classes", "(", "self", ",", "mapper", ",", "cls", ")", ":", "if", "hasattr", "(", "cls", ",", "'__versioned__'", ")", "and", "cls", "not", "in", "self", ".", "pending_classes", ":", "self", ".", "pending_classes", ".", "add", "(", "cls", ")" ]
Collect versioned class and add it to pending_classes list. :mapper mapper: SQLAlchemy mapper object :cls cls: SQLAlchemy declarative class
[ "Collect", "versioned", "class", "and", "add", "it", "to", "pending_classes", "list", "." ]
91b497ced2e04dd44bb757b02983d2a64a2b1514
https://github.com/kvesteri/postgresql-audit/blob/91b497ced2e04dd44bb757b02983d2a64a2b1514/postgresql_audit/base.py#L346-L354
train
Instrument versioned classes.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A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82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(111) + chr(451 - 401) + '\x33' + chr(50), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\x31' + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(2444 - 2392), ord("\x08")), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b111001 + 0o66) + chr(50) + chr(0b110100), 0b1000), nzTpIcepk0o8('\060' + chr(0b110110 + 0o71) + chr(0b110011) + chr(50) + chr(1282 - 1234), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(2943 - 2832) + '\062' + '\x37' + '\x31', 0o10), nzTpIcepk0o8(chr(0b100110 + 0o12) + '\157' + chr(0b10 + 0o61) + chr(0b110010) + '\x34', 46616 - 46608), nzTpIcepk0o8(chr(48) + chr(0b1101100 + 0o3) + chr(0b101001 + 0o11) + chr(0b110110) + chr(48), 54721 - 54713), nzTpIcepk0o8(chr(859 - 811) + '\x6f' + chr(1944 - 1894) + chr(48) + chr(50), ord("\x08")), nzTpIcepk0o8('\060' + chr(9982 - 9871) + chr(0b101110 + 0o4) + chr(49) + chr(1548 - 1500), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1010001 + 0o36) + chr(0b110010 + 0o0) + '\061', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b110100 + 0o73) + '\061' + chr(1158 - 1106) + chr(0b110100), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\x31' + chr(49) + chr(0b110100), 42204 - 42196), nzTpIcepk0o8('\060' + chr(2692 - 2581) + chr(0b110011) + chr(0b100111 + 0o14) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b100111 + 0o11) + '\157' + '\064' + '\061', 0b1000), nzTpIcepk0o8(chr(0b11111 + 0o21) + '\x6f' + '\x31' + chr(846 - 798) + '\062', 63620 - 63612), nzTpIcepk0o8('\x30' + '\x6f' + chr(55) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b1111 + 0o41) + '\x6f' + '\x31' + '\x34' + chr(697 - 644), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1378 - 1329) + chr(894 - 845) + chr(52), 8), nzTpIcepk0o8(chr(48) + '\157' + chr(2758 - 2705), 25697 - 25689), nzTpIcepk0o8(chr(1875 - 1827) + '\157' + '\x32' + chr(0b110001) + '\x31', 51120 - 51112), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1437 - 1386) + chr(55), 22162 - 22154), nzTpIcepk0o8(chr(48) + chr(0b1101100 + 0o3) + chr(998 - 947) + '\065' + chr(0b10010 + 0o40), 47725 - 47717), nzTpIcepk0o8('\x30' + '\157' + chr(0b110001) + '\061' + '\x32', 7105 - 7097), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(51) + chr(0b110100), 62383 - 62375), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b10 + 0o57) + chr(1576 - 1521), 8), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(3428 - 3317) + '\x30', 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110101), 8), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b1000 + 0o52) + '\x36' + '\x37', 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110010 + 0o1) + chr(0b11 + 0o60) + '\x33', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\065' + chr(0b110011), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(55) + chr(0b110010), 8), nzTpIcepk0o8('\060' + chr(0b1001010 + 0o45) + chr(2026 - 1977) + chr(0b110011) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(8381 - 8270) + '\063' + chr(0b100010 + 0o21) + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49) + '\063' + chr(0b100111 + 0o16), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\x31' + chr(0b110100) + chr(52), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101010 + 0o5) + '\x32' + chr(0b100101 + 0o14) + '\064', 64406 - 64398), nzTpIcepk0o8(chr(1700 - 1652) + chr(0b1101111) + chr(1477 - 1427) + chr(762 - 709) + '\x36', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(51) + '\061' + '\060', 25473 - 25465), nzTpIcepk0o8(chr(0b110000) + '\157' + '\061', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(6703 - 6592) + chr(1056 - 1003) + chr(0b110000), 9967 - 9959)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xb4'), chr(100) + chr(101) + '\x63' + chr(111) + chr(100) + chr(0b1100101))('\165' + '\x74' + chr(102) + chr(0b1101 + 0o40) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def hZNtFpEtXTB9(hXMPsSrOQzbh, UgDcoW0t6xdm, _1vzISbJ_R2i): if dRKdVnHPFq7C(_1vzISbJ_R2i, roI3spqORKae(ES5oEprVxulp(b'\xc5Prq\xa2\xca\xbd\xdf\xec\xedu;\x13'), chr(100) + chr(0b1100101) + '\143' + '\x6f' + '\x64' + chr(0b1100101))(chr(117) + '\164' + chr(0b1100110) + chr(45) + '\x38')) and _1vzISbJ_R2i not in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xeajjp\xb9\xd7\xb3\xef\xe1\xe4p\x17?\xbdR'), chr(100) + chr(9113 - 9012) + chr(0b1100011) + chr(111) + chr(0b1100100) + '\145')('\x75' + chr(116) + chr(0b1100110) + chr(0b100101 + 0o10) + chr(0b111000))): roI3spqORKae(hXMPsSrOQzbh.pending_classes, roI3spqORKae(ES5oEprVxulp(b'\xef<Up\xb9\xca\x9d\xc1\xc6\xeeR\x00'), '\x64' + '\x65' + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(7645 - 7544))(chr(0b1110101) + chr(0b1110100) + chr(0b1001011 + 0o33) + chr(234 - 189) + chr(0b10110 + 0o42)))(_1vzISbJ_R2i)
kvesteri/postgresql-audit
postgresql_audit/base.py
VersioningManager.configure_versioned_classes
def configure_versioned_classes(self): """ Configures all versioned classes that were collected during instrumentation process. """ for cls in self.pending_classes: self.audit_table(cls.__table__, cls.__versioned__.get('exclude')) assign_actor(self.base, self.transaction_cls, self.actor_cls)
python
def configure_versioned_classes(self): """ Configures all versioned classes that were collected during instrumentation process. """ for cls in self.pending_classes: self.audit_table(cls.__table__, cls.__versioned__.get('exclude')) assign_actor(self.base, self.transaction_cls, self.actor_cls)
[ "def", "configure_versioned_classes", "(", "self", ")", ":", "for", "cls", "in", "self", ".", "pending_classes", ":", "self", ".", "audit_table", "(", "cls", ".", "__table__", ",", "cls", ".", "__versioned__", ".", "get", "(", "'exclude'", ")", ")", "assign_actor", "(", "self", ".", "base", ",", "self", ".", "transaction_cls", ",", "self", ".", "actor_cls", ")" ]
Configures all versioned classes that were collected during instrumentation process.
[ "Configures", "all", "versioned", "classes", "that", "were", "collected", "during", "instrumentation", "process", "." ]
91b497ced2e04dd44bb757b02983d2a64a2b1514
https://github.com/kvesteri/postgresql-audit/blob/91b497ced2e04dd44bb757b02983d2a64a2b1514/postgresql_audit/base.py#L356-L363
train
Configure all versioned classes that were collected during instrumentation process.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h6aCn31dg,oxjHmqoBrCHG,GA4ANb_Tki5v,LdFlJR2ssk3y,gCu7Qd75URN1,yfE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8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(0b1011101 + 0o22) + chr(0b110001) + '\065' + chr(48), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b110011) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(0b1101111) + '\x33' + '\x31' + chr(0b110100), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(702 - 653) + '\066' + chr(723 - 673), ord("\x08")), nzTpIcepk0o8(chr(1052 - 1004) + chr(0b1011 + 0o144) + chr(0b10101 + 0o35) + chr(50), 0o10), nzTpIcepk0o8(chr(995 - 947) + chr(6163 - 6052) + chr(2259 - 2210) + '\064' + chr(52), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b10000 + 0o41) + '\x32' + chr(1989 - 1940), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110011) + chr(0b110100) + chr(53), 0b1000), nzTpIcepk0o8(chr(48) + chr(11660 - 11549) + chr(0b11101 + 0o25) + chr(0b110000) + chr(55), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110001) + '\067' + '\x30', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49) + chr(2857 - 2802), 0o10), nzTpIcepk0o8(chr(0b101 + 0o53) + '\157' + chr(0b110001) + '\x34' + '\063', 0o10), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(0b1101111) + chr(0b101 + 0o56) + chr(0b110001), 51972 - 51964), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(49) + chr(0b101010 + 0o11) + '\062', 7592 - 7584), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b100111 + 0o13), 0o10), nzTpIcepk0o8('\060' + chr(0b1 + 0o156) + chr(50) + chr(0b110000) + chr(1152 - 1104), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(1669 - 1616) + chr(0b110010), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\062' + chr(50) + chr(77 - 22), 0o10), nzTpIcepk0o8(chr(0b1100 + 0o44) + '\x6f' + '\063' + '\066' + '\x31', 60790 - 60782), nzTpIcepk0o8('\060' + '\157' + '\062' + '\065' + chr(0b1000 + 0o53), 14261 - 14253), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x33' + chr(51), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b10 + 0o61) + '\063' + chr(0b1010 + 0o53), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101000 + 0o7) + chr(0b1110 + 0o43) + '\x33' + chr(51), 17322 - 17314), nzTpIcepk0o8(chr(1451 - 1403) + '\x6f' + chr(1096 - 1045) + '\x36' + '\x34', 0b1000), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(9759 - 9648) + chr(0b11000 + 0o34) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1100100 + 0o13) + '\x32' + '\x35' + chr(1443 - 1388), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + '\x33' + chr(1499 - 1448), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(0b110010) + '\061' + '\063', 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(50) + chr(48) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1966 - 1917) + chr(0b101011 + 0o5) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(854 - 806) + chr(11204 - 11093) + chr(0b1 + 0o61) + chr(0b101100 + 0o12) + chr(0b11001 + 0o27), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1624 - 1573) + chr(0b11011 + 0o25) + chr(0b110110 + 0o0), 58853 - 58845), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(828 - 777) + '\066' + chr(0b10011 + 0o37), 42240 - 42232), nzTpIcepk0o8(chr(1879 - 1831) + chr(111) + chr(54) + chr(2091 - 2041), 0b1000), nzTpIcepk0o8('\060' + '\157' + '\x33' + chr(49) + '\066', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b10000 + 0o41) + chr(2900 - 2846) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(48) + chr(0b100101 + 0o112) + chr(50) + chr(924 - 871) + chr(50), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b10000 + 0o42) + chr(0b110001) + chr(688 - 640), 41726 - 41718), nzTpIcepk0o8(chr(0b110000) + chr(0b10010 + 0o135) + '\x34' + chr(785 - 736), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\063' + chr(0b101000 + 0o10) + chr(0b11101 + 0o24), 38158 - 38150)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(622 - 574) + '\157' + chr(0b11101 + 0o30) + chr(0b11 + 0o55), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'F'), chr(0b1100100) + chr(6261 - 6160) + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(0b1100101))('\165' + '\x74' + chr(0b10111 + 0o117) + chr(1530 - 1485) + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def tS7uFIjmNTBb(hXMPsSrOQzbh): for _1vzISbJ_R2i in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x18\xfe\xa2\x16{\n6\xba\xe4\x14n\x10j?q'), '\x64' + chr(0b100110 + 0o77) + chr(7774 - 7675) + '\157' + chr(636 - 536) + chr(1608 - 1507))('\165' + '\164' + chr(102) + chr(45) + '\070')): roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\t\xee\xa8\x1bf;%\x84\xe5\x14j'), '\x64' + '\145' + '\143' + chr(3486 - 3375) + chr(1383 - 1283) + chr(0b1100101))(chr(117) + '\x74' + '\146' + '\055' + chr(0b10011 + 0o45)))(roI3spqORKae(_1vzISbJ_R2i, roI3spqORKae(ES5oEprVxulp(b'7\xc4\xb8\x13p\x084\xba\xd8'), chr(0b111100 + 0o50) + '\x65' + chr(0b110 + 0o135) + chr(0b101100 + 0o103) + chr(0b101000 + 0o74) + chr(101))(chr(117) + chr(116) + '\x66' + chr(45) + chr(1957 - 1901))), roI3spqORKae(_1vzISbJ_R2i.__versioned__, roI3spqORKae(ES5oEprVxulp(b'/\xce\x87\x17f\x11e\x9d\xe6?|)'), chr(0b1100100) + chr(101) + '\x63' + '\157' + chr(8992 - 8892) + chr(0b1100100 + 0o1))(chr(10661 - 10544) + chr(2981 - 2865) + chr(102) + chr(127 - 82) + '\070'))(roI3spqORKae(ES5oEprVxulp(b'\r\xe3\xaf\x1eg\x004'), chr(0b1000001 + 0o43) + chr(101) + chr(8545 - 8446) + chr(111) + '\144' + chr(0b1100010 + 0o3))(chr(117) + chr(0b1110100) + chr(2424 - 2322) + '\055' + chr(56)))) f3kPm1DsRj3u(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x10\xed\xbc\x06~\x01&\xd2\xcb\x0bM\x0c'), '\144' + chr(101) + chr(4076 - 3977) + chr(0b100101 + 0o112) + chr(100) + chr(0b1100101))(chr(117) + chr(116) + chr(6858 - 6756) + chr(45) + '\070')), roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x1c\xe9\xad\x1ca\x052\x91\xee\x17a<z6q'), chr(0b1100100) + '\x65' + '\x63' + chr(8048 - 7937) + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(0b111111 + 0o65) + '\x66' + '\x2d' + chr(154 - 98))), roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\t\xf8\xb8\x1d`;2\x89\xf4'), chr(0b1100100) + '\x65' + chr(0b1 + 0o142) + chr(0b110000 + 0o77) + chr(0b1100100) + chr(0b1011011 + 0o12))('\165' + '\x74' + chr(1205 - 1103) + chr(45) + chr(0b1000 + 0o60))))
mfcovington/pubmed-lookup
pubmed_lookup/command_line.py
pubmed_citation
def pubmed_citation(args=sys.argv[1:], out=sys.stdout): """Get a citation via the command line using a PubMed ID or PubMed URL""" parser = argparse.ArgumentParser( description='Get a citation using a PubMed ID or PubMed URL') parser.add_argument('query', help='PubMed ID or PubMed URL') parser.add_argument( '-m', '--mini', action='store_true', help='get mini citation') parser.add_argument( '-e', '--email', action='store', help='set user email', default='') args = parser.parse_args(args=args) lookup = PubMedLookup(args.query, args.email) publication = Publication(lookup, resolve_doi=False) if args.mini: out.write(publication.cite_mini() + '\n') else: out.write(publication.cite() + '\n')
python
def pubmed_citation(args=sys.argv[1:], out=sys.stdout): """Get a citation via the command line using a PubMed ID or PubMed URL""" parser = argparse.ArgumentParser( description='Get a citation using a PubMed ID or PubMed URL') parser.add_argument('query', help='PubMed ID or PubMed URL') parser.add_argument( '-m', '--mini', action='store_true', help='get mini citation') parser.add_argument( '-e', '--email', action='store', help='set user email', default='') args = parser.parse_args(args=args) lookup = PubMedLookup(args.query, args.email) publication = Publication(lookup, resolve_doi=False) if args.mini: out.write(publication.cite_mini() + '\n') else: out.write(publication.cite() + '\n')
[ "def", "pubmed_citation", "(", "args", "=", "sys", ".", "argv", "[", "1", ":", "]", ",", "out", "=", "sys", ".", "stdout", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Get a citation using a PubMed ID or PubMed URL'", ")", "parser", ".", "add_argument", "(", "'query'", ",", "help", "=", "'PubMed ID or PubMed URL'", ")", "parser", ".", "add_argument", "(", "'-m'", ",", "'--mini'", ",", "action", "=", "'store_true'", ",", "help", "=", "'get mini citation'", ")", "parser", ".", "add_argument", "(", "'-e'", ",", "'--email'", ",", "action", "=", "'store'", ",", "help", "=", "'set user email'", ",", "default", "=", "''", ")", "args", "=", "parser", ".", "parse_args", "(", "args", "=", "args", ")", "lookup", "=", "PubMedLookup", "(", "args", ".", "query", ",", "args", ".", "email", ")", "publication", "=", "Publication", "(", "lookup", ",", "resolve_doi", "=", "False", ")", "if", "args", ".", "mini", ":", "out", ".", "write", "(", "publication", ".", "cite_mini", "(", ")", "+", "'\\n'", ")", "else", ":", "out", ".", "write", "(", "publication", ".", "cite", "(", ")", "+", "'\\n'", ")" ]
Get a citation via the command line using a PubMed ID or PubMed URL
[ "Get", "a", "citation", "via", "the", "command", "line", "using", "a", "PubMed", "ID", "or", "PubMed", "URL" ]
b0aa2945b354f0945db73da22dd15ea628212da8
https://github.com/mfcovington/pubmed-lookup/blob/b0aa2945b354f0945db73da22dd15ea628212da8/pubmed_lookup/command_line.py#L7-L26
train
Get a citation via the command line using a PubMed ID or PubMed URL
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0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3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b1101111) + '\x33' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + chr(0b101100 + 0o4) + chr(0b110 + 0o60), 52082 - 52074), nzTpIcepk0o8(chr(48) + chr(3119 - 3008) + chr(151 - 101) + '\x36' + chr(1847 - 1793), 0o10), nzTpIcepk0o8(chr(964 - 916) + chr(0b1101111) + chr(2005 - 1955) + chr(0b101101 + 0o3) + chr(1967 - 1918), 61249 - 61241), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b10110 + 0o131) + '\x33' + chr(0b10110 + 0o35) + chr(252 - 204), 53959 - 53951), nzTpIcepk0o8('\x30' + chr(0b1000010 + 0o55) + '\062' + chr(0b100110 + 0o16) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(618 - 569) + chr(2722 - 2669) + '\063', ord("\x08")), nzTpIcepk0o8(chr(162 - 114) + chr(0b1101111) + chr(683 - 628), 56198 - 56190), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(51) + '\x35', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\061' + chr(117 - 68) + chr(0b110010), 49960 - 49952), nzTpIcepk0o8(chr(0b11100 + 0o24) + '\157' + '\x33' + '\060' + '\061', 30476 - 30468), nzTpIcepk0o8(chr(0b10101 + 0o33) + '\x6f' + '\x32' + chr(989 - 939) + '\x37', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(0b110011), 19242 - 19234), nzTpIcepk0o8(chr(48) + chr(0b10110 + 0o131) + '\063' + chr(51) + chr(0b110001), 58145 - 58137), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(0b1101111) + chr(2086 - 2037) + chr(51) + chr(54), 0b1000), nzTpIcepk0o8('\060' + chr(0b10010 + 0o135) + chr(1293 - 1242) + chr(734 - 685) + chr(0b100011 + 0o20), 0b1000), nzTpIcepk0o8(chr(254 - 206) + '\x6f' + chr(0b11 + 0o56) + chr(0b110 + 0o61) + chr(1157 - 1105), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x33' + '\x34' + '\066', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(8881 - 8770) + '\061' + chr(1908 - 1854) + '\x32', 12367 - 12359), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1733 - 1682) + chr(2051 - 2003) + chr(52), 0b1000), nzTpIcepk0o8(chr(792 - 744) + '\x6f' + '\x33' + '\x36' + '\x33', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b101 + 0o152) + '\x33' + '\x37' + chr(0b11100 + 0o30), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + '\063' + chr(52), 0o10), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(0b100010 + 0o115) + '\x37' + chr(50), 0o10), nzTpIcepk0o8(chr(146 - 98) + chr(111) + '\063' + chr(0b110110) + chr(0b110011), 8), nzTpIcepk0o8('\x30' + '\x6f' + chr(217 - 169), 0o10), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + chr(0b101000 + 0o14) + chr(54), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b110010) + '\x30' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(1888 - 1840) + '\157' + '\062' + chr(0b10000 + 0o44) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(780 - 732) + chr(0b1000101 + 0o52) + '\x33' + '\063' + '\x33', 26940 - 26932), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011) + '\061' + '\063', 8), nzTpIcepk0o8(chr(1154 - 1106) + chr(0b1101111) + chr(0b110011) + chr(53) + chr(0b110010), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(467 - 418) + '\x35' + chr(0b110010), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(55) + chr(0b110000), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(1619 - 1570) + chr(1344 - 1293) + '\x35', 0b1000), nzTpIcepk0o8('\x30' + chr(6031 - 5920) + chr(51) + chr(54), 0o10), nzTpIcepk0o8('\x30' + '\157' + '\062' + chr(1383 - 1331) + chr(0b100 + 0o55), 8), nzTpIcepk0o8(chr(2118 - 2070) + chr(0b1101111) + chr(375 - 326) + '\x37' + chr(0b110001 + 0o5), 0b1000), nzTpIcepk0o8(chr(48) + chr(6732 - 6621) + chr(50) + chr(167 - 118) + chr(50), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(11609 - 11498) + chr(49) + '\x31' + chr(1083 - 1030), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b1101111 + 0o0) + chr(53) + chr(0b101111 + 0o1), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'4'), chr(0b101000 + 0o74) + chr(0b1100101) + '\143' + '\x6f' + '\144' + chr(101))(chr(0b110010 + 0o103) + chr(3203 - 3087) + chr(0b1000000 + 0o46) + chr(0b100 + 0o51) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Jt4J_ZzLvQqX(eemPYp2vtTSr=roI3spqORKae(bpyfpu4kTbwL, roI3spqORKae(ES5oEprVxulp(b'{,\xff\xc5\x8f\xd83J_+\xf2\xf5'), '\x64' + chr(0b1001110 + 0o27) + '\x63' + chr(111) + chr(0b1100100) + '\145')(chr(0b1110100 + 0o1) + chr(5519 - 5403) + chr(102) + chr(45) + '\x38'))[nzTpIcepk0o8('\x30' + chr(111) + chr(0b100111 + 0o12), 0b1000):], VwOu8WkJ9cpc=roI3spqORKae(bpyfpu4kTbwL, roI3spqORKae(ES5oEprVxulp(b'_r\xc2\xe4\x93\xf5X^W\x03\xa2\xdf'), chr(1854 - 1754) + '\145' + chr(0b1011011 + 0o10) + chr(111) + chr(245 - 145) + '\x65')(chr(0b110001 + 0o104) + '\164' + chr(102) + chr(0b101101) + chr(56)))): ELQLGvoVr2Z_ = ghR1aLY2dNKn.ArgumentParser(description=roI3spqORKae(ES5oEprVxulp(b']#\xc2\xa1\xb9\x81\x08ni+\xb5\xfed\xb7~\xbe\x0f\x8f\x1c\xa3\xd3\x9d|j\x86bk\xe3\xc3\xfb\x82\xaeJW/>\xf1\x0b\xe8\x00\x7f"\x96\xd4\x8a\xed'), '\x64' + chr(0b10001 + 0o124) + chr(0b11 + 0o140) + chr(12112 - 12001) + chr(0b1100100) + chr(0b1100101))('\x75' + chr(116) + '\146' + chr(0b101101) + chr(56))) roI3spqORKae(ELQLGvoVr2Z_, roI3spqORKae(ES5oEprVxulp(b'{"\xd2\xde\xb9\xd3\x0crp/\xaf\xe3'), chr(0b101 + 0o137) + chr(0b10011 + 0o122) + chr(99) + '\x6f' + chr(0b101111 + 0o65) + chr(101))(chr(0b1100100 + 0o21) + chr(0b1101111 + 0o5) + chr(102) + chr(45) + chr(2153 - 2097)))(roI3spqORKae(ES5oEprVxulp(b'k3\xd3\xf3\xa1'), chr(0b110111 + 0o55) + '\145' + chr(99) + chr(2470 - 2359) + chr(100) + chr(0b1001101 + 0o30))(chr(5822 - 5705) + chr(0b1110001 + 0o3) + chr(6478 - 6376) + '\055' + '\070'), help=roI3spqORKae(ES5oEprVxulp(b'J3\xd4\xcc\xbd\xc5KNYj\xae\xe5+\x89+\xa91\x83\x16\xe4\xa6\xae\x10'), chr(0b1011011 + 0o11) + chr(101) + '\x63' + '\x6f' + '\144' + chr(0b1100101))('\165' + '\164' + chr(0b111011 + 0o53) + chr(0b10001 + 0o34) + '\x38')) roI3spqORKae(ELQLGvoVr2Z_, roI3spqORKae(ES5oEprVxulp(b'{"\xd2\xde\xb9\xd3\x0crp/\xaf\xe3'), chr(0b1011110 + 0o6) + '\145' + chr(0b110000 + 0o63) + '\x6f' + chr(9863 - 9763) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + '\x2d' + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'7+'), chr(8669 - 8569) + chr(0b1100101) + '\x63' + '\157' + '\144' + '\145')(chr(13496 - 13379) + '\164' + chr(0b1100110) + '\055' + chr(0b100111 + 0o21)), roI3spqORKae(ES5oEprVxulp(b'7k\xdb\xe8\xb6\xc8'), '\x64' + chr(101) + chr(0b1000110 + 0o35) + chr(0b110111 + 0o70) + '\x64' + '\145')('\x75' + '\x74' + chr(102) + chr(0b101101) + '\070'), action=roI3spqORKae(ES5oEprVxulp(b'i2\xd9\xf3\xbd\xfe\x1fuh/'), chr(0b110010 + 0o62) + chr(101) + chr(0b1100011) + '\x6f' + chr(0b1100100) + '\145')(chr(0b1110101) + '\x74' + chr(0b111100 + 0o52) + chr(1925 - 1880) + chr(2628 - 2572)), help=roI3spqORKae(ES5oEprVxulp(b'}#\xc2\xa1\xb5\xc8\x05n=)\xa8\xe3j\xad7\xa4\x12'), '\x64' + chr(101) + chr(0b1001001 + 0o32) + chr(111) + chr(7618 - 7518) + chr(0b1100101))('\x75' + chr(116) + '\x66' + chr(45) + chr(861 - 805))) roI3spqORKae(ELQLGvoVr2Z_, roI3spqORKae(ES5oEprVxulp(b'{"\xd2\xde\xb9\xd3\x0crp/\xaf\xe3'), chr(0b100000 + 0o104) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + '\x64' + '\145')(chr(5797 - 5680) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b101101 + 0o13)))(roI3spqORKae(ES5oEprVxulp(b'7#'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(0b10 + 0o143))('\165' + '\x74' + '\x66' + chr(45) + chr(2952 - 2896)), roI3spqORKae(ES5oEprVxulp(b'7k\xd3\xec\xb9\xc8\x07'), '\144' + chr(0b1100101) + '\143' + '\157' + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(102) + '\055' + '\070'), action=roI3spqORKae(ES5oEprVxulp(b'i2\xd9\xf3\xbd'), '\x64' + chr(6856 - 6755) + chr(99) + chr(7181 - 7070) + '\144' + chr(0b1010001 + 0o24))(chr(0b1100000 + 0o25) + '\164' + chr(0b11001 + 0o115) + '\055' + '\070'), help=roI3spqORKae(ES5oEprVxulp(b'i#\xc2\xa1\xad\xd2\x0eu=/\xac\xf6b\xb5'), '\144' + chr(1050 - 949) + '\x63' + '\157' + chr(0b1100100) + chr(0b11001 + 0o114))(chr(0b1111 + 0o146) + chr(116) + chr(1972 - 1870) + chr(0b101101) + chr(0b10101 + 0o43)), default=roI3spqORKae(ES5oEprVxulp(b''), chr(0b1001 + 0o133) + chr(0b1100101) + chr(4797 - 4698) + chr(7591 - 7480) + chr(9833 - 9733) + chr(9387 - 9286))('\165' + '\x74' + chr(8124 - 8022) + chr(166 - 121) + chr(1189 - 1133))) eemPYp2vtTSr = ELQLGvoVr2Z_.JvKYHysdS3LV(args=eemPYp2vtTSr) h51drLCtDGSb = xWv4tb5FLhnd(eemPYp2vtTSr.wKKXKFBlqW0G, eemPYp2vtTSr.BhwKvDaXtiJh) b6kBEgt9UMMA = rHEW9NWmahqE(h51drLCtDGSb, resolve_doi=nzTpIcepk0o8(chr(577 - 529) + chr(0b1101111) + '\060', 8)) if roI3spqORKae(eemPYp2vtTSr, roI3spqORKae(ES5oEprVxulp(b'w/\xd8\xe8'), chr(100) + chr(0b1011100 + 0o11) + '\x63' + chr(1933 - 1822) + chr(100) + chr(0b111111 + 0o46))(chr(8959 - 8842) + '\x74' + chr(0b1100001 + 0o5) + chr(0b101101) + '\x38')): roI3spqORKae(VwOu8WkJ9cpc, roI3spqORKae(ES5oEprVxulp(b'w*\x86\xe9\xb0\xd1\x1d6Q:\xb0\xa5'), chr(100) + '\x65' + '\x63' + chr(0b1101111) + '\144' + chr(0b1100010 + 0o3))('\165' + chr(0b1110100) + chr(0b1000010 + 0o44) + chr(0b11101 + 0o20) + chr(265 - 209)))(roI3spqORKae(b6kBEgt9UMMA, roI3spqORKae(ES5oEprVxulp(b'y/\xc2\xe4\x87\xcc\x02it'), '\144' + '\145' + '\143' + chr(4524 - 4413) + chr(0b1010000 + 0o24) + '\x65')('\165' + chr(9084 - 8968) + chr(0b1100110) + chr(0b101101) + chr(0b101110 + 0o12)))() + roI3spqORKae(ES5oEprVxulp(b'\x10'), chr(0b1100100) + chr(0b100001 + 0o104) + chr(6396 - 6297) + '\x6f' + chr(0b11 + 0o141) + chr(0b1000111 + 0o36))('\x75' + '\x74' + '\146' + chr(45) + chr(0b111000))) else: roI3spqORKae(VwOu8WkJ9cpc, roI3spqORKae(ES5oEprVxulp(b'w*\x86\xe9\xb0\xd1\x1d6Q:\xb0\xa5'), chr(0b1011111 + 0o5) + chr(101) + chr(6269 - 6170) + '\x6f' + chr(100) + chr(7997 - 7896))(chr(0b1110101) + chr(0b1100011 + 0o21) + chr(8698 - 8596) + '\x2d' + '\x38'))(roI3spqORKae(b6kBEgt9UMMA, roI3spqORKae(ES5oEprVxulp(b'y/\xc2\xe4'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(7473 - 7362) + chr(0b1100100) + '\x65')(chr(0b1101111 + 0o6) + chr(5142 - 5026) + chr(0b1011111 + 0o7) + chr(311 - 266) + '\x38'))() + roI3spqORKae(ES5oEprVxulp(b'\x10'), '\x64' + chr(0b1100101) + chr(0b1001 + 0o132) + chr(9635 - 9524) + '\144' + chr(101))(chr(117) + chr(0b1110100) + chr(0b1000010 + 0o44) + '\x2d' + chr(56)))
mfcovington/pubmed-lookup
pubmed_lookup/command_line.py
pubmed_url
def pubmed_url(args=sys.argv[1:], resolve_doi=True, out=sys.stdout): """ Get a publication URL via the command line using a PubMed ID or PubMed URL """ parser = argparse.ArgumentParser( description='Get a publication URL using a PubMed ID or PubMed URL') parser.add_argument('query', help='PubMed ID or PubMed URL') parser.add_argument( '-d', '--doi', action='store_false', help='get DOI URL') parser.add_argument( '-e', '--email', action='store', help='set user email', default='') args = parser.parse_args(args=args) lookup = PubMedLookup(args.query, args.email) publication = Publication(lookup, resolve_doi=args.doi) out.write(publication.url + '\n')
python
def pubmed_url(args=sys.argv[1:], resolve_doi=True, out=sys.stdout): """ Get a publication URL via the command line using a PubMed ID or PubMed URL """ parser = argparse.ArgumentParser( description='Get a publication URL using a PubMed ID or PubMed URL') parser.add_argument('query', help='PubMed ID or PubMed URL') parser.add_argument( '-d', '--doi', action='store_false', help='get DOI URL') parser.add_argument( '-e', '--email', action='store', help='set user email', default='') args = parser.parse_args(args=args) lookup = PubMedLookup(args.query, args.email) publication = Publication(lookup, resolve_doi=args.doi) out.write(publication.url + '\n')
[ "def", "pubmed_url", "(", "args", "=", "sys", ".", "argv", "[", "1", ":", "]", ",", "resolve_doi", "=", "True", ",", "out", "=", "sys", ".", "stdout", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Get a publication URL using a PubMed ID or PubMed URL'", ")", "parser", ".", "add_argument", "(", "'query'", ",", "help", "=", "'PubMed ID or PubMed URL'", ")", "parser", ".", "add_argument", "(", "'-d'", ",", "'--doi'", ",", "action", "=", "'store_false'", ",", "help", "=", "'get DOI URL'", ")", "parser", ".", "add_argument", "(", "'-e'", ",", "'--email'", ",", "action", "=", "'store'", ",", "help", "=", "'set user email'", ",", "default", "=", "''", ")", "args", "=", "parser", ".", "parse_args", "(", "args", "=", "args", ")", "lookup", "=", "PubMedLookup", "(", "args", ".", "query", ",", "args", ".", "email", ")", "publication", "=", "Publication", "(", "lookup", ",", "resolve_doi", "=", "args", ".", "doi", ")", "out", ".", "write", "(", "publication", ".", "url", "+", "'\\n'", ")" ]
Get a publication URL via the command line using a PubMed ID or PubMed URL
[ "Get", "a", "publication", "URL", "via", "the", "command", "line", "using", "a", "PubMed", "ID", "or", "PubMed", "URL" ]
b0aa2945b354f0945db73da22dd15ea628212da8
https://github.com/mfcovington/pubmed-lookup/blob/b0aa2945b354f0945db73da22dd15ea628212da8/pubmed_lookup/command_line.py#L29-L47
train
Get a publication URL via the command line using a PubMed ID or PubMed URL
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOd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RcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(111) + '\062' + chr(48) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(1448 - 1400) + chr(111) + '\063' + '\x31' + chr(0b110011), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b11111 + 0o25) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(0b1101111) + chr(1338 - 1283) + chr(0b11110 + 0o22), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b0 + 0o65) + chr(0b110011 + 0o1), 21915 - 21907), nzTpIcepk0o8(chr(2282 - 2234) + chr(0b1101111) + chr(49) + chr(2043 - 1994) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b1101 + 0o44) + chr(280 - 231) + chr(52), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + chr(49) + '\063', 0o10), nzTpIcepk0o8(chr(48) + chr(815 - 704) + chr(49) + '\x37' + '\x32', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(2104 - 2051) + '\066', 0b1000), nzTpIcepk0o8(chr(0b10011 + 0o35) + '\157' + chr(55) + '\061', 59215 - 59207), nzTpIcepk0o8('\x30' + chr(9600 - 9489) + '\063' + '\x37', 17803 - 17795), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110011 + 0o0) + '\066' + chr(2269 - 2217), 36811 - 36803), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\064' + chr(0b101111 + 0o2), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b1110 + 0o44) + '\064' + chr(53), 54369 - 54361), nzTpIcepk0o8('\x30' + chr(111) + '\x33' + '\064' + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b1001 + 0o47) + '\x6f' + chr(949 - 900) + chr(48) + chr(1221 - 1173), 0o10), nzTpIcepk0o8(chr(0b1000 + 0o50) + '\x6f' + chr(0b11110 + 0o24) + '\062' + chr(0b11 + 0o60), ord("\x08")), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(111) + chr(53) + chr(0b11101 + 0o30), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b101111 + 0o100) + chr(0b1 + 0o60) + chr(48) + chr(1458 - 1405), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + '\x34' + chr(0b10100 + 0o35), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b101100 + 0o6) + chr(49) + '\066', 17316 - 17308), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(0b1101111) + '\062' + chr(772 - 720), 65278 - 65270), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(2204 - 2154) + '\063' + '\060', 0b1000), nzTpIcepk0o8(chr(2100 - 2052) + chr(0b1101111) + chr(2151 - 2102) + chr(52) + chr(0b110000), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + '\062' + chr(1459 - 1406), 57154 - 57146), nzTpIcepk0o8('\x30' + chr(111) + chr(0b101011 + 0o6) + chr(51), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1011101 + 0o22) + chr(52) + chr(0b101011 + 0o5), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(51) + chr(0b100101 + 0o14) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(400 - 352) + '\157' + chr(50) + '\x30' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(577 - 529) + chr(0b1101111) + chr(50) + chr(0b110011) + chr(51), 60612 - 60604), nzTpIcepk0o8(chr(262 - 214) + chr(111) + chr(51) + '\x30' + chr(50), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(495 - 444) + '\067' + chr(2738 - 2684), ord("\x08")), nzTpIcepk0o8(chr(0b1100 + 0o44) + '\157' + '\x32' + chr(0b110011 + 0o0) + chr(0b110001), 4430 - 4422), nzTpIcepk0o8(chr(48) + chr(2799 - 2688) + chr(50) + '\066' + chr(0b110001), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(2116 - 2065) + chr(53) + chr(53), ord("\x08")), nzTpIcepk0o8('\x30' + chr(1953 - 1842) + chr(0b110010) + '\x34' + '\065', 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b10101 + 0o34) + chr(51), 8), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(8796 - 8685) + chr(49) + chr(0b110110) + chr(1318 - 1269), 47825 - 47817), nzTpIcepk0o8(chr(0b110000) + chr(6789 - 6678) + chr(0b110001) + chr(0b110111) + chr(52), 14521 - 14513)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(877 - 829) + chr(0b1101111) + '\065' + '\060', 46932 - 46924)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xab'), '\x64' + chr(0b1100101) + '\x63' + '\x6f' + chr(0b1010001 + 0o23) + chr(884 - 783))(chr(117) + chr(0b11 + 0o161) + chr(102) + chr(0b101101) + chr(0b1 + 0o67)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def psELeGPUG5Rg(eemPYp2vtTSr=roI3spqORKae(bpyfpu4kTbwL, roI3spqORKae(ES5oEprVxulp(b'\xe4\xa1m|{7\x14\xc68O\n}'), chr(100) + chr(101) + '\143' + chr(0b1000111 + 0o50) + '\144' + chr(0b1010001 + 0o24))(chr(0b1110101) + chr(837 - 721) + '\x66' + '\x2d' + chr(56)))[nzTpIcepk0o8('\x30' + chr(0b101011 + 0o104) + chr(49), ord("\x08")):], rQUdsiIguNyP=nzTpIcepk0o8('\060' + '\x6f' + chr(49), 8), VwOu8WkJ9cpc=roI3spqORKae(bpyfpu4kTbwL, roI3spqORKae(ES5oEprVxulp(b'\xc0\xffP]g\x1a\x7f\xd20gZW'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(2103 - 1992) + chr(100) + chr(668 - 567))(chr(0b1011010 + 0o33) + '\164' + chr(102) + '\055' + chr(56)))): ELQLGvoVr2Z_ = ghR1aLY2dNKn.ArgumentParser(description=roI3spqORKae(ES5oEprVxulp(b'\xc2\xaeP\x18Mn<\xfe\x18BP|\x95U\xcc\x88.\xb3x\x17-\xaea\xeb\t\xfbl\x00\xa9\xa2\xcb\xb7\x9c\xd4\xd4\x89\x85B5\\\xea\xb9\x04hY,\x01\xee\x1e\x0elM\xb8'), '\144' + chr(0b1100101) + '\143' + '\x6f' + chr(2266 - 2166) + '\x65')(chr(12102 - 11985) + chr(0b101100 + 0o110) + chr(0b1100110) + chr(591 - 546) + '\070')) roI3spqORKae(ELQLGvoVr2Z_, roI3spqORKae(ES5oEprVxulp(b'\xe4\xaf@gM<+\xfe\x17KWk'), chr(0b1100100) + chr(0b1011000 + 0o15) + chr(0b100011 + 0o100) + '\157' + chr(0b1100100) + chr(0b11110 + 0o107))('\x75' + '\164' + chr(3093 - 2991) + chr(45) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'\xf4\xbeAJU'), '\x64' + chr(101) + chr(0b1100011) + chr(111) + chr(100) + chr(0b1011100 + 0o11))('\x75' + chr(0b11110 + 0o126) + '\146' + chr(573 - 528) + '\070'), help=roI3spqORKae(ES5oEprVxulp(b'\xd5\xbeFuI*l\xc2>\x0eVm\xd4q\xd0\x85\r\xf6Ie4\xdcX'), chr(0b1100100) + chr(210 - 109) + chr(7470 - 7371) + chr(3527 - 3416) + chr(0b100010 + 0o102) + chr(101))('\165' + chr(0b1110100) + '\x66' + chr(0b1010 + 0o43) + chr(2660 - 2604))) roI3spqORKae(ELQLGvoVr2Z_, roI3spqORKae(ES5oEprVxulp(b'\xe4\xaf@gM<+\xfe\x17KWk'), chr(5792 - 5692) + chr(101) + chr(0b1100011) + chr(111) + chr(0b1000011 + 0o41) + chr(101))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(45) + chr(912 - 856)))(roI3spqORKae(ES5oEprVxulp(b'\xa8\xaf'), chr(0b1100011 + 0o1) + '\x65' + chr(0b111000 + 0o53) + '\x6f' + '\x64' + chr(0b10011 + 0o122))(chr(0b1001001 + 0o54) + '\x74' + '\x66' + chr(1677 - 1632) + chr(0b111000 + 0o0)), roI3spqORKae(ES5oEprVxulp(b'\xa8\xe6@WE'), '\x64' + chr(101) + chr(99) + chr(111) + chr(100) + '\145')(chr(12866 - 12749) + chr(116) + '\146' + chr(190 - 145) + chr(0b11001 + 0o37)), action=roI3spqORKae(ES5oEprVxulp(b'\xf6\xbfKJI\x11*\xea\x16]\\'), chr(4298 - 4198) + chr(0b110011 + 0o62) + chr(99) + '\x6f' + chr(6092 - 5992) + '\x65')(chr(0b1100101 + 0o20) + chr(0b1000111 + 0o55) + chr(0b100010 + 0o104) + chr(142 - 97) + chr(56)), help=roI3spqORKae(ES5oEprVxulp(b'\xe2\xaeP\x18h\x01\x05\xab/|u'), chr(0b1100100) + '\x65' + '\143' + '\157' + chr(100) + '\145')(chr(0b100111 + 0o116) + chr(116) + chr(0b1001010 + 0o34) + chr(45) + chr(0b100 + 0o64))) roI3spqORKae(ELQLGvoVr2Z_, roI3spqORKae(ES5oEprVxulp(b'\xe4\xaf@gM<+\xfe\x17KWk'), chr(0b100010 + 0o102) + '\145' + chr(0b10 + 0o141) + chr(0b100101 + 0o112) + chr(100) + '\145')(chr(117) + chr(0b1010110 + 0o36) + chr(0b1100110) + chr(45) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'\xa8\xae'), chr(100) + '\x65' + '\143' + '\x6f' + chr(9302 - 9202) + '\x65')(chr(0b101 + 0o160) + '\x74' + '\146' + chr(0b101101) + chr(2460 - 2404)), roI3spqORKae(ES5oEprVxulp(b"\xa8\xe6AUM' "), chr(100) + chr(101) + chr(99) + chr(111) + chr(1899 - 1799) + '\145')(chr(0b11000 + 0o135) + chr(7886 - 7770) + chr(102) + '\055' + '\x38'), action=roI3spqORKae(ES5oEprVxulp(b'\xf6\xbfKJI'), chr(0b1100000 + 0o4) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(0b100100 + 0o100) + chr(6462 - 6361))('\x75' + chr(116) + chr(0b10110 + 0o120) + '\055' + '\x38'), help=roI3spqORKae(ES5oEprVxulp(b'\xf6\xaeP\x18Y=)\xf9ZKT~\x9dM'), '\x64' + '\x65' + chr(0b100010 + 0o101) + '\x6f' + '\x64' + '\x65')(chr(650 - 533) + chr(0b1110100) + chr(102) + chr(45) + chr(0b11101 + 0o33)), default=roI3spqORKae(ES5oEprVxulp(b''), chr(0b1100100) + chr(7910 - 7809) + '\x63' + chr(0b101000 + 0o107) + chr(4385 - 4285) + '\x65')(chr(0b1110010 + 0o3) + chr(7025 - 6909) + '\146' + '\x2d' + chr(1058 - 1002))) eemPYp2vtTSr = ELQLGvoVr2Z_.JvKYHysdS3LV(args=eemPYp2vtTSr) h51drLCtDGSb = xWv4tb5FLhnd(eemPYp2vtTSr.wKKXKFBlqW0G, eemPYp2vtTSr.BhwKvDaXtiJh) b6kBEgt9UMMA = rHEW9NWmahqE(h51drLCtDGSb, resolve_doi=eemPYp2vtTSr.doi) roI3spqORKae(VwOu8WkJ9cpc, roI3spqORKae(ES5oEprVxulp(b'\xe8\xa7\x14PD>:\xba6^H-'), chr(3495 - 3395) + '\145' + '\x63' + chr(111) + chr(5718 - 5618) + chr(0b1100101))(chr(0b1110101) + chr(0b10110 + 0o136) + chr(102) + chr(402 - 357) + '\x38'))(roI3spqORKae(b6kBEgt9UMMA, roI3spqORKae(ES5oEprVxulp(b'\xdd\xbefSc>\x0e\xc0 d\x0cE'), '\144' + chr(0b1100101) + '\x63' + chr(0b101111 + 0o100) + chr(0b1001100 + 0o30) + '\x65')(chr(5805 - 5688) + chr(116) + chr(8036 - 7934) + chr(0b100110 + 0o7) + '\x38')) + roI3spqORKae(ES5oEprVxulp(b'\x8f'), chr(0b11111 + 0o105) + '\145' + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(3250 - 3149))('\165' + '\164' + chr(0b1100110) + chr(1439 - 1394) + '\070'))
mfcovington/pubmed-lookup
pubmed_lookup/pubmed_lookup.py
Publication.authors_et_al
def authors_et_al(self, max_authors=5): """ Return string with a truncated author list followed by 'et al.' """ author_list = self._author_list if len(author_list) <= max_authors: authors_et_al = self.authors else: authors_et_al = ", ".join( self._author_list[:max_authors]) + ", et al." return authors_et_al
python
def authors_et_al(self, max_authors=5): """ Return string with a truncated author list followed by 'et al.' """ author_list = self._author_list if len(author_list) <= max_authors: authors_et_al = self.authors else: authors_et_al = ", ".join( self._author_list[:max_authors]) + ", et al." return authors_et_al
[ "def", "authors_et_al", "(", "self", ",", "max_authors", "=", "5", ")", ":", "author_list", "=", "self", ".", "_author_list", "if", "len", "(", "author_list", ")", "<=", "max_authors", ":", "authors_et_al", "=", "self", ".", "authors", "else", ":", "authors_et_al", "=", "\", \"", ".", "join", "(", "self", ".", "_author_list", "[", ":", "max_authors", "]", ")", "+", "\", et al.\"", "return", "authors_et_al" ]
Return string with a truncated author list followed by 'et al.'
[ "Return", "string", "with", "a", "truncated", "author", "list", "followed", "by", "et", "al", "." ]
b0aa2945b354f0945db73da22dd15ea628212da8
https://github.com/mfcovington/pubmed-lookup/blob/b0aa2945b354f0945db73da22dd15ea628212da8/pubmed_lookup/pubmed_lookup.py#L48-L58
train
Return a truncated author list followed by et al.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm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C,TVUhqOt5_BbS,WtdkIpFeYozM,MdkNqd1bagO6,QNQS9e6tJqMV,typojWN5Phrq,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(1259 - 1148) + chr(0b1001 + 0o51) + chr(0b10011 + 0o35) + chr(0b110110 + 0o1), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(52) + '\065', 31497 - 31489), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(7461 - 7350) + chr(0b110011) + chr(51) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b100011 + 0o23) + chr(0b100001 + 0o25), 43811 - 43803), nzTpIcepk0o8(chr(595 - 547) + '\157' + chr(1730 - 1681) + '\062' + chr(0b1010 + 0o50), 0b1000), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(6400 - 6289) + '\061' + '\067' + '\063', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b0 + 0o157) + '\x32' + chr(0b10000 + 0o41) + chr(85 - 34), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001 + 0o0) + '\x33', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\x33' + chr(198 - 144) + '\x33', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\062' + chr(0b110010 + 0o0) + chr(50), 27706 - 27698), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + '\x35' + '\067', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110011) + chr(2853 - 2799) + chr(0b110000), 61817 - 61809), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x32' + chr(1310 - 1256) + chr(0b1111 + 0o41), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(10163 - 10052) + chr(2469 - 2419) + '\064', 0o10), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(0b1101111) + chr(0b110110) + chr(0b110110), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(1445 - 1397) + '\060', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110011) + chr(0b110011) + chr(0b11100 + 0o26), 0b1000), nzTpIcepk0o8('\060' + chr(7534 - 7423) + chr(0b110101) + '\x30', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b10111 + 0o32) + '\x34' + '\x34', 0b1000), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(0b1100010 + 0o15) + chr(0b101100 + 0o6) + chr(54) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(111) + chr(0b110001) + chr(55) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1001110 + 0o41) + chr(50) + chr(48) + chr(52), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(563 - 452) + '\063' + chr(2089 - 2034) + chr(2055 - 2002), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(774 - 725) + '\x36', 55366 - 55358), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b11000 + 0o31) + chr(499 - 447) + '\061', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b111110 + 0o61) + '\062' + chr(1379 - 1329) + chr(0b11010 + 0o35), 0o10), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(111) + chr(0b11111 + 0o23) + chr(50), 44832 - 44824), nzTpIcepk0o8(chr(1109 - 1061) + chr(2967 - 2856) + chr(713 - 662) + chr(0b110111) + '\063', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\x33' + chr(0b100100 + 0o14) + chr(0b101110 + 0o5), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101 + 0o142) + chr(0b110 + 0o53) + chr(1339 - 1289) + '\x36', 40300 - 40292), nzTpIcepk0o8('\x30' + '\x6f' + chr(49) + chr(0b100010 + 0o22) + '\064', 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b111 + 0o53) + '\x33' + '\x35', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\061' + chr(0b10 + 0o63) + chr(0b100000 + 0o26), 16995 - 16987), nzTpIcepk0o8('\x30' + chr(9540 - 9429) + chr(0b110100) + chr(55), 55161 - 55153), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b100 + 0o57) + '\x33' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(472 - 418) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b11010 + 0o26) + '\x6f' + chr(0b111 + 0o54) + '\067' + chr(1194 - 1145), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(51) + chr(0b110100) + chr(0b110101), 48068 - 48060), nzTpIcepk0o8('\060' + '\x6f' + '\062' + '\x31' + '\062', ord("\x08")), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(8332 - 8221) + chr(0b110100) + chr(2150 - 2097), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(0b1011001 + 0o26) + chr(53) + chr(48), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xa9'), '\x64' + chr(0b1100101) + chr(0b10001 + 0o122) + chr(0b11000 + 0o127) + chr(100) + chr(101))('\165' + '\164' + '\146' + chr(1627 - 1582) + '\x38') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Lml0E4kMQxcH(hXMPsSrOQzbh, JFDdecTDTz4B=nzTpIcepk0o8(chr(1021 - 973) + '\x6f' + '\065', 0b1000)): Iv1f3oYM9Ltm = hXMPsSrOQzbh._author_list if ftfygxgFas5X(Iv1f3oYM9Ltm) <= JFDdecTDTz4B: Lml0E4kMQxcH = hXMPsSrOQzbh.r0xwymaRh9BC else: Lml0E4kMQxcH = roI3spqORKae(ES5oEprVxulp(b'\xab\x05'), chr(100) + chr(9692 - 9591) + chr(7208 - 7109) + chr(111) + '\x64' + '\145')('\x75' + chr(116) + chr(0b1100110) + '\055' + '\x38').Y4yM9BcfTCNq(hXMPsSrOQzbh._author_list[:JFDdecTDTz4B]) + roI3spqORKae(ES5oEprVxulp(b'\xab\x05\xbaBr\x1a\xe7%'), chr(100) + chr(6524 - 6423) + '\143' + '\157' + chr(0b110111 + 0o55) + chr(0b1100101))(chr(0b1000000 + 0o65) + '\164' + chr(0b1100110) + chr(0b1100 + 0o41) + chr(0b100101 + 0o23)) return Lml0E4kMQxcH
mfcovington/pubmed-lookup
pubmed_lookup/pubmed_lookup.py
Publication.cite
def cite(self, max_authors=5): """ Return string with a citation for the record, formatted as: '{authors} ({year}). {title} {journal} {volume}({issue}): {pages}.' """ citation_data = { 'title': self.title, 'authors': self.authors_et_al(max_authors), 'year': self.year, 'journal': self.journal, 'volume': self.volume, 'issue': self.issue, 'pages': self.pages, } citation = "{authors} ({year}). {title} {journal}".format( **citation_data) if self.volume and self.issue and self.pages: citation += " {volume}({issue}): {pages}.".format(**citation_data) elif self.volume and self.issue: citation += " {volume}({issue}).".format(**citation_data) elif self.volume and self.pages: citation += " {volume}: {pages}.".format(**citation_data) elif self.volume: citation += " {volume}.".format(**citation_data) elif self.pages: citation += " {pages}.".format(**citation_data) else: citation += "." return citation
python
def cite(self, max_authors=5): """ Return string with a citation for the record, formatted as: '{authors} ({year}). {title} {journal} {volume}({issue}): {pages}.' """ citation_data = { 'title': self.title, 'authors': self.authors_et_al(max_authors), 'year': self.year, 'journal': self.journal, 'volume': self.volume, 'issue': self.issue, 'pages': self.pages, } citation = "{authors} ({year}). {title} {journal}".format( **citation_data) if self.volume and self.issue and self.pages: citation += " {volume}({issue}): {pages}.".format(**citation_data) elif self.volume and self.issue: citation += " {volume}({issue}).".format(**citation_data) elif self.volume and self.pages: citation += " {volume}: {pages}.".format(**citation_data) elif self.volume: citation += " {volume}.".format(**citation_data) elif self.pages: citation += " {pages}.".format(**citation_data) else: citation += "." return citation
[ "def", "cite", "(", "self", ",", "max_authors", "=", "5", ")", ":", "citation_data", "=", "{", "'title'", ":", "self", ".", "title", ",", "'authors'", ":", "self", ".", "authors_et_al", "(", "max_authors", ")", ",", "'year'", ":", "self", ".", "year", ",", "'journal'", ":", "self", ".", "journal", ",", "'volume'", ":", "self", ".", "volume", ",", "'issue'", ":", "self", ".", "issue", ",", "'pages'", ":", "self", ".", "pages", ",", "}", "citation", "=", "\"{authors} ({year}). {title} {journal}\"", ".", "format", "(", "*", "*", "citation_data", ")", "if", "self", ".", "volume", "and", "self", ".", "issue", "and", "self", ".", "pages", ":", "citation", "+=", "\" {volume}({issue}): {pages}.\"", ".", "format", "(", "*", "*", "citation_data", ")", "elif", "self", ".", "volume", "and", "self", ".", "issue", ":", "citation", "+=", "\" {volume}({issue}).\"", ".", "format", "(", "*", "*", "citation_data", ")", "elif", "self", ".", "volume", "and", "self", ".", "pages", ":", "citation", "+=", "\" {volume}: {pages}.\"", ".", "format", "(", "*", "*", "citation_data", ")", "elif", "self", ".", "volume", ":", "citation", "+=", "\" {volume}.\"", ".", "format", "(", "*", "*", "citation_data", ")", "elif", "self", ".", "pages", ":", "citation", "+=", "\" {pages}.\"", ".", "format", "(", "*", "*", "citation_data", ")", "else", ":", "citation", "+=", "\".\"", "return", "citation" ]
Return string with a citation for the record, formatted as: '{authors} ({year}). {title} {journal} {volume}({issue}): {pages}.'
[ "Return", "string", "with", "a", "citation", "for", "the", "record", "formatted", "as", ":", "{", "authors", "}", "(", "{", "year", "}", ")", ".", "{", "title", "}", "{", "journal", "}", "{", "volume", "}", "(", "{", "issue", "}", ")", ":", "{", "pages", "}", "." ]
b0aa2945b354f0945db73da22dd15ea628212da8
https://github.com/mfcovington/pubmed-lookup/blob/b0aa2945b354f0945db73da22dd15ea628212da8/pubmed_lookup/pubmed_lookup.py#L60-L90
train
Return a string with a citation for the record.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmW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qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(3565 - 3454) + '\x31' + chr(892 - 843) + chr(549 - 495), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\063' + chr(50) + chr(0b100111 + 0o20), ord("\x08")), nzTpIcepk0o8(chr(382 - 334) + chr(111) + '\x32' + '\x31' + '\066', 0b1000), nzTpIcepk0o8('\060' + chr(0b1001001 + 0o46) + '\x33' + chr(317 - 266) + chr(0b110111), 0o10), nzTpIcepk0o8(chr(1102 - 1054) + '\157' + chr(0b110010 + 0o1) + chr(0b110100) + '\x32', 0o10), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b1101111) + chr(49) + chr(0b1010 + 0o51) + chr(48), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + chr(2151 - 2100) + chr(412 - 358), 14102 - 14094), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(6639 - 6528) + chr(2211 - 2162) + chr(53) + '\065', 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b101110 + 0o5) + '\x36' + '\067', 36771 - 36763), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011) + chr(54) + chr(54), 0b1000), nzTpIcepk0o8(chr(164 - 116) + chr(0b1101111) + chr(604 - 555) + chr(2002 - 1949) + chr(227 - 175), 6153 - 6145), nzTpIcepk0o8('\060' + chr(0b1100011 + 0o14) + chr(51) + '\x34', 37039 - 37031), nzTpIcepk0o8(chr(48) + '\x6f' + '\x32' + chr(1690 - 1637) + chr(49), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(50) + '\067' + chr(1032 - 980), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\x32' + '\x36' + '\064', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b110001) + chr(0b11110 + 0o30) + chr(974 - 924), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111 + 0o0) + '\062' + chr(51), 18087 - 18079), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + '\066' + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\062' + chr(55) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(787 - 737) + chr(51) + '\064', 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b11101 + 0o25) + '\x32' + '\060', 0b1000), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(11422 - 11311) + '\063' + '\x32', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(605 - 494) + '\x33' + '\x34' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(50) + chr(0b101000 + 0o12) + '\067', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(50) + '\x34' + '\x33', 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(51) + chr(50), 8), nzTpIcepk0o8('\060' + chr(111) + chr(0b110010) + chr(2557 - 2506) + chr(54), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(84 - 32), 7624 - 7616), nzTpIcepk0o8('\060' + '\x6f' + '\060', ord("\x08")), nzTpIcepk0o8(chr(1903 - 1855) + '\157' + chr(2122 - 2073) + chr(2264 - 2215) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + chr(1471 - 1422) + chr(0b110010), 8), nzTpIcepk0o8('\x30' + chr(0b1011111 + 0o20) + chr(0b11110 + 0o25) + chr(53) + chr(48), 0b1000), nzTpIcepk0o8(chr(1217 - 1169) + chr(0b111000 + 0o67) + '\063' + chr(50) + '\067', 8), nzTpIcepk0o8('\x30' + chr(6633 - 6522) + '\062' + '\x32' + chr(55), 8), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1853 - 1802) + chr(52) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(2816 - 2705) + chr(0b110011) + chr(0b110110) + chr(54), 8), nzTpIcepk0o8('\x30' + chr(111) + chr(0b10001 + 0o42) + chr(0b110111) + '\x32', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\062' + '\x32' + '\060', 8), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + chr(51) + chr(773 - 724), 54054 - 54046), nzTpIcepk0o8('\060' + chr(0b1101111) + '\061' + '\x35' + '\x35', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(5902 - 5791) + chr(0b110101) + chr(0b110000), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'`'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(2221 - 2110) + chr(2578 - 2478) + chr(8810 - 8709))(chr(117) + chr(0b1110100) + chr(0b110011 + 0o63) + '\x2d' + '\x38') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def oGd3BB4Xbg0C(hXMPsSrOQzbh, JFDdecTDTz4B=nzTpIcepk0o8(chr(0b110000) + '\157' + chr(53), 46313 - 46305)): pnUh4oCn3y1H = {roI3spqORKae(ES5oEprVxulp(b':\xbe\xfa\xb3\x87'), chr(0b11110 + 0o106) + chr(0b1011110 + 0o7) + chr(6632 - 6533) + chr(0b1101111) + '\144' + chr(4095 - 3994))('\x75' + chr(9122 - 9006) + '\146' + chr(0b101101) + chr(2090 - 2034)): hXMPsSrOQzbh.OO0tRW9aj_xh, roI3spqORKae(ES5oEprVxulp(b'/\xa2\xfa\xb7\x8d*-'), chr(0b1100100) + chr(0b101001 + 0o74) + chr(0b1100011) + chr(2486 - 2375) + chr(100) + chr(0b1100101))('\165' + chr(0b1110100) + chr(6858 - 6756) + chr(45) + chr(0b111000)): hXMPsSrOQzbh.authors_et_al(JFDdecTDTz4B), roI3spqORKae(ES5oEprVxulp(b'7\xb2\xef\xad'), '\144' + chr(0b10110 + 0o117) + chr(99) + '\x6f' + chr(100) + chr(1742 - 1641))('\x75' + '\164' + chr(3224 - 3122) + '\055' + chr(0b10001 + 0o47)): hXMPsSrOQzbh.D5B9zoxpE2ow, roI3spqORKae(ES5oEprVxulp(b'$\xb8\xfb\xad\x8c92'), chr(0b1100100) + chr(0b1001011 + 0o32) + chr(99) + chr(0b110001 + 0o76) + '\144' + chr(101))(chr(11725 - 11608) + chr(0b1110100) + chr(606 - 504) + chr(0b101101) + '\x38'): hXMPsSrOQzbh.JmI5CFE05q5y, roI3spqORKae(ES5oEprVxulp(b'8\xb8\xe2\xaa\x8f='), chr(100) + chr(101) + '\143' + chr(1451 - 1340) + '\x64' + '\x65')('\x75' + chr(0b111111 + 0o65) + chr(0b1011110 + 0o10) + chr(45) + chr(0b100101 + 0o23)): hXMPsSrOQzbh.sbVhSlSPnlFP, roI3spqORKae(ES5oEprVxulp(b"'\xa4\xfd\xaa\x87"), '\144' + chr(7976 - 7875) + chr(0b110110 + 0o55) + '\x6f' + chr(5563 - 5463) + '\x65')('\165' + '\164' + chr(7009 - 6907) + chr(1483 - 1438) + '\x38'): hXMPsSrOQzbh.nUY1tSPSaZXI, roI3spqORKae(ES5oEprVxulp(b'>\xb6\xe9\xba\x91'), chr(100) + chr(101) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(2881 - 2780))(chr(0b1110101) + chr(116) + '\146' + chr(0b1110 + 0o37) + chr(489 - 433)): hXMPsSrOQzbh.rC3GLw9ieACx} _NuwPUBWY7oy = roI3spqORKae(ES5oEprVxulp(b'5\xb6\xfb\xab\x8a7,\x1e\x8a\xd6Dg\xd0\xd9\xd5\x00n\xdd\x94\xbc\xebn\x8f\xe3\xcf\x7f\xe3${ %\x9d\xa5\xf9\x85\x9a\x87'), chr(0b111101 + 0o47) + '\145' + chr(0b1011001 + 0o12) + '\157' + '\144' + chr(101))('\165' + chr(116) + chr(0b1100110) + chr(0b101101) + chr(0b111000)).q33KG3foQ_CJ(**pnUh4oCn3y1H) if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'=\xb5\xd8\xb7\xb14\r=\x99\x9a*L'), chr(1969 - 1869) + chr(0b1100101) + chr(99) + chr(0b1101111) + '\144' + '\145')(chr(0b1110101) + chr(116) + '\146' + chr(1339 - 1294) + chr(0b10110 + 0o42))) and roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b' \x82\xd7\xee\x96\x0b\x0e>\x96\xac4U'), chr(0b10101 + 0o117) + chr(0b1101 + 0o130) + chr(99) + chr(0b1101111) + chr(0b1000101 + 0o37) + '\145')(chr(0b11100 + 0o131) + chr(116) + chr(102) + '\x2d' + chr(56))) and roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'<\x94\xbd\x98\xae/g\x04\x92\xb7/d'), chr(100) + chr(101) + chr(0b1100011) + chr(0b100000 + 0o117) + chr(100) + chr(101))('\x75' + '\x74' + '\146' + '\055' + chr(464 - 408))): _NuwPUBWY7oy += roI3spqORKae(ES5oEprVxulp(b'n\xac\xf8\xb0\x8e-3\x08\x8a\xde\x17u\xda\xcf\xc1\x17n\xdd\x80\xbc\xebj\x87\xf0\xc6i\xe3*'), '\x64' + chr(3126 - 3025) + '\x63' + '\x6f' + chr(100) + '\x65')(chr(0b1001100 + 0o51) + '\164' + chr(8219 - 8117) + '\055' + chr(0b111000)).q33KG3foQ_CJ(**pnUh4oCn3y1H) elif roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'=\xb5\xd8\xb7\xb14\r=\x99\x9a*L'), chr(0b110011 + 0o61) + '\x65' + chr(0b1100011) + chr(0b1001000 + 0o47) + '\144' + chr(0b1100101))(chr(1035 - 918) + chr(0b1001001 + 0o53) + '\146' + chr(1919 - 1874) + '\070')) and roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b' \x82\xd7\xee\x96\x0b\x0e>\x96\xac4U'), '\144' + chr(101) + chr(0b1010101 + 0o16) + '\x6f' + chr(0b100100 + 0o100) + '\145')('\x75' + chr(967 - 851) + '\x66' + chr(45) + chr(0b11 + 0o65))): _NuwPUBWY7oy += roI3spqORKae(ES5oEprVxulp(b'n\xac\xf8\xb0\x8e-3\x08\x8a\xde\x17u\xda\xcf\xc1\x17n\xdd\x94'), '\144' + chr(0b1100101) + chr(99) + '\x6f' + chr(0b1000100 + 0o40) + chr(0b100 + 0o141))(chr(7690 - 7573) + chr(0b101011 + 0o111) + '\x66' + chr(0b11101 + 0o20) + '\070').q33KG3foQ_CJ(**pnUh4oCn3y1H) elif roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'=\xb5\xd8\xb7\xb14\r=\x99\x9a*L'), chr(100) + chr(0b1100101) + '\143' + '\157' + chr(8542 - 8442) + '\145')(chr(2120 - 2003) + '\x74' + '\146' + chr(0b101101) + chr(0b111000))) and roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'<\x94\xbd\x98\xae/g\x04\x92\xb7/d'), chr(0b1100100) + chr(101) + '\143' + '\157' + chr(100) + chr(0b1100101))(chr(117) + chr(116) + chr(0b1100110) + chr(709 - 664) + chr(56))): _NuwPUBWY7oy += roI3spqORKae(ES5oEprVxulp(b'n\xac\xf8\xb0\x8e-3\x08\x8a\xccLg\xd9\xdd\xd3\x17`\x89\x94'), chr(6192 - 6092) + '\145' + chr(0b1100011) + chr(111) + chr(0b10011 + 0o121) + chr(101))(chr(0b101010 + 0o113) + '\x74' + '\x66' + chr(45) + chr(56)).q33KG3foQ_CJ(**pnUh4oCn3y1H) elif roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'=\xb5\xd8\xb7\xb14\r=\x99\x9a*L'), chr(0b1011110 + 0o6) + '\x65' + chr(2414 - 2315) + chr(0b1101111) + chr(0b11101 + 0o107) + chr(101))('\x75' + chr(0b1110100) + chr(4020 - 3918) + '\x2d' + chr(0b111000))): _NuwPUBWY7oy += roI3spqORKae(ES5oEprVxulp(b'n\xac\xf8\xb0\x8e-3\x08\x8a\xd8'), '\144' + chr(0b1100010 + 0o3) + '\143' + '\x6f' + chr(0b1100100) + chr(0b111010 + 0o53))(chr(9976 - 9859) + '\164' + chr(0b1100110) + chr(0b101101) + chr(1326 - 1270)).q33KG3foQ_CJ(**pnUh4oCn3y1H) elif roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'<\x94\xbd\x98\xae/g\x04\x92\xb7/d'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\x64' + chr(5332 - 5231))(chr(4181 - 4064) + chr(116) + '\x66' + chr(1786 - 1741) + '\070')): _NuwPUBWY7oy += roI3spqORKae(ES5oEprVxulp(b'n\xac\xfe\xbe\x85=-\x10\xd9'), '\144' + chr(0b1100101) + chr(7268 - 7169) + chr(0b111110 + 0o61) + chr(100) + '\x65')(chr(0b111001 + 0o74) + chr(0b1110100) + chr(102) + '\x2d' + '\x38').q33KG3foQ_CJ(**pnUh4oCn3y1H) else: _NuwPUBWY7oy += roI3spqORKae(ES5oEprVxulp(b'`'), chr(0b10 + 0o142) + chr(101) + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(0b1100101))('\x75' + chr(13256 - 13140) + chr(0b1100110) + chr(881 - 836) + chr(56)) return _NuwPUBWY7oy
mfcovington/pubmed-lookup
pubmed_lookup/pubmed_lookup.py
Publication.cite_mini
def cite_mini(self): """ Return string with a citation for the record, formatted as: '{first_author} - {year} - {journal}' """ citation_data = [self.first_author] if len(self._author_list) > 1: citation_data.append(self.last_author) citation_data.extend([self.year, self.journal]) return " - ".join(citation_data)
python
def cite_mini(self): """ Return string with a citation for the record, formatted as: '{first_author} - {year} - {journal}' """ citation_data = [self.first_author] if len(self._author_list) > 1: citation_data.append(self.last_author) citation_data.extend([self.year, self.journal]) return " - ".join(citation_data)
[ "def", "cite_mini", "(", "self", ")", ":", "citation_data", "=", "[", "self", ".", "first_author", "]", "if", "len", "(", "self", ".", "_author_list", ")", ">", "1", ":", "citation_data", ".", "append", "(", "self", ".", "last_author", ")", "citation_data", ".", "extend", "(", "[", "self", ".", "year", ",", "self", ".", "journal", "]", ")", "return", "\" - \"", ".", "join", "(", "citation_data", ")" ]
Return string with a citation for the record, formatted as: '{first_author} - {year} - {journal}'
[ "Return", "string", "with", "a", "citation", "for", "the", "record", "formatted", "as", ":", "{", "first_author", "}", "-", "{", "year", "}", "-", "{", "journal", "}" ]
b0aa2945b354f0945db73da22dd15ea628212da8
https://github.com/mfcovington/pubmed-lookup/blob/b0aa2945b354f0945db73da22dd15ea628212da8/pubmed_lookup/pubmed_lookup.py#L92-L104
train
Return a string with a citation for the record formatted as :
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpx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i7uj_uC,TVUhqOt5_BbS,WtdkIpFeYozM,MdkNqd1bagO6,QNQS9e6tJqMV,typojWN5Phrq,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(2556 - 2445) + chr(0b110011) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(51) + chr(0b111 + 0o54) + chr(0b110010), 27318 - 27310), nzTpIcepk0o8(chr(0b110000) + chr(0b1100101 + 0o12) + '\062' + chr(0b10111 + 0o35) + chr(0b101111 + 0o5), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + '\060' + '\066', 0o10), nzTpIcepk0o8('\060' + chr(5811 - 5700) + chr(801 - 751) + '\063' + chr(0b110110), 45205 - 45197), nzTpIcepk0o8(chr(2046 - 1998) + chr(0b1101111) + chr(0b110001) + chr(473 - 418) + '\x31', 65149 - 65141), nzTpIcepk0o8(chr(0b110000) + chr(7113 - 7002) + chr(0b110001) + '\x31' + '\x34', 0o10), nzTpIcepk0o8('\060' + '\157' + chr(595 - 546) + chr(1940 - 1886) + '\x36', 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(213 - 162) + chr(0b110010), 0o10), nzTpIcepk0o8('\060' + chr(3096 - 2985) + chr(0b110010) + chr(0b110010) + chr(0b101011 + 0o11), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1616 - 1566) + '\066' + '\x32', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\x31' + '\x36' + chr(0b1011 + 0o52), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b1110 + 0o44), ord("\x08")), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(294 - 183) + chr(54) + '\x34', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b10101 + 0o36) + chr(0b101010 + 0o10) + chr(0b10010 + 0o43), ord("\x08")), nzTpIcepk0o8(chr(465 - 417) + chr(0b10100 + 0o133) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b10110 + 0o32) + '\157' + '\061' + chr(0b110001) + chr(1368 - 1317), 0b1000), nzTpIcepk0o8(chr(0b101101 + 0o3) + '\x6f' + chr(0b110010) + '\x37' + chr(0b101111 + 0o1), 0b1000), nzTpIcepk0o8('\x30' + chr(3127 - 3016) + chr(0b110011) + '\x33' + chr(0b100000 + 0o21), 0b1000), nzTpIcepk0o8(chr(712 - 664) + '\157' + chr(1184 - 1132) + chr(713 - 663), 27774 - 27766), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(0b10100 + 0o133) + chr(0b110001) + chr(52) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001) + '\x35' + chr(0b10000 + 0o46), 34685 - 34677), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1847 - 1796) + '\x32' + '\x35', 8), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110011) + '\x37' + '\x33', 53487 - 53479), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(0b1101111) + chr(0b110010) + '\065' + '\x33', 62832 - 62824), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b101100 + 0o7) + chr(0b101110 + 0o11) + '\061', 43917 - 43909), nzTpIcepk0o8(chr(0b0 + 0o60) + '\157' + chr(0b1110 + 0o44) + chr(1981 - 1926), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(54) + chr(0b110011), 1281 - 1273), nzTpIcepk0o8(chr(2166 - 2118) + '\x6f' + chr(51) + chr(0b110100) + chr(901 - 852), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(49) + chr(0b110000 + 0o7) + chr(384 - 330), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + chr(1964 - 1909), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110 + 0o55) + chr(51) + chr(0b100010 + 0o23), 0o10), nzTpIcepk0o8(chr(48) + chr(0b110011 + 0o74) + '\x33' + chr(50) + '\x33', 0b1000), nzTpIcepk0o8('\060' + '\157' + '\063' + chr(0b110001 + 0o3) + chr(0b100010 + 0o20), 0o10), nzTpIcepk0o8('\060' + chr(11451 - 11340) + '\x33' + chr(0b100 + 0o56), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + chr(2375 - 2321) + '\060', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b10111 + 0o32) + '\x36' + '\x33', 0o10), nzTpIcepk0o8(chr(215 - 167) + '\x6f' + chr(0b110001) + '\x31' + chr(0b100001 + 0o26), 0o10), nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(0b1101111) + chr(0b110010) + chr(50), 3432 - 3424), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(1530 - 1419) + chr(2117 - 2068) + chr(431 - 381) + chr(0b110010), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1695 - 1647) + chr(0b1101111) + '\x35' + chr(476 - 428), 46710 - 46702)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'3'), chr(100) + chr(101) + '\x63' + '\x6f' + chr(0b110 + 0o136) + chr(0b1010100 + 0o21))(chr(0b111001 + 0o74) + chr(0b1110100) + chr(2586 - 2484) + chr(0b11001 + 0o24) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Ij1e95fL_dMw(hXMPsSrOQzbh): pnUh4oCn3y1H = [hXMPsSrOQzbh.first_author] if ftfygxgFas5X(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'B\xbb\xd12\xf6\x16>)v\xfd\xc1\x01'), '\x64' + chr(4143 - 4042) + chr(0b11000 + 0o113) + '\x6f' + chr(0b10111 + 0o115) + chr(0b1010101 + 0o20))('\165' + chr(0b1110100) + chr(0b1100110) + '\x2d' + '\070'))) > nzTpIcepk0o8('\060' + chr(3785 - 3674) + chr(1330 - 1281), 8): roI3spqORKae(pnUh4oCn3y1H, roI3spqORKae(ES5oEprVxulp(b'U\x8e\xf7r\xe6\x1e\x0b\x19p\xfb\xe7@'), chr(1286 - 1186) + chr(1586 - 1485) + '\x63' + chr(0b1010 + 0o145) + chr(0b11000 + 0o114) + chr(101))(chr(0b111100 + 0o71) + chr(13345 - 13229) + '\146' + '\055' + chr(797 - 741)))(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'q\xbb\xd72\xc1\x189\x02r\xfb\xc0'), chr(0b1100100) + '\x65' + '\143' + chr(0b1101111) + '\144' + '\x65')(chr(117) + chr(116) + chr(102) + chr(45) + chr(1488 - 1432)))) roI3spqORKae(pnUh4oCn3y1H, roI3spqORKae(ES5oEprVxulp(b'I\x85\x97\x0b\xf1\x1d\x00!E\xd6\xd0\x04'), chr(8440 - 8340) + chr(101) + '\x63' + chr(0b1101111) + '\144' + chr(8787 - 8686))('\x75' + '\164' + chr(102) + chr(0b101101) + chr(0b101 + 0o63)))([roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'Y\xef\xe6\x7f\xe4\x164\x06_\xa6\xdd\x02'), '\144' + chr(0b1100101) + '\x63' + chr(0b100000 + 0o117) + chr(100) + '\145')('\165' + chr(116) + chr(0b1000010 + 0o44) + chr(0b101101) + chr(1360 - 1304))), roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'W\xb7\xeds\xdd?\tF/\xe5\x87\x0c'), chr(0b1100100) + chr(101) + chr(3289 - 3190) + chr(0b1101111) + '\x64' + chr(1913 - 1812))(chr(117) + chr(6600 - 6484) + chr(102) + '\055' + '\x38'))]) return roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'=\xf7\x84'), chr(0b1100100) + '\145' + '\x63' + '\157' + chr(100) + '\x65')('\x75' + '\164' + chr(0b1100001 + 0o5) + chr(0b101101) + chr(56)), roI3spqORKae(ES5oEprVxulp(b'D\xee\xdd\x0b\xa7;/\x10N\xd7\xfc\x04'), chr(0b1010111 + 0o15) + chr(101) + chr(0b1100011) + '\157' + chr(9118 - 9018) + chr(4345 - 4244))(chr(117) + '\x74' + chr(0b1011000 + 0o16) + chr(1250 - 1205) + chr(2336 - 2280)))(pnUh4oCn3y1H)
mfcovington/pubmed-lookup
pubmed_lookup/pubmed_lookup.py
Publication.parse_abstract
def parse_abstract(xml_dict): """ Parse PubMed XML dictionary to retrieve abstract. """ key_path = ['PubmedArticleSet', 'PubmedArticle', 'MedlineCitation', 'Article', 'Abstract', 'AbstractText'] abstract_xml = reduce(dict.get, key_path, xml_dict) abstract_paragraphs = [] if isinstance(abstract_xml, str): abstract_paragraphs.append(abstract_xml) elif isinstance(abstract_xml, dict): abstract_text = abstract_xml.get('#text') try: abstract_label = abstract_xml['@Label'] except KeyError: abstract_paragraphs.append(abstract_text) else: abstract_paragraphs.append( "{}: {}".format(abstract_label, abstract_text)) elif isinstance(abstract_xml, list): for abstract_section in abstract_xml: try: abstract_text = abstract_section['#text'] except KeyError: abstract_text = abstract_section try: abstract_label = abstract_section['@Label'] except KeyError: abstract_paragraphs.append(abstract_text) else: abstract_paragraphs.append( "{}: {}".format(abstract_label, abstract_text)) else: raise RuntimeError("Error parsing abstract.") return "\n\n".join(abstract_paragraphs)
python
def parse_abstract(xml_dict): """ Parse PubMed XML dictionary to retrieve abstract. """ key_path = ['PubmedArticleSet', 'PubmedArticle', 'MedlineCitation', 'Article', 'Abstract', 'AbstractText'] abstract_xml = reduce(dict.get, key_path, xml_dict) abstract_paragraphs = [] if isinstance(abstract_xml, str): abstract_paragraphs.append(abstract_xml) elif isinstance(abstract_xml, dict): abstract_text = abstract_xml.get('#text') try: abstract_label = abstract_xml['@Label'] except KeyError: abstract_paragraphs.append(abstract_text) else: abstract_paragraphs.append( "{}: {}".format(abstract_label, abstract_text)) elif isinstance(abstract_xml, list): for abstract_section in abstract_xml: try: abstract_text = abstract_section['#text'] except KeyError: abstract_text = abstract_section try: abstract_label = abstract_section['@Label'] except KeyError: abstract_paragraphs.append(abstract_text) else: abstract_paragraphs.append( "{}: {}".format(abstract_label, abstract_text)) else: raise RuntimeError("Error parsing abstract.") return "\n\n".join(abstract_paragraphs)
[ "def", "parse_abstract", "(", "xml_dict", ")", ":", "key_path", "=", "[", "'PubmedArticleSet'", ",", "'PubmedArticle'", ",", "'MedlineCitation'", ",", "'Article'", ",", "'Abstract'", ",", "'AbstractText'", "]", "abstract_xml", "=", "reduce", "(", "dict", ".", "get", ",", "key_path", ",", "xml_dict", ")", "abstract_paragraphs", "=", "[", "]", "if", "isinstance", "(", "abstract_xml", ",", "str", ")", ":", "abstract_paragraphs", ".", "append", "(", "abstract_xml", ")", "elif", "isinstance", "(", "abstract_xml", ",", "dict", ")", ":", "abstract_text", "=", "abstract_xml", ".", "get", "(", "'#text'", ")", "try", ":", "abstract_label", "=", "abstract_xml", "[", "'@Label'", "]", "except", "KeyError", ":", "abstract_paragraphs", ".", "append", "(", "abstract_text", ")", "else", ":", "abstract_paragraphs", ".", "append", "(", "\"{}: {}\"", ".", "format", "(", "abstract_label", ",", "abstract_text", ")", ")", "elif", "isinstance", "(", "abstract_xml", ",", "list", ")", ":", "for", "abstract_section", "in", "abstract_xml", ":", "try", ":", "abstract_text", "=", "abstract_section", "[", "'#text'", "]", "except", "KeyError", ":", "abstract_text", "=", "abstract_section", "try", ":", "abstract_label", "=", "abstract_section", "[", "'@Label'", "]", "except", "KeyError", ":", "abstract_paragraphs", ".", "append", "(", "abstract_text", ")", "else", ":", "abstract_paragraphs", ".", "append", "(", "\"{}: {}\"", ".", "format", "(", "abstract_label", ",", "abstract_text", ")", ")", "else", ":", "raise", "RuntimeError", "(", "\"Error parsing abstract.\"", ")", "return", "\"\\n\\n\"", ".", "join", "(", "abstract_paragraphs", ")" ]
Parse PubMed XML dictionary to retrieve abstract.
[ "Parse", "PubMed", "XML", "dictionary", "to", "retrieve", "abstract", "." ]
b0aa2945b354f0945db73da22dd15ea628212da8
https://github.com/mfcovington/pubmed-lookup/blob/b0aa2945b354f0945db73da22dd15ea628212da8/pubmed_lookup/pubmed_lookup.py#L107-L148
train
Parse PubMed XML dictionary to retrieve abstract.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiy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O6,QNQS9e6tJqMV,typojWN5Phrq,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + chr(0b110001) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(1722 - 1674) + chr(0b1100001 + 0o16) + '\062' + chr(0b110100) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + chr(1677 - 1628) + '\x34' + chr(0b110101), 33691 - 33683), nzTpIcepk0o8(chr(48) + chr(111) + '\062' + chr(0b110111) + '\067', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b100011 + 0o17) + chr(55) + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(7692 - 7581) + chr(49) + chr(48) + '\062', 0o10), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(0b1101111) + chr(0b11100 + 0o25) + chr(52) + '\062', 61829 - 61821), nzTpIcepk0o8(chr(0b110000) + chr(8708 - 8597) + chr(0b101011 + 0o6) + chr(52) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\064', 0b1000), nzTpIcepk0o8(chr(1999 - 1951) + '\x6f' + '\063' + chr(54) + '\x36', 32640 - 32632), nzTpIcepk0o8(chr(2233 - 2185) + '\157' + '\063' + '\061' + chr(54), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(133 - 22) + chr(49) + chr(54), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + '\x33' + chr(0b11101 + 0o25), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b11011 + 0o30) + chr(54) + chr(0b110000), 58667 - 58659), nzTpIcepk0o8(chr(2169 - 2121) + chr(5228 - 5117) + chr(0b110001 + 0o0) + '\061' + chr(50), 53893 - 53885), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(11931 - 11820) + chr(0b10001 + 0o43), 8), nzTpIcepk0o8('\x30' + '\157' + chr(0b101001 + 0o14) + chr(52), 38960 - 38952), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + '\063' + chr(51), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(2384 - 2333) + '\065' + '\x35', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1000011 + 0o54) + chr(0b1 + 0o61) + chr(0b101000 + 0o12) + '\062', ord("\x08")), nzTpIcepk0o8(chr(1016 - 968) + chr(111) + chr(0b100111 + 0o13) + chr(0b10110 + 0o37) + '\x37', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1697 - 1648) + chr(0b11110 + 0o31) + '\x32', 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\061' + '\x30' + chr(52), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\x31' + chr(0b110100) + chr(2488 - 2434), 0o10), nzTpIcepk0o8('\060' + chr(5431 - 5320) + '\x33' + '\065' + chr(0b110010), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\062' + chr(0b101100 + 0o11) + '\062', ord("\x08")), nzTpIcepk0o8(chr(0b1000 + 0o50) + '\x6f' + '\x32' + '\063' + chr(0b110000), 0b1000), nzTpIcepk0o8('\x30' + chr(7793 - 7682) + chr(1657 - 1607) + '\066' + chr(0b110011), 41237 - 41229), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(51) + chr(0b110001) + '\x37', 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\x34' + chr(917 - 864), 8470 - 8462), nzTpIcepk0o8(chr(0b10110 + 0o32) + '\157' + chr(0b110011) + chr(0b10 + 0o61) + '\065', 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001) + '\x36' + chr(0b110101), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b100111 + 0o13) + chr(0b110100) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(2086 - 2035) + '\x37' + chr(0b110110), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + '\x32' + chr(2645 - 2590), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(998 - 948) + chr(0b110000) + chr(0b110101), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101110 + 0o1) + '\062' + chr(55) + '\x30', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(10284 - 10173) + chr(640 - 589) + chr(2080 - 2029) + chr(2316 - 2267), 0o10), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(0b101110 + 0o101) + chr(165 - 115) + chr(0b101110 + 0o11) + chr(49), 28025 - 28017), nzTpIcepk0o8(chr(0b110000) + chr(8565 - 8454) + '\x37', 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(0b101010 + 0o105) + chr(53) + '\x30', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xe6'), '\x64' + '\145' + chr(0b1100011) + '\157' + '\144' + '\x65')(chr(11934 - 11817) + '\x74' + chr(4120 - 4018) + chr(1317 - 1272) + chr(2039 - 1983)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) (jYZAKYxMTtNT,) = (roI3spqORKae(rFFUeiYWzOhx(roI3spqORKae(ES5oEprVxulp(b'\xae\xd1\x0b\xdc\xca-\r\x08w'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(0b1000011 + 0o54) + '\x64' + chr(0b1011110 + 0o7))(chr(0b1110101) + chr(0b1110100) + '\x66' + '\055' + '\x38'), roI3spqORKae(ES5oEprVxulp(b"\xba\xc1\x01\xca\xdd'"), chr(0b1100100) + '\145' + chr(99) + '\x6f' + chr(0b1100100) + chr(101))(chr(861 - 744) + '\x74' + '\x66' + '\x2d' + '\x38')), roI3spqORKae(ES5oEprVxulp(b"\xba\xc1\x01\xca\xdd'"), chr(0b1100100) + chr(770 - 669) + chr(0b1100011) + chr(7910 - 7799) + chr(315 - 215) + chr(0b1100011 + 0o2))(chr(117) + chr(0b1110100) + '\146' + chr(1239 - 1194) + chr(56))),) def cs37dNBKrHLI(Zbv_xhTwUzaU): cgRZt2mEHcZ8 = [roI3spqORKae(ES5oEprVxulp(b'\x98\xd1\x07\xd2\xdb&#\x16p\x9f\xadb\xff\xa3/p'), chr(0b1100100) + chr(0b1011011 + 0o12) + chr(99) + chr(10712 - 10601) + '\x64' + chr(0b1100101 + 0o0))(chr(0b1100 + 0o151) + '\164' + '\146' + chr(0b100010 + 0o13) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\x98\xd1\x07\xd2\xdb&#\x16p\x9f\xadb\xff'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + chr(10844 - 10733) + chr(3619 - 3519) + chr(0b1011111 + 0o6))(chr(9771 - 9654) + '\x74' + '\x66' + chr(0b101101) + chr(0b11100 + 0o34)), roI3spqORKae(ES5oEprVxulp(b"\x85\xc1\x01\xd3\xd7,\x07'm\x82\xafz\xf3\x9f$"), '\x64' + chr(1023 - 922) + chr(99) + chr(2776 - 2665) + '\144' + chr(101))('\165' + chr(116) + chr(9362 - 9260) + chr(931 - 886) + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'\x89\xd6\x11\xd6\xdd.\x07'), chr(0b1100100) + chr(101) + '\143' + '\x6f' + '\x64' + chr(7716 - 7615))(chr(8529 - 8412) + chr(0b1110100) + '\146' + chr(0b100 + 0o51) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\x89\xc6\x16\xcb\xcc#\x01\x10'), '\x64' + '\x65' + chr(6031 - 5932) + chr(0b110001 + 0o76) + chr(0b1000000 + 0o44) + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + '\055' + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\x89\xc6\x16\xcb\xcc#\x01\x10P\x93\xb6z'), chr(0b111110 + 0o46) + '\145' + chr(5863 - 5764) + chr(0b1101111) + chr(0b11111 + 0o105) + chr(101))(chr(0b101011 + 0o112) + chr(116) + chr(102) + chr(0b1100 + 0o41) + chr(1277 - 1221))] Mun9ZMVnTmkT = jYZAKYxMTtNT(znjnJWK64FDT.GUKetu4xaGsJ, cgRZt2mEHcZ8, Zbv_xhTwUzaU) WZw7X3WyoiQk = [] if suIjIS24Zkqw(Mun9ZMVnTmkT, N9zlRy29S1SS): roI3spqORKae(WZw7X3WyoiQk, roI3spqORKae(ES5oEprVxulp(b'\x80\xf06\x8b\xc6%%\x0bn\x99\x9b;'), chr(0b1000100 + 0o40) + chr(8400 - 8299) + chr(4105 - 4006) + chr(0b1101111) + chr(0b1100100) + chr(5313 - 5212))('\165' + chr(0b110 + 0o156) + chr(0b1100110) + chr(45) + chr(56)))(Mun9ZMVnTmkT) elif suIjIS24Zkqw(Mun9ZMVnTmkT, znjnJWK64FDT): r9adlED5qi97 = Mun9ZMVnTmkT.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\xeb\xd0\x00\xc7\xca'), '\x64' + chr(0b1100101) + chr(0b11001 + 0o112) + chr(111) + chr(100) + chr(0b1100101))(chr(0b11110 + 0o127) + chr(116) + '\x66' + chr(1315 - 1270) + '\070')) try: WtQbYYSfIwiX = Mun9ZMVnTmkT[roI3spqORKae(ES5oEprVxulp(b'\x88\xe8\x04\xdd\xdb.'), '\x64' + chr(7666 - 7565) + '\x63' + '\x6f' + chr(100) + '\x65')('\x75' + '\164' + chr(102) + chr(0b10001 + 0o34) + chr(0b110001 + 0o7))] except knUxyjfq07F9: roI3spqORKae(WZw7X3WyoiQk, roI3spqORKae(ES5oEprVxulp(b'\x80\xf06\x8b\xc6%%\x0bn\x99\x9b;'), chr(100) + chr(0b1100101) + chr(0b111101 + 0o46) + '\157' + chr(100) + chr(0b1011100 + 0o11))('\x75' + chr(0b1000101 + 0o57) + chr(8039 - 7937) + chr(630 - 585) + '\070'))(r9adlED5qi97) else: roI3spqORKae(WZw7X3WyoiQk, roI3spqORKae(ES5oEprVxulp(b'\x80\xf06\x8b\xc6%%\x0bn\x99\x9b;'), chr(5160 - 5060) + chr(0b1100101) + '\143' + '\157' + '\144' + '\145')(chr(0b1110101) + '\164' + '\146' + '\x2d' + chr(0b10000 + 0o50)))(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xb3\xd9_\x9f\xc5?'), chr(0b111111 + 0o45) + '\145' + chr(0b10101 + 0o116) + chr(8820 - 8709) + '\x64' + chr(0b110110 + 0o57))(chr(12976 - 12859) + chr(0b1110100) + chr(0b1000111 + 0o37) + chr(387 - 342) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\xb9\x97V\xf4\xf9q\x04\x0bU\xa9\x8dD'), chr(5545 - 5445) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(0b101010 + 0o72) + chr(0b1000001 + 0o44))(chr(0b1110101) + chr(11276 - 11160) + chr(0b1011100 + 0o12) + '\x2d' + chr(0b111000)))(WtQbYYSfIwiX, r9adlED5qi97)) elif suIjIS24Zkqw(Mun9ZMVnTmkT, H4NoA26ON7iG): for fqFUZNHv3gY7 in Mun9ZMVnTmkT: try: r9adlED5qi97 = fqFUZNHv3gY7[roI3spqORKae(ES5oEprVxulp(b'\xeb\xd0\x00\xc7\xca'), chr(0b111000 + 0o54) + chr(0b1100101) + chr(0b11110 + 0o105) + '\157' + chr(0b1110 + 0o126) + chr(0b1100101))(chr(0b1110101) + '\164' + chr(102) + chr(455 - 410) + chr(56))] except knUxyjfq07F9: r9adlED5qi97 = fqFUZNHv3gY7 try: WtQbYYSfIwiX = fqFUZNHv3gY7[roI3spqORKae(ES5oEprVxulp(b'\x88\xe8\x04\xdd\xdb.'), chr(3457 - 3357) + chr(663 - 562) + chr(3266 - 3167) + chr(0b1101111) + chr(0b1000100 + 0o40) + chr(8164 - 8063))('\165' + '\x74' + chr(0b1100110) + '\x2d' + chr(2635 - 2579))] except knUxyjfq07F9: roI3spqORKae(WZw7X3WyoiQk, roI3spqORKae(ES5oEprVxulp(b'\x80\xf06\x8b\xc6%%\x0bn\x99\x9b;'), chr(5696 - 5596) + chr(0b1000010 + 0o43) + chr(99) + '\x6f' + chr(0b1100100) + '\145')(chr(7693 - 7576) + chr(12213 - 12097) + '\x66' + chr(0b101101) + '\x38'))(r9adlED5qi97) else: roI3spqORKae(WZw7X3WyoiQk, roI3spqORKae(ES5oEprVxulp(b'\x80\xf06\x8b\xc6%%\x0bn\x99\x9b;'), chr(0b1000 + 0o134) + chr(0b10110 + 0o117) + '\x63' + chr(4467 - 4356) + chr(6130 - 6030) + chr(0b1100101))(chr(117) + chr(0b1101000 + 0o14) + '\x66' + chr(0b10001 + 0o34) + chr(0b1111 + 0o51)))(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xb3\xd9_\x9f\xc5?'), chr(100) + chr(0b1001011 + 0o32) + chr(0b1001101 + 0o26) + chr(4083 - 3972) + '\x64' + '\x65')('\x75' + chr(0b100000 + 0o124) + chr(102) + '\055' + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\xb9\x97V\xf4\xf9q\x04\x0bU\xa9\x8dD'), chr(4889 - 4789) + chr(0b1100 + 0o131) + '\143' + '\157' + chr(0b1100100) + '\145')(chr(2116 - 1999) + chr(613 - 497) + chr(0b1100110) + '\x2d' + '\x38'))(WtQbYYSfIwiX, r9adlED5qi97)) else: raise _1qUu0gKi9gH(roI3spqORKae(ES5oEprVxulp(b'\x8d\xd6\x17\xd0\xccb\x12\x05v\x85\xa7`\xfd\xd0+f_/\x9f\xf3\xcc\x0ej'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(0b1011101 + 0o7) + '\145')(chr(10952 - 10835) + chr(116) + chr(0b1100110) + '\x2d' + chr(56))) return roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xc2\xae'), chr(8580 - 8480) + chr(0b1001 + 0o134) + '\x63' + chr(6074 - 5963) + chr(100) + chr(8028 - 7927))(chr(8086 - 7969) + chr(0b1110100) + chr(6783 - 6681) + chr(0b101 + 0o50) + chr(1172 - 1116)), roI3spqORKae(ES5oEprVxulp(b'\x91\x90\x1c\xf2\x87\x00\x01\x02P\xb5\x80\x7f'), chr(100) + chr(9203 - 9102) + chr(0b1000011 + 0o40) + chr(0b1001100 + 0o43) + chr(0b1001111 + 0o25) + chr(0b100101 + 0o100))(chr(0b1110101) + '\x74' + '\x66' + '\x2d' + chr(56)))(WZw7X3WyoiQk)
mfcovington/pubmed-lookup
pubmed_lookup/pubmed_lookup.py
Publication.get_pubmed_xml
def get_pubmed_xml(self): """ Use a PubMed ID to retrieve PubMed metadata in XML form. """ url = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/' \ 'efetch.fcgi?db=pubmed&rettype=abstract&id={}' \ .format(self.pmid) try: response = urlopen(url) except URLError: xml_dict = '' else: xml = response.read().decode() xml_dict = xmltodict.parse(xml) return xml_dict
python
def get_pubmed_xml(self): """ Use a PubMed ID to retrieve PubMed metadata in XML form. """ url = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/' \ 'efetch.fcgi?db=pubmed&rettype=abstract&id={}' \ .format(self.pmid) try: response = urlopen(url) except URLError: xml_dict = '' else: xml = response.read().decode() xml_dict = xmltodict.parse(xml) return xml_dict
[ "def", "get_pubmed_xml", "(", "self", ")", ":", "url", "=", "'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/'", "'efetch.fcgi?db=pubmed&rettype=abstract&id={}'", ".", "format", "(", "self", ".", "pmid", ")", "try", ":", "response", "=", "urlopen", "(", "url", ")", "except", "URLError", ":", "xml_dict", "=", "''", "else", ":", "xml", "=", "response", ".", "read", "(", ")", ".", "decode", "(", ")", "xml_dict", "=", "xmltodict", ".", "parse", "(", "xml", ")", "return", "xml_dict" ]
Use a PubMed ID to retrieve PubMed metadata in XML form.
[ "Use", "a", "PubMed", "ID", "to", "retrieve", "PubMed", "metadata", "in", "XML", "form", "." ]
b0aa2945b354f0945db73da22dd15ea628212da8
https://github.com/mfcovington/pubmed-lookup/blob/b0aa2945b354f0945db73da22dd15ea628212da8/pubmed_lookup/pubmed_lookup.py#L150-L166
train
Get PubMed metadata in XML form.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtb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Imz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + '\157' + '\x37' + chr(55), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(2287 - 2238) + '\061' + chr(0b110010 + 0o1), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(55), 54600 - 54592), nzTpIcepk0o8('\x30' + chr(3970 - 3859) + chr(2335 - 2286) + chr(1039 - 987) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + chr(984 - 934) + chr(0b1100 + 0o52), ord("\x08")), nzTpIcepk0o8('\x30' + chr(4422 - 4311) + chr(421 - 370) + chr(50), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(377 - 327) + chr(0b1001 + 0o50) + '\063', 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b100001 + 0o21) + chr(0b10111 + 0o35) + chr(52), 0b1000), nzTpIcepk0o8('\x30' + chr(3339 - 3228) + '\061' + chr(0b10 + 0o65), 32559 - 32551), nzTpIcepk0o8(chr(0b110000) + chr(6894 - 6783) + '\062' + '\066' + chr(52), 19700 - 19692), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011) + '\060' + chr(0b110000), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(0b10101 + 0o35) + chr(0b110110) + '\067', 53516 - 53508), nzTpIcepk0o8('\060' + '\x6f' + chr(0b1111 + 0o43) + chr(1463 - 1408) + chr(0b100111 + 0o14), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(51) + '\x36' + chr(387 - 332), 0b1000), nzTpIcepk0o8(chr(48) + chr(3685 - 3574) + '\x33' + chr(0b110101) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x33' + '\x31' + chr(0b110010), 0o10), nzTpIcepk0o8(chr(48) + chr(0b111110 + 0o61) + chr(49) + chr(0b110001) + '\061', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b1011 + 0o46) + chr(52) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(111) + chr(51) + '\063' + chr(0b11111 + 0o22), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1010110 + 0o31) + chr(1932 - 1881) + chr(1104 - 1053) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(1462 - 1414) + chr(0b1101111) + chr(0b10000 + 0o42) + chr(1167 - 1117) + chr(1290 - 1242), 0b1000), nzTpIcepk0o8(chr(1160 - 1112) + '\157' + chr(0b101000 + 0o12) + chr(0b1101 + 0o43) + chr(0b110000), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110010 + 0o4) + chr(52), 60559 - 60551), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(0b1101111) + '\061' + '\x37' + chr(1301 - 1249), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b100111 + 0o110) + chr(0b100110 + 0o15) + chr(1319 - 1267) + '\x37', 48568 - 48560), nzTpIcepk0o8(chr(802 - 754) + chr(0b1101111) + chr(192 - 143) + '\064' + chr(1052 - 997), 0b1000), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(111) + '\x33' + chr(848 - 796) + '\061', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1985 - 1935) + chr(50) + chr(0b110011), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\x33' + chr(911 - 860) + chr(49), 8), nzTpIcepk0o8(chr(71 - 23) + chr(0b1101111) + '\062' + chr(0b11100 + 0o30) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b101100 + 0o4) + '\157' + chr(51) + chr(0b1111 + 0o47) + chr(0b10000 + 0o46), 38308 - 38300), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(0b1101111) + '\061' + '\x33' + chr(51), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b1010 + 0o47) + chr(54) + chr(0b110001), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1029 - 979) + chr(50) + chr(0b100001 + 0o20), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(49) + '\062' + chr(0b110010 + 0o1), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1909 - 1858) + chr(0b110000) + chr(54), ord("\x08")), nzTpIcepk0o8('\x30' + chr(8054 - 7943) + '\x33' + chr(55), ord("\x08")), nzTpIcepk0o8(chr(1872 - 1824) + chr(2796 - 2685) + '\x33' + chr(49) + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(0b1101111) + chr(50) + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110010) + chr(48) + chr(0b101011 + 0o5), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\157' + chr(2083 - 2030) + '\060', ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x11'), '\x64' + chr(0b1100101) + '\143' + chr(111) + '\144' + '\145')('\165' + chr(116) + chr(0b1100110) + '\055' + '\x38') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def LcnxaottEYfZ(hXMPsSrOQzbh): XuBkOpBKZJ5Z = roI3spqORKae(ES5oEprVxulp(b'W?s\x13\xac5\xa4\xc1z\xc0\xa9\xdb\xc8\xd9\x87\xa9+\x08\xf7\xb4\xfc\xed\x1a\x12\x8e\x0f\xcf\xf4\xb6\xd0\xd9>\x1f\xe5!\xa3e\xe0s\xf5K"k\x10\xb9\x7f\xed\xc1{\xd7\xa8\x99\xdd\x94\x8e\xa3v\x05\xbb\xe7\xe0\xf5V\x11\x82\x03\xc7\xe1\xbc\xd2\x82"\x01\xf4n\xa7}\xbcb\xf2^(sE\xff~\xb6\xdfr'), '\x64' + chr(0b111 + 0o136) + '\x63' + '\157' + '\x64' + chr(0b1010110 + 0o17))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b101101) + chr(0b111000)).q33KG3foQ_CJ(hXMPsSrOQzbh.aLRDdYW1VYTI) try: k2zzaFDtbuhL = _txW603MYaaa(XuBkOpBKZJ5Z) except z28UzQ0YvNhy: Zbv_xhTwUzaU = roI3spqORKae(ES5oEprVxulp(b''), '\144' + '\145' + '\x63' + chr(6793 - 6682) + chr(0b1100100) + chr(101))('\165' + '\x74' + '\146' + chr(45) + chr(1941 - 1885)) else: wPwpO2Y0Jcjv = k2zzaFDtbuhL.read().lfbFsdWlT3MB() Zbv_xhTwUzaU = cgSUaMTcbfyX.zgDfHOdKcvCW(wPwpO2Y0Jcjv) return Zbv_xhTwUzaU
mfcovington/pubmed-lookup
pubmed_lookup/pubmed_lookup.py
Publication.set_abstract
def set_abstract(self, xml_dict): """ If record has an abstract, extract it from PubMed's XML data """ if self.record.get('HasAbstract') == 1 and xml_dict: self.abstract = self.parse_abstract(xml_dict) else: self.abstract = ''
python
def set_abstract(self, xml_dict): """ If record has an abstract, extract it from PubMed's XML data """ if self.record.get('HasAbstract') == 1 and xml_dict: self.abstract = self.parse_abstract(xml_dict) else: self.abstract = ''
[ "def", "set_abstract", "(", "self", ",", "xml_dict", ")", ":", "if", "self", ".", "record", ".", "get", "(", "'HasAbstract'", ")", "==", "1", "and", "xml_dict", ":", "self", ".", "abstract", "=", "self", ".", "parse_abstract", "(", "xml_dict", ")", "else", ":", "self", ".", "abstract", "=", "''" ]
If record has an abstract, extract it from PubMed's XML data
[ "If", "record", "has", "an", "abstract", "extract", "it", "from", "PubMed", "s", "XML", "data" ]
b0aa2945b354f0945db73da22dd15ea628212da8
https://github.com/mfcovington/pubmed-lookup/blob/b0aa2945b354f0945db73da22dd15ea628212da8/pubmed_lookup/pubmed_lookup.py#L168-L175
train
Set the abstract attribute of the object.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiV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rGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b101111 + 0o1) + '\x6f' + chr(0b11010 + 0o30) + '\x33' + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110001) + chr(52) + '\061', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110010) + chr(51) + chr(0b1001 + 0o56), 0b1000), nzTpIcepk0o8('\060' + chr(2953 - 2842) + chr(0b10110 + 0o35) + '\064' + '\064', 25519 - 25511), nzTpIcepk0o8('\x30' + chr(11210 - 11099) + chr(83 - 33) + '\x31' + '\065', 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\062' + '\x33' + chr(230 - 175), 8), nzTpIcepk0o8('\x30' + '\157' + chr(0b110001) + chr(0b100000 + 0o20), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b100010 + 0o17) + '\063' + chr(0b11100 + 0o24), 0o10), nzTpIcepk0o8('\x30' + chr(0b111010 + 0o65) + '\067' + '\063', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b1010 + 0o47) + chr(0b111 + 0o53) + chr(0b1011 + 0o50), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b10100 + 0o35) + chr(0b10010 + 0o42), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\061' + '\061' + chr(2088 - 2040), 30479 - 30471), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + chr(125 - 72) + '\065', 0b1000), nzTpIcepk0o8('\060' + '\157' + '\x33' + '\x35' + chr(1049 - 1001), 34679 - 34671), nzTpIcepk0o8(chr(0b110000) + chr(7212 - 7101) + chr(936 - 885) + '\060', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b100001 + 0o25) + chr(0b1001 + 0o56), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(54) + '\x33', 63698 - 63690), nzTpIcepk0o8(chr(1626 - 1578) + chr(111) + chr(2150 - 2101) + chr(0b110001) + chr(0b110000), 8), nzTpIcepk0o8('\x30' + chr(111) + '\061' + chr(135 - 83) + '\062', 0b1000), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(0b1111 + 0o140) + chr(0b110100) + chr(50), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(2053 - 2004) + chr(0b110011) + chr(189 - 137), 2489 - 2481), nzTpIcepk0o8('\x30' + '\157' + '\062' + chr(0b10100 + 0o43) + chr(0b1 + 0o65), 61026 - 61018), nzTpIcepk0o8(chr(0b110000) + chr(0b1010 + 0o145) + chr(50) + chr(0b1 + 0o65) + '\064', 64122 - 64114), nzTpIcepk0o8('\060' + chr(0b111101 + 0o62) + chr(0b110001) + '\x36' + chr(0b110101), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(0b1110 + 0o42) + chr(0b101001 + 0o14), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\062' + '\063' + chr(0b101 + 0o56), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1000010 + 0o55) + '\061' + chr(0b110100) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(6202 - 6091) + '\061' + chr(48), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1001001 + 0o46) + '\x32' + '\063' + '\x32', 50265 - 50257), nzTpIcepk0o8(chr(48) + '\157' + chr(389 - 338) + chr(2680 - 2625) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(48) + chr(7523 - 7412) + chr(2250 - 2201) + chr(0b11 + 0o57) + '\x31', 0b1000), nzTpIcepk0o8(chr(1622 - 1574) + chr(111) + chr(0b10111 + 0o36) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b1101111) + '\x36' + chr(475 - 426), 0b1000), nzTpIcepk0o8(chr(0b10011 + 0o35) + '\x6f' + '\063' + '\x36' + chr(50), 63902 - 63894), nzTpIcepk0o8(chr(2232 - 2184) + chr(2730 - 2619) + chr(0b110001) + '\061' + '\065', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110001) + chr(1417 - 1362) + chr(0b111 + 0o57), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\x34' + chr(1088 - 1038), 8), nzTpIcepk0o8(chr(1020 - 972) + chr(10309 - 10198) + '\066' + '\061', 8), nzTpIcepk0o8('\x30' + chr(3636 - 3525) + chr(49) + '\x31', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b111001 + 0o66) + chr(1181 - 1131) + chr(52), 51661 - 51653)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\x6f' + '\x35' + chr(0b11000 + 0o30), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xb5'), chr(100) + chr(0b1100101) + chr(4993 - 4894) + '\x6f' + '\x64' + chr(0b1100101))(chr(9101 - 8984) + '\164' + chr(0b1100110) + chr(0b10001 + 0o34) + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def mhvcwtDDBr01(hXMPsSrOQzbh, Zbv_xhTwUzaU): if roI3spqORKae(hXMPsSrOQzbh.record, roI3spqORKae(ES5oEprVxulp(b'\xdc4\xd4\x81\xf9\xea< Z\x14\x7f\x02'), chr(0b1100100) + chr(1173 - 1072) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(0b1110100) + '\x66' + '\x2d' + '\070'))(roI3spqORKae(ES5oEprVxulp(b'\xd3\x00\xec\xa5\xef\xec|*Z0x'), '\x64' + chr(0b1100101) + '\x63' + chr(0b1101111) + '\x64' + chr(101))(chr(3112 - 2995) + '\x74' + '\x66' + chr(1219 - 1174) + chr(0b10 + 0o66))) == nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b1001101 + 0o42) + '\061', 0o10) and Zbv_xhTwUzaU: hXMPsSrOQzbh.B6iD7Y7Dry1Q = hXMPsSrOQzbh.parse_abstract(Zbv_xhTwUzaU) else: hXMPsSrOQzbh.B6iD7Y7Dry1Q = roI3spqORKae(ES5oEprVxulp(b''), chr(0b101111 + 0o65) + '\x65' + chr(0b1100011) + '\157' + chr(0b1100100) + '\145')('\x75' + '\164' + chr(102) + chr(45) + '\x38')
mfcovington/pubmed-lookup
pubmed_lookup/pubmed_lookup.py
Publication.set_article_url
def set_article_url(self, resolve_doi=True): """ If record has a DOI, set article URL based on where the DOI points. """ if 'DOI' in self.record: doi_url = "/".join(['http://dx.doi.org', self.record['DOI']]) if resolve_doi: try: response = urlopen(doi_url) except URLError: self.url = '' else: self.url = response.geturl() else: self.url = doi_url else: self.url = ''
python
def set_article_url(self, resolve_doi=True): """ If record has a DOI, set article URL based on where the DOI points. """ if 'DOI' in self.record: doi_url = "/".join(['http://dx.doi.org', self.record['DOI']]) if resolve_doi: try: response = urlopen(doi_url) except URLError: self.url = '' else: self.url = response.geturl() else: self.url = doi_url else: self.url = ''
[ "def", "set_article_url", "(", "self", ",", "resolve_doi", "=", "True", ")", ":", "if", "'DOI'", "in", "self", ".", "record", ":", "doi_url", "=", "\"/\"", ".", "join", "(", "[", "'http://dx.doi.org'", ",", "self", ".", "record", "[", "'DOI'", "]", "]", ")", "if", "resolve_doi", ":", "try", ":", "response", "=", "urlopen", "(", "doi_url", ")", "except", "URLError", ":", "self", ".", "url", "=", "''", "else", ":", "self", ".", "url", "=", "response", ".", "geturl", "(", ")", "else", ":", "self", ".", "url", "=", "doi_url", "else", ":", "self", ".", "url", "=", "''" ]
If record has a DOI, set article URL based on where the DOI points.
[ "If", "record", "has", "a", "DOI", "set", "article", "URL", "based", "on", "where", "the", "DOI", "points", "." ]
b0aa2945b354f0945db73da22dd15ea628212da8
https://github.com/mfcovington/pubmed-lookup/blob/b0aa2945b354f0945db73da22dd15ea628212da8/pubmed_lookup/pubmed_lookup.py#L177-L195
train
Set article URL based on where the DOI points.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,K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Rngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x37' + '\x30', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b111101 + 0o62) + '\061' + chr(1174 - 1126) + '\065', 0b1000), nzTpIcepk0o8(chr(0b10010 + 0o36) + '\157' + '\x32' + chr(0b110111) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\062' + '\060' + chr(49), 0b1000), nzTpIcepk0o8('\060' + chr(10072 - 9961) + chr(707 - 658) + chr(0b110000) + '\065', 8), nzTpIcepk0o8('\060' + '\157' + '\061' + chr(1812 - 1759) + chr(1468 - 1417), 0b1000), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(1315 - 1204) + chr(49) + '\060' + chr(1012 - 963), 0o10), nzTpIcepk0o8(chr(86 - 38) + '\157' + chr(1564 - 1513) + chr(51) + '\062', ord("\x08")), nzTpIcepk0o8(chr(0b10 + 0o56) + '\157' + '\x33' + chr(0b110110) + chr(0b110101), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(1332 - 1283) + chr(0b101001 + 0o11) + '\x32', 22714 - 22706), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(1513 - 1402) + '\064' + chr(0b101001 + 0o10), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\x33' + chr(590 - 539) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(6918 - 6807) + chr(0b101001 + 0o12) + '\067' + chr(276 - 223), 0o10), nzTpIcepk0o8(chr(48) + chr(724 - 613) + chr(49) + chr(680 - 626) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b11010 + 0o26) + '\157' + chr(0b1011 + 0o47) + chr(0b110100), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + chr(0b110010) + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(12315 - 12204) + '\x34' + '\061', 8), nzTpIcepk0o8(chr(48) + chr(4785 - 4674) + '\062' + chr(0b110100) + chr(0b110101), 19740 - 19732), nzTpIcepk0o8(chr(1476 - 1428) + '\157' + '\061' + chr(0b110001) + chr(50), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1011011 + 0o24) + '\063' + chr(49) + chr(55), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1001111 + 0o40) + chr(55) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(7894 - 7783) + '\x33' + chr(523 - 473) + chr(0b11 + 0o55), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(2394 - 2345) + '\061' + chr(51), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(779 - 730) + chr(0b1011 + 0o52) + chr(0b100111 + 0o16), ord("\x08")), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(0b1000100 + 0o53) + '\061' + '\x32' + '\x31', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b100011 + 0o114) + '\x31' + chr(0b110101), 12607 - 12599), nzTpIcepk0o8(chr(1276 - 1228) + '\x6f' + chr(0b110010) + '\x30' + chr(51), 0o10), nzTpIcepk0o8('\060' + chr(8008 - 7897) + chr(50) + chr(0b11001 + 0o34) + '\x33', 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b110010) + chr(0b10010 + 0o43) + '\064', 0b1000), nzTpIcepk0o8(chr(1635 - 1587) + chr(0b1101111) + chr(51) + '\062' + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(3470 - 3359) + chr(2245 - 2190) + chr(0b110 + 0o53), 8), nzTpIcepk0o8(chr(1203 - 1155) + '\157' + '\065' + chr(2254 - 2201), ord("\x08")), nzTpIcepk0o8('\x30' + chr(2508 - 2397) + chr(2254 - 2204) + chr(55) + chr(1257 - 1207), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(273 - 224) + chr(54) + chr(52), 6907 - 6899), nzTpIcepk0o8(chr(48) + chr(111) + chr(1432 - 1383) + chr(0b10 + 0o64) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(7844 - 7733) + chr(0b0 + 0o63) + chr(0b110000) + chr(0b110011), 36236 - 36228), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(3047 - 2936) + '\x33' + chr(0b1000 + 0o50) + chr(50), 49195 - 49187), nzTpIcepk0o8(chr(0b101000 + 0o10) + '\x6f' + '\062' + chr(304 - 254) + chr(0b100011 + 0o23), 8), nzTpIcepk0o8(chr(0b111 + 0o51) + '\157' + chr(0b110110 + 0o0) + chr(0b110001), 0o10), nzTpIcepk0o8('\x30' + chr(11349 - 11238) + chr(0b101 + 0o60) + '\060', 2353 - 2345)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b10001 + 0o136) + chr(1657 - 1604) + chr(1901 - 1853), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x16'), chr(0b1100100) + '\145' + chr(99) + chr(0b110 + 0o151) + chr(2812 - 2712) + chr(0b1100101))(chr(0b1110101) + chr(1009 - 893) + chr(0b1100110) + '\055' + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def ToRTu8001RtW(hXMPsSrOQzbh, rQUdsiIguNyP=nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001), 0b1000)): if roI3spqORKae(ES5oEprVxulp(b'|\n\xf2'), chr(0b1011010 + 0o12) + chr(101) + chr(0b11100 + 0o107) + chr(5709 - 5598) + chr(0b1100100) + chr(8510 - 8409))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(0b10000 + 0o50)) in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b']1\xca\xc7\x15*,\xb6\xc2\x02\x14\x8d'), '\x64' + chr(101) + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(6197 - 6096))(chr(0b101010 + 0o113) + chr(11384 - 11268) + chr(0b1100110) + chr(45) + '\x38')): FVyvRDEZP1Mj = roI3spqORKae(ES5oEprVxulp(b'\x17'), chr(100) + chr(0b1100101) + '\x63' + '\x6f' + chr(0b1000111 + 0o35) + '\x65')('\x75' + chr(0b10001 + 0o143) + chr(0b1100110) + chr(1683 - 1638) + chr(0b110110 + 0o2)).Y4yM9BcfTCNq([roI3spqORKae(ES5oEprVxulp(b'P1\xcf\xf1\x7fDn\xbe\x8d|E\xb0\x94^{\xe4F'), chr(100) + '\x65' + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(101))('\x75' + chr(116) + '\x66' + chr(45) + chr(2961 - 2905)), hXMPsSrOQzbh.etqFPAml7P5R[roI3spqORKae(ES5oEprVxulp(b'|\n\xf2'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(0b1101111) + '\144' + chr(2477 - 2376))('\x75' + chr(0b1100010 + 0o22) + '\x66' + chr(0b101101) + '\x38')]]) if rQUdsiIguNyP: try: k2zzaFDtbuhL = _txW603MYaaa(FVyvRDEZP1Mj) except z28UzQ0YvNhy: hXMPsSrOQzbh.XuBkOpBKZJ5Z = roI3spqORKae(ES5oEprVxulp(b''), '\x64' + chr(0b1001100 + 0o31) + chr(0b1011111 + 0o4) + chr(2096 - 1985) + '\144' + chr(0b1100101))('\x75' + '\164' + '\x66' + '\x2d' + '\070') else: hXMPsSrOQzbh.XuBkOpBKZJ5Z = k2zzaFDtbuhL.geturl() else: hXMPsSrOQzbh.XuBkOpBKZJ5Z = FVyvRDEZP1Mj else: hXMPsSrOQzbh.XuBkOpBKZJ5Z = roI3spqORKae(ES5oEprVxulp(b''), chr(0b1100100) + chr(0b1100011 + 0o2) + chr(5404 - 5305) + chr(111) + chr(0b1100100) + chr(5467 - 5366))(chr(117) + chr(5936 - 5820) + '\146' + chr(0b101101) + chr(0b10110 + 0o42))
mfcovington/pubmed-lookup
pubmed_lookup/pubmed_lookup.py
Publication.set_pub_year_month_day
def set_pub_year_month_day(self, xml_dict): """ Set publication year, month, day from PubMed's XML data """ key_path = ['PubmedArticleSet', 'PubmedArticle', 'MedlineCitation', 'Article', 'Journal', 'JournalIssue', 'PubDate'] pubdate_xml = reduce(dict.get, key_path, xml_dict) if isinstance(pubdate_xml, dict): self.year = pubdate_xml.get('Year') month_short = pubdate_xml.get('Month') self.day = pubdate_xml.get('Day') try: self.month = datetime.datetime.strptime( month_short, "%b").month except (ValueError, TypeError): self.month = '' else: self.year = '' self.month = '' self.day = ''
python
def set_pub_year_month_day(self, xml_dict): """ Set publication year, month, day from PubMed's XML data """ key_path = ['PubmedArticleSet', 'PubmedArticle', 'MedlineCitation', 'Article', 'Journal', 'JournalIssue', 'PubDate'] pubdate_xml = reduce(dict.get, key_path, xml_dict) if isinstance(pubdate_xml, dict): self.year = pubdate_xml.get('Year') month_short = pubdate_xml.get('Month') self.day = pubdate_xml.get('Day') try: self.month = datetime.datetime.strptime( month_short, "%b").month except (ValueError, TypeError): self.month = '' else: self.year = '' self.month = '' self.day = ''
[ "def", "set_pub_year_month_day", "(", "self", ",", "xml_dict", ")", ":", "key_path", "=", "[", "'PubmedArticleSet'", ",", "'PubmedArticle'", ",", "'MedlineCitation'", ",", "'Article'", ",", "'Journal'", ",", "'JournalIssue'", ",", "'PubDate'", "]", "pubdate_xml", "=", "reduce", "(", "dict", ".", "get", ",", "key_path", ",", "xml_dict", ")", "if", "isinstance", "(", "pubdate_xml", ",", "dict", ")", ":", "self", ".", "year", "=", "pubdate_xml", ".", "get", "(", "'Year'", ")", "month_short", "=", "pubdate_xml", ".", "get", "(", "'Month'", ")", "self", ".", "day", "=", "pubdate_xml", ".", "get", "(", "'Day'", ")", "try", ":", "self", ".", "month", "=", "datetime", ".", "datetime", ".", "strptime", "(", "month_short", ",", "\"%b\"", ")", ".", "month", "except", "(", "ValueError", ",", "TypeError", ")", ":", "self", ".", "month", "=", "''", "else", ":", "self", ".", "year", "=", "''", "self", ".", "month", "=", "''", "self", ".", "day", "=", "''" ]
Set publication year, month, day from PubMed's XML data
[ "Set", "publication", "year", "month", "day", "from", "PubMed", "s", "XML", "data" ]
b0aa2945b354f0945db73da22dd15ea628212da8
https://github.com/mfcovington/pubmed-lookup/blob/b0aa2945b354f0945db73da22dd15ea628212da8/pubmed_lookup/pubmed_lookup.py#L197-L219
train
Set publication year month day from PubMed s XML data
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2Qm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,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\157' + chr(318 - 268) + '\x36' + chr(2251 - 2201), 57892 - 57884), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b1001 + 0o51), ord("\x08")), nzTpIcepk0o8(chr(394 - 346) + chr(111) + '\062' + chr(0b110101) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(943 - 894) + chr(0b110111) + '\060', 0b1000), nzTpIcepk0o8(chr(0b10000 + 0o40) + '\x6f' + chr(51) + chr(1939 - 1890) + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b101100 + 0o5) + chr(0b111 + 0o54) + chr(0b1000 + 0o56), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\063' + chr(378 - 324) + '\067', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(2184 - 2135) + chr(0b100011 + 0o15) + chr(55), 59528 - 59520), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x33' + chr(0b110111) + chr(0b110111), 0b1000), nzTpIcepk0o8('\060' + chr(9720 - 9609) + chr(0b10 + 0o57) + '\061', 0b1000), nzTpIcepk0o8('\060' + chr(1288 - 1177) + '\061' + chr(50) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b0 + 0o61) + chr(0b110100) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(394 - 346) + chr(111) + '\x33' + chr(0b110100), 50011 - 50003), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(0b110111) + chr(48), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(6900 - 6789) + chr(0b1110 + 0o43) + chr(53), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b1101 + 0o46) + chr(49), 18336 - 18328), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(0b1101111) + '\x33' + chr(0b100100 + 0o16) + chr(0b110000), 62434 - 62426), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(111) + chr(0b10111 + 0o36) + '\066', 0b1000), nzTpIcepk0o8(chr(1669 - 1621) + chr(0b1001011 + 0o44) + '\062' + chr(0b110010) + '\x33', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b11011 + 0o26), 56238 - 56230), nzTpIcepk0o8(chr(48) + '\157' + chr(51) + chr(478 - 425) + chr(49), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + '\066' + '\x32', 54026 - 54018), nzTpIcepk0o8('\060' + chr(0b110011 + 0o74) + '\063' + '\x36' + chr(0b11110 + 0o30), 20573 - 20565), nzTpIcepk0o8(chr(0b110000) + chr(0b1010001 + 0o36) + chr(0b110010) + '\064' + chr(0b110000 + 0o1), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(51) + '\064' + chr(0b1 + 0o63), 0b1000), nzTpIcepk0o8(chr(2179 - 2131) + chr(8936 - 8825) + '\x33' + '\066' + '\x35', ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + chr(456 - 403) + '\065', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b10001 + 0o40) + chr(584 - 534) + '\x33', 56660 - 56652), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1958 - 1907) + chr(1417 - 1367) + chr(0b110011 + 0o2), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1939 - 1890) + chr(0b110010) + chr(0b110001 + 0o6), 8), nzTpIcepk0o8(chr(1996 - 1948) + '\157' + chr(49) + '\x36' + chr(513 - 465), 0b1000), nzTpIcepk0o8(chr(0b10100 + 0o34) + '\x6f' + chr(52) + '\x36', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b1001 + 0o51) + chr(0b101001 + 0o7) + chr(51), 27097 - 27089), nzTpIcepk0o8(chr(460 - 412) + chr(0b11000 + 0o127) + '\065' + chr(49), 0b1000), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(111) + chr(0b110110) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(942 - 894) + chr(3062 - 2951) + chr(50) + chr(1224 - 1175) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b11000 + 0o127) + chr(504 - 453) + chr(0b110001 + 0o6) + chr(2169 - 2120), 0b1000), nzTpIcepk0o8(chr(1815 - 1767) + '\157' + chr(0b1101 + 0o46) + chr(153 - 98) + '\064', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b11011 + 0o124) + chr(49) + '\x32' + '\067', 8), nzTpIcepk0o8('\060' + '\157' + chr(50) + '\x30' + chr(2027 - 1975), 16437 - 16429)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\157' + chr(0b110101) + '\x30', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x9c'), chr(0b1100100) + chr(0b1100101) + '\x63' + '\157' + '\144' + chr(101))(chr(0b1101100 + 0o11) + chr(3083 - 2967) + chr(0b100011 + 0o103) + chr(0b101101) + chr(0b111000)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) (jYZAKYxMTtNT,) = (roI3spqORKae(rFFUeiYWzOhx(roI3spqORKae(ES5oEprVxulp(b'\xd4w\xc2\x1b\xbb1\x98+\x8c'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(9037 - 8937) + chr(1680 - 1579))(chr(0b101100 + 0o111) + chr(116) + chr(0b10110 + 0o120) + chr(0b101101) + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'\xc0g\xc8\r\xac;'), chr(0b1100100) + '\145' + chr(4560 - 4461) + chr(10644 - 10533) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(4624 - 4508) + '\x66' + chr(0b101101) + chr(56))), roI3spqORKae(ES5oEprVxulp(b'\xc0g\xc8\r\xac;'), chr(0b1100100) + chr(0b110 + 0o137) + chr(99) + '\157' + chr(0b1100100) + chr(0b1011000 + 0o15))('\165' + chr(0b110010 + 0o102) + chr(0b11001 + 0o115) + '\x2d' + '\x38')),) def ZllGTtT9SXHi(hXMPsSrOQzbh, Zbv_xhTwUzaU): cgRZt2mEHcZ8 = [roI3spqORKae(ES5oEprVxulp(b'\xe2w\xce\x15\xaa:\xb65\x8b`4\x0fy\xabh\xed'), '\x64' + '\x65' + chr(99) + '\x6f' + '\144' + chr(0b1001111 + 0o26))('\165' + chr(0b1100001 + 0o23) + '\x66' + chr(45) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\xe2w\xce\x15\xaa:\xb65\x8b`4\x0fy'), chr(0b1100100) + chr(0b1100101) + chr(8795 - 8696) + chr(7054 - 6943) + chr(0b1100100) + '\145')('\x75' + '\x74' + chr(0b11011 + 0o113) + chr(0b101101) + chr(0b110110 + 0o2)), roI3spqORKae(ES5oEprVxulp(b'\xffg\xc8\x14\xa60\x92\x04\x96}6\x17u\x97c'), chr(100) + chr(0b1100101) + '\143' + '\x6f' + '\x64' + '\145')(chr(0b1100101 + 0o20) + chr(8663 - 8547) + chr(0b1100110) + '\x2d' + chr(0b100011 + 0o25)), roI3spqORKae(ES5oEprVxulp(b'\xf3p\xd8\x11\xac2\x92'), chr(100) + chr(0b11100 + 0o111) + chr(99) + '\x6f' + chr(1602 - 1502) + chr(0b111010 + 0o53))(chr(270 - 153) + chr(11235 - 11119) + chr(0b111101 + 0o51) + '\055' + '\070'), roI3spqORKae(ES5oEprVxulp(b'\xf8m\xd9\n\xa1?\x9b'), '\144' + chr(0b1100101) + chr(7237 - 7138) + chr(0b1101111) + chr(100) + chr(0b100110 + 0o77))(chr(1216 - 1099) + '\164' + chr(0b1011 + 0o133) + '\x2d' + '\070'), roI3spqORKae(ES5oEprVxulp(b'\xf8m\xd9\n\xa1?\x9b\x0e\x8cz"\x06'), chr(0b1100100) + chr(0b1000 + 0o135) + '\x63' + chr(111) + chr(0b101010 + 0o72) + chr(6872 - 6771))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(0b1100 + 0o41) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\xe2w\xce<\xae*\x92'), '\x64' + chr(0b1100011 + 0o2) + '\143' + chr(0b110011 + 0o74) + '\144' + chr(101))('\165' + '\164' + chr(102) + chr(45) + '\x38')] aPjetiUOMDC4 = jYZAKYxMTtNT(znjnJWK64FDT.GUKetu4xaGsJ, cgRZt2mEHcZ8, Zbv_xhTwUzaU) if suIjIS24Zkqw(aPjetiUOMDC4, znjnJWK64FDT): hXMPsSrOQzbh.D5B9zoxpE2ow = aPjetiUOMDC4.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\xebg\xcd\n'), chr(0b1011000 + 0o14) + '\x65' + chr(0b1001110 + 0o25) + chr(0b1101111) + chr(0b1010101 + 0o17) + chr(101))(chr(9396 - 9279) + '\x74' + chr(0b1100110) + '\055' + chr(0b111 + 0o61))) SwyQxFyQk1di = aPjetiUOMDC4.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\xffm\xc2\x0c\xa7'), chr(0b1100100) + '\145' + '\x63' + chr(0b101 + 0o152) + chr(8370 - 8270) + chr(101))(chr(117) + chr(0b1110100) + '\x66' + chr(1216 - 1171) + chr(0b11100 + 0o34))) hXMPsSrOQzbh.oG_5fhgyRwWM = aPjetiUOMDC4.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\xf6c\xd5'), chr(0b1011010 + 0o12) + chr(0b1011011 + 0o12) + '\x63' + chr(11503 - 11392) + chr(0b1011011 + 0o11) + chr(0b1100101))(chr(0b11000 + 0o135) + chr(0b1110100) + chr(0b110001 + 0o65) + chr(0b101000 + 0o5) + chr(0b101010 + 0o16))) try: hXMPsSrOQzbh.ZruqdZstJiSM = pGZg2NXRxBup.datetime.strptime(SwyQxFyQk1di, roI3spqORKae(ES5oEprVxulp(b'\x97`'), '\144' + chr(101) + '\143' + chr(111) + '\x64' + chr(4105 - 4004))('\x75' + '\x74' + chr(102) + '\x2d' + chr(956 - 900))).ZruqdZstJiSM except (WbNHlDKpyPtQ, jZIjKu8IFANs): hXMPsSrOQzbh.ZruqdZstJiSM = roI3spqORKae(ES5oEprVxulp(b''), chr(100) + chr(0b1100101) + chr(3816 - 3717) + chr(0b1101111) + chr(7387 - 7287) + '\x65')(chr(4565 - 4448) + '\x74' + chr(2001 - 1899) + chr(45) + '\070') else: hXMPsSrOQzbh.D5B9zoxpE2ow = roI3spqORKae(ES5oEprVxulp(b''), chr(1141 - 1041) + '\x65' + '\x63' + chr(111) + chr(0b1100100) + chr(3095 - 2994))(chr(5477 - 5360) + '\164' + chr(0b1011001 + 0o15) + chr(45) + chr(56)) hXMPsSrOQzbh.ZruqdZstJiSM = roI3spqORKae(ES5oEprVxulp(b''), chr(0b100111 + 0o75) + '\x65' + chr(3222 - 3123) + '\x6f' + chr(100) + chr(5616 - 5515))(chr(0b110101 + 0o100) + '\x74' + chr(0b1100110) + chr(45) + chr(56)) hXMPsSrOQzbh.oG_5fhgyRwWM = roI3spqORKae(ES5oEprVxulp(b''), '\x64' + chr(596 - 495) + chr(0b1100011) + chr(0b11110 + 0o121) + '\144' + '\145')('\x75' + chr(116) + '\x66' + '\x2d' + '\x38')
mfcovington/pubmed-lookup
pubmed_lookup/pubmed_lookup.py
PubMedLookup.parse_pubmed_url
def parse_pubmed_url(pubmed_url): """Get PubMed ID (pmid) from PubMed URL.""" parse_result = urlparse(pubmed_url) pattern = re.compile(r'^/pubmed/(\d+)$') pmid = pattern.match(parse_result.path).group(1) return pmid
python
def parse_pubmed_url(pubmed_url): """Get PubMed ID (pmid) from PubMed URL.""" parse_result = urlparse(pubmed_url) pattern = re.compile(r'^/pubmed/(\d+)$') pmid = pattern.match(parse_result.path).group(1) return pmid
[ "def", "parse_pubmed_url", "(", "pubmed_url", ")", ":", "parse_result", "=", "urlparse", "(", "pubmed_url", ")", "pattern", "=", "re", ".", "compile", "(", "r'^/pubmed/(\\d+)$'", ")", "pmid", "=", "pattern", ".", "match", "(", "parse_result", ".", "path", ")", ".", "group", "(", "1", ")", "return", "pmid" ]
Get PubMed ID (pmid) from PubMed URL.
[ "Get", "PubMed", "ID", "(", "pmid", ")", "from", "PubMed", "URL", "." ]
b0aa2945b354f0945db73da22dd15ea628212da8
https://github.com/mfcovington/pubmed-lookup/blob/b0aa2945b354f0945db73da22dd15ea628212da8/pubmed_lookup/pubmed_lookup.py#L249-L254
train
Get PubMed ID from PubMed URL.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5Ku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Nqd1bagO6,QNQS9e6tJqMV,typojWN5Phrq,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b1101110 + 0o1) + '\062' + chr(53) + chr(50), 23086 - 23078), nzTpIcepk0o8(chr(1092 - 1044) + chr(3631 - 3520) + '\x31', 0b1000), nzTpIcepk0o8(chr(1225 - 1177) + chr(111) + chr(0b110101) + chr(0b100 + 0o60), 63708 - 63700), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1072 - 1021) + '\x33' + '\060', 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b10000 + 0o41) + chr(0b110001) + '\063', 0b1000), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(111) + chr(0b101111 + 0o5), 35700 - 35692), nzTpIcepk0o8('\060' + chr(11008 - 10897) + chr(59 - 8) + chr(50) + '\062', 8985 - 8977), nzTpIcepk0o8(chr(0b110000) + chr(2089 - 1978) + chr(0b110010) + '\065' + '\x30', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + chr(52) + '\060', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b111000 + 0o67) + '\063' + chr(53) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1010010 + 0o35) + '\062' + '\062' + chr(55), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(12258 - 12147) + chr(0b110010) + '\x31' + '\x34', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(50) + '\064' + '\067', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(49) + '\063' + chr(55), 16340 - 16332), nzTpIcepk0o8('\x30' + chr(0b1001000 + 0o47) + chr(0b110001) + '\061' + '\061', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b10000 + 0o137) + chr(51) + '\x30' + '\063', ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\061' + chr(967 - 912) + '\x30', 0o10), nzTpIcepk0o8('\060' + chr(0b110010 + 0o75) + '\061' + '\x36' + '\x36', 7455 - 7447), nzTpIcepk0o8(chr(1349 - 1301) + chr(0b101100 + 0o103) + '\062' + chr(0b110110) + chr(54), 0o10), nzTpIcepk0o8('\x30' + chr(0b11001 + 0o126) + chr(0b1000 + 0o55) + chr(48), 0o10), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(0b100001 + 0o116) + chr(0b101111 + 0o6) + chr(927 - 875), 8), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + chr(490 - 440) + chr(1106 - 1058), ord("\x08")), nzTpIcepk0o8(chr(1589 - 1541) + chr(0b1101111) + chr(51) + chr(0b110011) + chr(0b10001 + 0o46), 41887 - 41879), nzTpIcepk0o8('\x30' + chr(0b110101 + 0o72) + chr(50) + chr(1767 - 1718) + chr(52), 8), nzTpIcepk0o8('\x30' + '\157' + chr(374 - 320) + chr(847 - 799), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(4053 - 3942) + chr(0b110011) + chr(0b101101 + 0o12) + chr(494 - 441), 55868 - 55860), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + chr(0b11110 + 0o31) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(55 - 7) + chr(111) + chr(49) + chr(0b110101) + chr(0b110000), 32163 - 32155), nzTpIcepk0o8('\060' + chr(0b1101000 + 0o7) + chr(49) + chr(54) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b1010100 + 0o33) + '\063' + '\061' + chr(0b110000), 8652 - 8644), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b1011000 + 0o27) + '\062' + chr(0b11001 + 0o34) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b100011 + 0o15) + '\x6f' + '\x32' + chr(51) + chr(51), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(2395 - 2345) + chr(0b1011 + 0o46) + '\060', 17966 - 17958), nzTpIcepk0o8(chr(0b11101 + 0o23) + '\x6f' + '\063' + chr(0b10110 + 0o37) + chr(1964 - 1914), 11077 - 11069), nzTpIcepk0o8(chr(0b101001 + 0o7) + '\157' + chr(51) + '\x32' + '\x30', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\062' + '\063' + chr(0b11110 + 0o22), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(49) + '\x37' + '\062', 36871 - 36863), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + chr(0b1001 + 0o56) + chr(0b110011), 0b1000), nzTpIcepk0o8('\060' + chr(0b111101 + 0o62) + chr(0b110011) + chr(975 - 925) + chr(171 - 122), ord("\x08")), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(0b110011 + 0o74) + chr(49) + chr(624 - 569) + chr(0b101000 + 0o13), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\157' + '\x35' + chr(0b101010 + 0o6), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x84'), '\x64' + chr(0b1100101) + '\x63' + '\x6f' + '\x64' + '\145')('\165' + '\x74' + '\146' + '\055' + chr(1506 - 1450)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def Rvqmrm6bkc8X(psELeGPUG5Rg): YXAh2Tjy4eMP = cBkYfihkXwhl(psELeGPUG5Rg) UYtHA0XyNB9C = aoTc4YA2bs2R.compile(roI3spqORKae(ES5oEprVxulp(b'\xf4.\\\xad)i\xb7\xcc\xcf\xc7\xcb\xe8\x8cvm'), chr(0b1100100) + '\145' + '\143' + chr(0b1 + 0o156) + '\x64' + chr(0b1100101))(chr(0b111000 + 0o75) + chr(5684 - 5568) + '\146' + chr(1082 - 1037) + chr(0b110100 + 0o4))) aLRDdYW1VYTI = UYtHA0XyNB9C.match(YXAh2Tjy4eMP.path).F9lJ8RbIonqb(nzTpIcepk0o8('\x30' + chr(10439 - 10328) + chr(1522 - 1473), 8)) return aLRDdYW1VYTI
mfcovington/pubmed-lookup
pubmed_lookup/pubmed_lookup.py
PubMedLookup.get_pubmed_record
def get_pubmed_record(pmid): """Get PubMed record from PubMed ID.""" handle = Entrez.esummary(db="pubmed", id=pmid) record = Entrez.read(handle) return record
python
def get_pubmed_record(pmid): """Get PubMed record from PubMed ID.""" handle = Entrez.esummary(db="pubmed", id=pmid) record = Entrez.read(handle) return record
[ "def", "get_pubmed_record", "(", "pmid", ")", ":", "handle", "=", "Entrez", ".", "esummary", "(", "db", "=", "\"pubmed\"", ",", "id", "=", "pmid", ")", "record", "=", "Entrez", ".", "read", "(", "handle", ")", "return", "record" ]
Get PubMed record from PubMed ID.
[ "Get", "PubMed", "record", "from", "PubMed", "ID", "." ]
b0aa2945b354f0945db73da22dd15ea628212da8
https://github.com/mfcovington/pubmed-lookup/blob/b0aa2945b354f0945db73da22dd15ea628212da8/pubmed_lookup/pubmed_lookup.py#L257-L261
train
Get PubMed record from PubMed ID.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqf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7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + '\157' + '\x31' + chr(53) + chr(1131 - 1077), ord("\x08")), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(2498 - 2387) + chr(49) + '\065' + chr(55), 44360 - 44352), nzTpIcepk0o8(chr(1804 - 1756) + chr(111) + '\061' + chr(0b101101 + 0o7) + chr(2277 - 2226), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\x37' + '\065', 0o10), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + '\061' + chr(54) + '\066', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + '\x35' + chr(54), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(1409 - 1360) + '\062' + '\061', 0o10), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(0b110100 + 0o73) + '\x36' + chr(0b110011), 30555 - 30547), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(49) + '\066' + chr(159 - 109), 0o10), nzTpIcepk0o8('\x30' + chr(0b100001 + 0o116) + chr(0b110001) + chr(54) + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(870 - 822) + '\x6f' + chr(397 - 347) + chr(0b100 + 0o56) + '\061', ord("\x08")), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b1010010 + 0o35) + chr(0b110010) + '\x32', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110001) + chr(0b110100) + chr(0b110101), 24958 - 24950), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(838 - 788) + chr(0b110010) + chr(0b111 + 0o52), 8), nzTpIcepk0o8('\060' + '\157' + chr(49) + chr(455 - 406) + '\061', 4964 - 4956), nzTpIcepk0o8(chr(556 - 508) + '\x6f' + '\x32' + '\066' + chr(698 - 643), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(51) + chr(0b100101 + 0o14) + chr(1691 - 1642), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(8383 - 8272) + chr(1105 - 1051) + '\061', 0b1000), nzTpIcepk0o8('\x30' + chr(10351 - 10240) + chr(0b100 + 0o55) + chr(54) + chr(0b10100 + 0o37), 8), nzTpIcepk0o8(chr(692 - 644) + chr(0b100011 + 0o114) + chr(1139 - 1089) + '\064' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b10010 + 0o135) + chr(0b1 + 0o62) + chr(0b101011 + 0o10) + chr(0b110 + 0o57), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(0b11100 + 0o25) + chr(0b1101 + 0o43) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1471 - 1422) + '\x31', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\063' + chr(51) + chr(2745 - 2690), 0o10), nzTpIcepk0o8(chr(1276 - 1228) + chr(111) + chr(2088 - 2035) + '\x35', 0b1000), nzTpIcepk0o8(chr(1633 - 1585) + chr(111) + chr(864 - 815) + '\065' + '\060', 0o10), nzTpIcepk0o8(chr(48) + chr(1354 - 1243) + chr(0b110011) + chr(54) + chr(50), 50424 - 50416), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110010) + '\x30' + chr(585 - 530), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b101001 + 0o106) + chr(1521 - 1470) + '\x32' + chr(451 - 401), 0b1000), nzTpIcepk0o8(chr(0b110000 + 0o0) + '\157' + chr(55) + chr(2401 - 2352), ord("\x08")), nzTpIcepk0o8('\060' + chr(8321 - 8210) + chr(0b110010) + chr(52) + '\x34', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\067' + chr(0b110100), 62574 - 62566), nzTpIcepk0o8(chr(48) + chr(9619 - 9508) + chr(0b110011 + 0o0) + chr(717 - 665) + '\x36', 0o10), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(1877 - 1766) + '\x31' + chr(54) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1831 - 1779), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(1294 - 1239) + chr(52), 8), nzTpIcepk0o8('\060' + chr(111) + '\063' + chr(0b110010 + 0o1) + chr(52), 0b1000), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b101111 + 0o100) + chr(50) + '\065' + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(533 - 485) + '\157' + '\063' + chr(0b110101) + chr(0b11111 + 0o23), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b1000 + 0o51) + '\x35' + chr(48), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(5770 - 5659) + chr(0b1110 + 0o47) + chr(48), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'@'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1101001 + 0o6) + chr(100) + '\x65')(chr(10814 - 10697) + chr(4817 - 4701) + chr(4516 - 4414) + chr(0b100111 + 0o6) + chr(2058 - 2002)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def nqTfANgjGFsJ(aLRDdYW1VYTI): ecbIicWlHedY = gVPq6dQ3SE7m.esummary(db=roI3spqORKae(ES5oEprVxulp(b'\x1e\x1a\x01P\x13\x8a'), chr(8292 - 8192) + '\x65' + '\143' + chr(0b10011 + 0o134) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(116) + '\x66' + chr(45) + chr(56)), id=aLRDdYW1VYTI) etqFPAml7P5R = gVPq6dQ3SE7m.eoXknH7XUn7m(ecbIicWlHedY) return etqFPAml7P5R
UCSBarchlab/PyRTL
pyrtl/simulation.py
Simulation._initialize
def _initialize(self, register_value_map=None, memory_value_map=None, default_value=None): """ Sets the wire, register, and memory values to default or as specified. :param register_value_map: is a map of {Register: value}. :param memory_value_map: is a map of maps {Memory: {address: Value}}. :param default_value: is the value that all unspecified registers and memories will default to. If no default_value is specified, it will use the value stored in the object (default to 0) """ if default_value is None: default_value = self.default_value # set registers to their values reg_set = self.block.wirevector_subset(Register) if register_value_map is not None: for r in reg_set: self.value[r] = self.regvalue[r] = register_value_map.get(r, default_value) # set constants to their set values for w in self.block.wirevector_subset(Const): self.value[w] = w.val assert isinstance(w.val, numbers.Integral) # for now # set memories to their passed values for mem_net in self.block.logic_subset('m@'): memid = mem_net.op_param[1].id if memid not in self.memvalue: self.memvalue[memid] = {} if memory_value_map is not None: for (mem, mem_map) in memory_value_map.items(): if isinstance(mem, RomBlock): raise PyrtlError('error, one or more of the memories in the map is a RomBlock') if isinstance(self.block, PostSynthBlock): mem = self.block.mem_map[mem] # pylint: disable=maybe-no-member self.memvalue[mem.id] = mem_map max_addr_val, max_bit_val = 2**mem.addrwidth, 2**mem.bitwidth for (addr, val) in mem_map.items(): if addr < 0 or addr >= max_addr_val: raise PyrtlError('error, address %s in %s outside of bounds' % (str(addr), mem.name)) if val < 0 or val >= max_bit_val: raise PyrtlError('error, %s at %s in %s outside of bounds' % (str(val), str(addr), mem.name)) # set all other variables to default value for w in self.block.wirevector_set: if w not in self.value: self.value[w] = default_value self.ordered_nets = tuple((i for i in self.block)) self.reg_update_nets = tuple((self.block.logic_subset('r'))) self.mem_update_nets = tuple((self.block.logic_subset('@')))
python
def _initialize(self, register_value_map=None, memory_value_map=None, default_value=None): """ Sets the wire, register, and memory values to default or as specified. :param register_value_map: is a map of {Register: value}. :param memory_value_map: is a map of maps {Memory: {address: Value}}. :param default_value: is the value that all unspecified registers and memories will default to. If no default_value is specified, it will use the value stored in the object (default to 0) """ if default_value is None: default_value = self.default_value # set registers to their values reg_set = self.block.wirevector_subset(Register) if register_value_map is not None: for r in reg_set: self.value[r] = self.regvalue[r] = register_value_map.get(r, default_value) # set constants to their set values for w in self.block.wirevector_subset(Const): self.value[w] = w.val assert isinstance(w.val, numbers.Integral) # for now # set memories to their passed values for mem_net in self.block.logic_subset('m@'): memid = mem_net.op_param[1].id if memid not in self.memvalue: self.memvalue[memid] = {} if memory_value_map is not None: for (mem, mem_map) in memory_value_map.items(): if isinstance(mem, RomBlock): raise PyrtlError('error, one or more of the memories in the map is a RomBlock') if isinstance(self.block, PostSynthBlock): mem = self.block.mem_map[mem] # pylint: disable=maybe-no-member self.memvalue[mem.id] = mem_map max_addr_val, max_bit_val = 2**mem.addrwidth, 2**mem.bitwidth for (addr, val) in mem_map.items(): if addr < 0 or addr >= max_addr_val: raise PyrtlError('error, address %s in %s outside of bounds' % (str(addr), mem.name)) if val < 0 or val >= max_bit_val: raise PyrtlError('error, %s at %s in %s outside of bounds' % (str(val), str(addr), mem.name)) # set all other variables to default value for w in self.block.wirevector_set: if w not in self.value: self.value[w] = default_value self.ordered_nets = tuple((i for i in self.block)) self.reg_update_nets = tuple((self.block.logic_subset('r'))) self.mem_update_nets = tuple((self.block.logic_subset('@')))
[ "def", "_initialize", "(", "self", ",", "register_value_map", "=", "None", ",", "memory_value_map", "=", "None", ",", "default_value", "=", "None", ")", ":", "if", "default_value", "is", "None", ":", "default_value", "=", "self", ".", "default_value", "# set registers to their values", "reg_set", "=", "self", ".", "block", ".", "wirevector_subset", "(", "Register", ")", "if", "register_value_map", "is", "not", "None", ":", "for", "r", "in", "reg_set", ":", "self", ".", "value", "[", "r", "]", "=", "self", ".", "regvalue", "[", "r", "]", "=", "register_value_map", ".", "get", "(", "r", ",", "default_value", ")", "# set constants to their set values", "for", "w", "in", "self", ".", "block", ".", "wirevector_subset", "(", "Const", ")", ":", "self", ".", "value", "[", "w", "]", "=", "w", ".", "val", "assert", "isinstance", "(", "w", ".", "val", ",", "numbers", ".", "Integral", ")", "# for now", "# set memories to their passed values", "for", "mem_net", "in", "self", ".", "block", ".", "logic_subset", "(", "'m@'", ")", ":", "memid", "=", "mem_net", ".", "op_param", "[", "1", "]", ".", "id", "if", "memid", "not", "in", "self", ".", "memvalue", ":", "self", ".", "memvalue", "[", "memid", "]", "=", "{", "}", "if", "memory_value_map", "is", "not", "None", ":", "for", "(", "mem", ",", "mem_map", ")", "in", "memory_value_map", ".", "items", "(", ")", ":", "if", "isinstance", "(", "mem", ",", "RomBlock", ")", ":", "raise", "PyrtlError", "(", "'error, one or more of the memories in the map is a RomBlock'", ")", "if", "isinstance", "(", "self", ".", "block", ",", "PostSynthBlock", ")", ":", "mem", "=", "self", ".", "block", ".", "mem_map", "[", "mem", "]", "# pylint: disable=maybe-no-member", "self", ".", "memvalue", "[", "mem", ".", "id", "]", "=", "mem_map", "max_addr_val", ",", "max_bit_val", "=", "2", "**", "mem", ".", "addrwidth", ",", "2", "**", "mem", ".", "bitwidth", "for", "(", "addr", ",", "val", ")", "in", "mem_map", ".", "items", "(", ")", ":", "if", "addr", "<", "0", "or", "addr", ">=", "max_addr_val", ":", "raise", "PyrtlError", "(", "'error, address %s in %s outside of bounds'", "%", "(", "str", "(", "addr", ")", ",", "mem", ".", "name", ")", ")", "if", "val", "<", "0", "or", "val", ">=", "max_bit_val", ":", "raise", "PyrtlError", "(", "'error, %s at %s in %s outside of bounds'", "%", "(", "str", "(", "val", ")", ",", "str", "(", "addr", ")", ",", "mem", ".", "name", ")", ")", "# set all other variables to default value", "for", "w", "in", "self", ".", "block", ".", "wirevector_set", ":", "if", "w", "not", "in", "self", ".", "value", ":", "self", ".", "value", "[", "w", "]", "=", "default_value", "self", ".", "ordered_nets", "=", "tuple", "(", "(", "i", "for", "i", "in", "self", ".", "block", ")", ")", "self", ".", "reg_update_nets", "=", "tuple", "(", "(", "self", ".", "block", ".", "logic_subset", "(", "'r'", ")", ")", ")", "self", ".", "mem_update_nets", "=", "tuple", "(", "(", "self", ".", "block", ".", "logic_subset", "(", "'@'", ")", ")", ")" ]
Sets the wire, register, and memory values to default or as specified. :param register_value_map: is a map of {Register: value}. :param memory_value_map: is a map of maps {Memory: {address: Value}}. :param default_value: is the value that all unspecified registers and memories will default to. If no default_value is specified, it will use the value stored in the object (default to 0)
[ "Sets", "the", "wire", "register", "and", "memory", "values", "to", "default", "or", "as", "specified", "." ]
0988e5c9c10ededd5e1f58d5306603f9edf4b3e2
https://github.com/UCSBarchlab/PyRTL/blob/0988e5c9c10ededd5e1f58d5306603f9edf4b3e2/pyrtl/simulation.py#L96-L150
train
Initializes the internal state of the object.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHy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ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(0b1000111 + 0o50) + '\061' + '\x32' + '\065', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(11938 - 11827) + chr(1490 - 1441) + '\062' + chr(0b100100 + 0o21), 8), nzTpIcepk0o8(chr(322 - 274) + '\157' + chr(49) + chr(663 - 610) + '\x32', 0o10), nzTpIcepk0o8(chr(0b100101 + 0o13) + '\x6f' + chr(0b10000 + 0o41) + chr(51) + '\060', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\x36' + chr(0b110100), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110110) + chr(0b100001 + 0o22), 0o10), nzTpIcepk0o8('\060' + '\157' + '\x33' + '\x30' + chr(50), 0b1000), nzTpIcepk0o8(chr(0b10110 + 0o32) + '\x6f' + chr(0b110001) + chr(0b110100) + chr(53), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(9026 - 8915) + chr(652 - 602) + chr(53) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x33' + '\062' + '\x33', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(54) + '\x32', 0b1000), nzTpIcepk0o8('\x30' + chr(10113 - 10002) + chr(0b110010) + chr(0b1010 + 0o54) + chr(0b10 + 0o62), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + '\064' + '\061', 0o10), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(8931 - 8820) + '\061' + chr(1724 - 1669) + chr(0b1011 + 0o50), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(9307 - 9196) + chr(0b110011) + chr(2293 - 2242) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(111) + chr(54) + chr(84 - 34), 8), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(0b1101111) + '\063' + chr(0b110011 + 0o0) + chr(56 - 3), 7511 - 7503), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(111) + '\065' + chr(48), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(55) + chr(749 - 696), 0o10), nzTpIcepk0o8(chr(1977 - 1929) + chr(111) + chr(50) + chr(48) + chr(48), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(291 - 241) + chr(53) + chr(191 - 140), 62968 - 62960), nzTpIcepk0o8(chr(726 - 678) + '\x6f' + chr(50) + chr(404 - 350) + chr(0b110110), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(335 - 287), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b11011 + 0o26) + chr(0b110001) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(182 - 71) + '\062' + chr(2314 - 2265) + chr(0b11000 + 0o36), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\063' + '\065', 0b1000), nzTpIcepk0o8(chr(337 - 289) + '\157' + '\x31' + '\x37' + chr(0b101000 + 0o10), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + '\066', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + chr(0b110101) + '\x30', 28494 - 28486), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(111) + chr(0b100110 + 0o21) + chr(0b101000 + 0o17), 0b1000), nzTpIcepk0o8(chr(0b0 + 0o60) + '\x6f' + chr(0b100 + 0o55) + chr(0b101000 + 0o11) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(2077 - 1966) + chr(0b110010) + '\063' + chr(2070 - 2017), 0o10), nzTpIcepk0o8(chr(48) + chr(9843 - 9732) + chr(0b11000 + 0o36) + chr(53), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\x30', 8), nzTpIcepk0o8(chr(2079 - 2031) + chr(0b10110 + 0o131) + '\063' + '\x35' + chr(0b110110), 1213 - 1205), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + '\x33' + chr(1068 - 1020), 8), nzTpIcepk0o8(chr(0b110000) + chr(6023 - 5912) + '\062' + '\x34' + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\062' + chr(0b1011 + 0o52) + chr(1030 - 981), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(901 - 852) + chr(2402 - 2347) + '\x31', 0b1000), nzTpIcepk0o8(chr(243 - 195) + chr(0b1101111) + '\062' + chr(0b110011) + '\x31', 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(0b1011110 + 0o21) + '\065' + chr(0b110000), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'{'), '\144' + '\x65' + chr(5511 - 5412) + chr(0b1101111) + chr(6746 - 6646) + chr(0b111011 + 0o52))(chr(0b1100 + 0o151) + '\x74' + chr(0b110011 + 0o63) + '\x2d' + chr(56)) + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def T0nX9PKgSWX4(hXMPsSrOQzbh, hUdM6OU1UM10=None, ddUu1_0HSM4t=None, OIl7G5s1bcAz=None): if OIl7G5s1bcAz is None: OIl7G5s1bcAz = hXMPsSrOQzbh.default_value B5pWGzV135bA = hXMPsSrOQzbh.block.wirevector_subset(MZ8D3VXfw8Mg) if hUdM6OU1UM10 is not None: for LCrwg7lcbmU9 in B5pWGzV135bA: hXMPsSrOQzbh.uV9iBiw0y_Mp[LCrwg7lcbmU9] = hXMPsSrOQzbh.pXhTmxBdYPRm[LCrwg7lcbmU9] = hUdM6OU1UM10.GUKetu4xaGsJ(LCrwg7lcbmU9, OIl7G5s1bcAz) for sm7_CLmeWGR7 in roI3spqORKae(hXMPsSrOQzbh.block, roI3spqORKae(ES5oEprVxulp(b'"<\x18=BV\xa1\x11\xc2\xa1m\xc7\x94\x19\xacW\xa9'), chr(2322 - 2222) + chr(101) + '\x63' + chr(0b1101111) + chr(8767 - 8667) + '\x65')('\x75' + chr(10804 - 10688) + '\x66' + '\x2d' + chr(1015 - 959)))(U_XLWWgAbJha): hXMPsSrOQzbh.uV9iBiw0y_Mp[sm7_CLmeWGR7] = sm7_CLmeWGR7.pXwvT17vr09s assert suIjIS24Zkqw(roI3spqORKae(sm7_CLmeWGR7, roI3spqORKae(ES5oEprVxulp(b'%\r\x1d.`\x02\xf5\x13\xdf\xe3\x0b\xc7'), '\144' + '\x65' + chr(0b1100011) + chr(11225 - 11114) + '\144' + chr(101))(chr(7803 - 7686) + chr(0b11100 + 0o130) + chr(0b1100110) + chr(45) + chr(2998 - 2942))), roI3spqORKae(vlxREQkYI3ar, roI3spqORKae(ES5oEprVxulp(b'\x1c;\x1e=SA\xa3\t'), chr(0b1100100) + chr(5775 - 5674) + chr(3030 - 2931) + '\x6f' + chr(1824 - 1724) + '\145')('\x75' + chr(0b100011 + 0o121) + chr(0b1100110) + chr(1021 - 976) + chr(0b111000)))) for Uelh64aOA10Y in roI3spqORKae(hXMPsSrOQzbh.block, roI3spqORKae(ES5oEprVxulp(b'9:\r1Wl\xb1\x10\xcf\xa0W\xc0'), '\144' + chr(10039 - 9938) + '\143' + chr(1123 - 1012) + chr(0b1010001 + 0o23) + chr(1156 - 1055))(chr(0b1110101) + chr(0b1110100) + chr(0b100101 + 0o101) + chr(0b100000 + 0o15) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'8\x15'), chr(0b111111 + 0o45) + chr(0b1100101) + chr(5400 - 5301) + chr(0b11011 + 0o124) + '\x64' + '\145')(chr(117) + chr(116) + chr(3577 - 3475) + '\x2d' + chr(76 - 20))): yFfqgyMGDYZG = Uelh64aOA10Y.op_param[nzTpIcepk0o8(chr(777 - 729) + chr(2586 - 2475) + chr(49), 41883 - 41875)].maLnLg8O5zPT if yFfqgyMGDYZG not in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'80\x07.U_\xb7\x00'), chr(100) + '\145' + chr(99) + '\x6f' + '\x64' + chr(0b1011100 + 0o11))(chr(117) + '\x74' + chr(0b1100110) + chr(806 - 761) + chr(56))): hXMPsSrOQzbh.IA85_b5AmMdP[yFfqgyMGDYZG] = {} if ddUu1_0HSM4t is not None: for (cL0l0_aksf4i, DA8v2DUosDlX) in roI3spqORKae(ddUu1_0HSM4t, roI3spqORKae(ES5oEprVxulp(b'\x0c\n\x04\x16qI\x8aQ\x9e\xa5j\xdd'), chr(100) + '\145' + '\143' + chr(8809 - 8698) + '\x64' + chr(0b0 + 0o145))(chr(0b1110101) + '\164' + chr(0b111011 + 0o53) + chr(1885 - 1840) + chr(56)))(): if suIjIS24Zkqw(cL0l0_aksf4i, kTCvrSyZtzyH): raise cZ96N8MzPn1b(roI3spqORKae(ES5oEprVxulp(b"0'\x187F\x1f\xe2\n\xc3\xb6\x12\xdb\x93[\xb2]\xafM\x1d\xef\xcd\x96t%\xeb=\x15s\x85P;\xf4Ps\xce1\xc8\x89\r\xf10u\x079D\x13\xab\x16\x8d\xb2\x12\xe6\x8e\x16\x9d^\xb2KV"), chr(100) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(0b1011100 + 0o10) + chr(0b1100101))(chr(0b1000100 + 0o61) + chr(4854 - 4738) + chr(5491 - 5389) + chr(0b101101 + 0o0) + chr(0b111000))) if suIjIS24Zkqw(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x01#>hp\x01\xb0,\xea\x84\x07\xf5'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(111) + chr(100) + '\x65')('\x75' + chr(0b1011000 + 0o34) + '\146' + chr(45) + chr(0b111000))), z5SrK3IpuPYz): cL0l0_aksf4i = hXMPsSrOQzbh.block.mem_map[cL0l0_aksf4i] hXMPsSrOQzbh.IA85_b5AmMdP[cL0l0_aksf4i.maLnLg8O5zPT] = DA8v2DUosDlX (rMdSEVpM79w6, e2ITaGYTXwCL) = (nzTpIcepk0o8('\060' + '\157' + chr(0b0 + 0o62), 0o10) ** cL0l0_aksf4i.addrwidth, nzTpIcepk0o8('\060' + chr(111) + chr(0b110010), 8) ** cL0l0_aksf4i.bitwidth) for (_m0lLs6iTLa5, pXwvT17vr09s) in roI3spqORKae(DA8v2DUosDlX, roI3spqORKae(ES5oEprVxulp(b'\x0c\n\x04\x16qI\x8aQ\x9e\xa5j\xdd'), chr(875 - 775) + '\x65' + '\143' + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))('\165' + '\164' + chr(8799 - 8697) + chr(45) + '\070'))(): if _m0lLs6iTLa5 < nzTpIcepk0o8(chr(1424 - 1376) + chr(0b101011 + 0o104) + chr(0b10 + 0o56), 8) or _m0lLs6iTLa5 >= rMdSEVpM79w6: raise cZ96N8MzPn1b(roI3spqORKae(ES5oEprVxulp(b"0'\x187F\x1f\xe2\x04\xc9\xb7@\xd1\x92\x08\xff\x17\xae\x08T\xee\x8b\x93sm\xe1h\x0ce\x81[,\xbdZf\xce:\xc9\xdc\x17\xfd&"), chr(0b1100100) + chr(0b1101 + 0o130) + chr(0b1100011) + chr(111) + '\x64' + chr(0b110110 + 0o57))(chr(0b10010 + 0o143) + chr(0b1010011 + 0o41) + chr(0b10001 + 0o125) + chr(0b1001 + 0o44) + chr(0b101 + 0o63)) % (N9zlRy29S1SS(_m0lLs6iTLa5), roI3spqORKae(cL0l0_aksf4i, roI3spqORKae(ES5oEprVxulp(b'\x06\x19<\x1a\x06q\x92$\xf2\xbe{\xd1'), '\144' + chr(2354 - 2253) + chr(0b101011 + 0o70) + '\x6f' + '\x64' + chr(101))(chr(0b1110101) + chr(116) + '\146' + '\x2d' + '\070')))) if pXwvT17vr09s < nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(111) + chr(0b10010 + 0o36), 8) or pXwvT17vr09s >= e2ITaGYTXwCL: raise cZ96N8MzPn1b(roI3spqORKae(ES5oEprVxulp(b"0'\x187F\x1f\xe2@\xde\xf3S\xc0\xc1^\xac\x12\xb4F\x1d\xa5\xd8\x96o8\xfan\x11r\x8d\x1f&\xfb\x15b\x81-\xc8\xcd\n"), chr(100) + '\145' + '\x63' + '\157' + chr(1560 - 1460) + chr(9786 - 9685))('\x75' + chr(0b1110100) + chr(102) + chr(710 - 665) + chr(1449 - 1393)) % (N9zlRy29S1SS(pXwvT17vr09s), N9zlRy29S1SS(_m0lLs6iTLa5), roI3spqORKae(cL0l0_aksf4i, roI3spqORKae(ES5oEprVxulp(b'\x06\x19<\x1a\x06q\x92$\xf2\xbe{\xd1'), '\x64' + chr(0b1000001 + 0o44) + chr(99) + chr(4643 - 4532) + '\x64' + '\145')(chr(0b1110101) + '\164' + chr(0b10110 + 0o120) + '\x2d' + chr(0b100001 + 0o27))))) for sm7_CLmeWGR7 in roI3spqORKae(hXMPsSrOQzbh.block, roI3spqORKae(ES5oEprVxulp(b'"<\x18=BV\xa1\x11\xc2\xa1m\xc7\x84\x0f'), chr(100) + '\145' + chr(99) + chr(111) + '\x64' + chr(101))(chr(0b1110101) + chr(116) + chr(324 - 222) + chr(0b1001 + 0o44) + '\070')): if sm7_CLmeWGR7 not in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b' \x03S1vZ\xb5U\xd4\x8c\x7f\xc4'), chr(2939 - 2839) + chr(0b101111 + 0o66) + chr(99) + chr(111) + chr(0b1100100) + chr(101))('\165' + '\x74' + chr(2074 - 1972) + chr(45) + chr(0b111000))): hXMPsSrOQzbh.uV9iBiw0y_Mp[sm7_CLmeWGR7] = OIl7G5s1bcAz hXMPsSrOQzbh.fdZ9JtP6f10b = nfNqtJL5aRaY((ZlbFMSG8gCoF for ZlbFMSG8gCoF in hXMPsSrOQzbh.TvT0D2rIGW5A)) hXMPsSrOQzbh.Nc_yjr0nrE9d = nfNqtJL5aRaY(hXMPsSrOQzbh.block.logic_subset(roI3spqORKae(ES5oEprVxulp(b"'"), chr(100) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(3651 - 3551) + chr(101))('\x75' + chr(0b1110100) + chr(0b1100110) + '\055' + chr(56)))) hXMPsSrOQzbh.MvrhizCh3Gyf = nfNqtJL5aRaY(hXMPsSrOQzbh.block.logic_subset(roI3spqORKae(ES5oEprVxulp(b'\x15'), chr(0b1000000 + 0o44) + '\x65' + '\143' + chr(111) + chr(0b1110 + 0o126) + chr(101))(chr(0b1110101) + '\x74' + chr(102) + chr(0b101101) + chr(0b1001 + 0o57))))
UCSBarchlab/PyRTL
pyrtl/simulation.py
Simulation.step
def step(self, provided_inputs): """ Take the simulation forward one cycle :param provided_inputs: a dictionary mapping wirevectors to their values for this step All input wires must be in the provided_inputs in order for the simulation to accept these values Example: if we have inputs named 'a' and 'x', we can call: sim.step({'a': 1, 'x': 23}) to simulate a cycle with values 1 and 23 respectively """ # Check that all Input have a corresponding provided_input input_set = self.block.wirevector_subset(Input) supplied_inputs = set() for i in provided_inputs: if isinstance(i, WireVector): name = i.name else: name = i sim_wire = self.block.wirevector_by_name[name] if sim_wire not in input_set: raise PyrtlError( 'step provided a value for input for "%s" which is ' 'not a known input ' % name) if not isinstance(provided_inputs[i], numbers.Integral) or provided_inputs[i] < 0: raise PyrtlError( 'step provided an input "%s" which is not a valid ' 'positive integer' % provided_inputs[i]) if len(bin(provided_inputs[i]))-2 > sim_wire.bitwidth: raise PyrtlError( 'the bitwidth for "%s" is %d, but the provided input ' '%d requires %d bits to represent' % (name, sim_wire.bitwidth, provided_inputs[i], len(bin(provided_inputs[i]))-2)) self.value[sim_wire] = provided_inputs[i] supplied_inputs.add(sim_wire) # Check that only inputs are specified, and set the values if input_set != supplied_inputs: for i in input_set.difference(supplied_inputs): raise PyrtlError('Input "%s" has no input value specified' % i.name) self.value.update(self.regvalue) # apply register updates from previous step for net in self.ordered_nets: self._execute(net) # Do all of the mem operations based off the new values changed in _execute() for net in self.mem_update_nets: self._mem_update(net) # at the end of the step, record the values to the trace # print self.value # Helpful Debug Print if self.tracer is not None: self.tracer.add_step(self.value) # Do all of the reg updates based off of the new values for net in self.reg_update_nets: argval = self.value[net.args[0]] self.regvalue[net.dests[0]] = self._sanitize(argval, net.dests[0]) # finally, if any of the rtl_assert assertions are failing then we should # raise the appropriate exceptions check_rtl_assertions(self)
python
def step(self, provided_inputs): """ Take the simulation forward one cycle :param provided_inputs: a dictionary mapping wirevectors to their values for this step All input wires must be in the provided_inputs in order for the simulation to accept these values Example: if we have inputs named 'a' and 'x', we can call: sim.step({'a': 1, 'x': 23}) to simulate a cycle with values 1 and 23 respectively """ # Check that all Input have a corresponding provided_input input_set = self.block.wirevector_subset(Input) supplied_inputs = set() for i in provided_inputs: if isinstance(i, WireVector): name = i.name else: name = i sim_wire = self.block.wirevector_by_name[name] if sim_wire not in input_set: raise PyrtlError( 'step provided a value for input for "%s" which is ' 'not a known input ' % name) if not isinstance(provided_inputs[i], numbers.Integral) or provided_inputs[i] < 0: raise PyrtlError( 'step provided an input "%s" which is not a valid ' 'positive integer' % provided_inputs[i]) if len(bin(provided_inputs[i]))-2 > sim_wire.bitwidth: raise PyrtlError( 'the bitwidth for "%s" is %d, but the provided input ' '%d requires %d bits to represent' % (name, sim_wire.bitwidth, provided_inputs[i], len(bin(provided_inputs[i]))-2)) self.value[sim_wire] = provided_inputs[i] supplied_inputs.add(sim_wire) # Check that only inputs are specified, and set the values if input_set != supplied_inputs: for i in input_set.difference(supplied_inputs): raise PyrtlError('Input "%s" has no input value specified' % i.name) self.value.update(self.regvalue) # apply register updates from previous step for net in self.ordered_nets: self._execute(net) # Do all of the mem operations based off the new values changed in _execute() for net in self.mem_update_nets: self._mem_update(net) # at the end of the step, record the values to the trace # print self.value # Helpful Debug Print if self.tracer is not None: self.tracer.add_step(self.value) # Do all of the reg updates based off of the new values for net in self.reg_update_nets: argval = self.value[net.args[0]] self.regvalue[net.dests[0]] = self._sanitize(argval, net.dests[0]) # finally, if any of the rtl_assert assertions are failing then we should # raise the appropriate exceptions check_rtl_assertions(self)
[ "def", "step", "(", "self", ",", "provided_inputs", ")", ":", "# Check that all Input have a corresponding provided_input", "input_set", "=", "self", ".", "block", ".", "wirevector_subset", "(", "Input", ")", "supplied_inputs", "=", "set", "(", ")", "for", "i", "in", "provided_inputs", ":", "if", "isinstance", "(", "i", ",", "WireVector", ")", ":", "name", "=", "i", ".", "name", "else", ":", "name", "=", "i", "sim_wire", "=", "self", ".", "block", ".", "wirevector_by_name", "[", "name", "]", "if", "sim_wire", "not", "in", "input_set", ":", "raise", "PyrtlError", "(", "'step provided a value for input for \"%s\" which is '", "'not a known input '", "%", "name", ")", "if", "not", "isinstance", "(", "provided_inputs", "[", "i", "]", ",", "numbers", ".", "Integral", ")", "or", "provided_inputs", "[", "i", "]", "<", "0", ":", "raise", "PyrtlError", "(", "'step provided an input \"%s\" which is not a valid '", "'positive integer'", "%", "provided_inputs", "[", "i", "]", ")", "if", "len", "(", "bin", "(", "provided_inputs", "[", "i", "]", ")", ")", "-", "2", ">", "sim_wire", ".", "bitwidth", ":", "raise", "PyrtlError", "(", "'the bitwidth for \"%s\" is %d, but the provided input '", "'%d requires %d bits to represent'", "%", "(", "name", ",", "sim_wire", ".", "bitwidth", ",", "provided_inputs", "[", "i", "]", ",", "len", "(", "bin", "(", "provided_inputs", "[", "i", "]", ")", ")", "-", "2", ")", ")", "self", ".", "value", "[", "sim_wire", "]", "=", "provided_inputs", "[", "i", "]", "supplied_inputs", ".", "add", "(", "sim_wire", ")", "# Check that only inputs are specified, and set the values", "if", "input_set", "!=", "supplied_inputs", ":", "for", "i", "in", "input_set", ".", "difference", "(", "supplied_inputs", ")", ":", "raise", "PyrtlError", "(", "'Input \"%s\" has no input value specified'", "%", "i", ".", "name", ")", "self", ".", "value", ".", "update", "(", "self", ".", "regvalue", ")", "# apply register updates from previous step", "for", "net", "in", "self", ".", "ordered_nets", ":", "self", ".", "_execute", "(", "net", ")", "# Do all of the mem operations based off the new values changed in _execute()", "for", "net", "in", "self", ".", "mem_update_nets", ":", "self", ".", "_mem_update", "(", "net", ")", "# at the end of the step, record the values to the trace", "# print self.value # Helpful Debug Print", "if", "self", ".", "tracer", "is", "not", "None", ":", "self", ".", "tracer", ".", "add_step", "(", "self", ".", "value", ")", "# Do all of the reg updates based off of the new values", "for", "net", "in", "self", ".", "reg_update_nets", ":", "argval", "=", "self", ".", "value", "[", "net", ".", "args", "[", "0", "]", "]", "self", ".", "regvalue", "[", "net", ".", "dests", "[", "0", "]", "]", "=", "self", ".", "_sanitize", "(", "argval", ",", "net", ".", "dests", "[", "0", "]", ")", "# finally, if any of the rtl_assert assertions are failing then we should", "# raise the appropriate exceptions", "check_rtl_assertions", "(", "self", ")" ]
Take the simulation forward one cycle :param provided_inputs: a dictionary mapping wirevectors to their values for this step All input wires must be in the provided_inputs in order for the simulation to accept these values Example: if we have inputs named 'a' and 'x', we can call: sim.step({'a': 1, 'x': 23}) to simulate a cycle with values 1 and 23 respectively
[ "Take", "the", "simulation", "forward", "one", "cycle" ]
0988e5c9c10ededd5e1f58d5306603f9edf4b3e2
https://github.com/UCSBarchlab/PyRTL/blob/0988e5c9c10ededd5e1f58d5306603f9edf4b3e2/pyrtl/simulation.py#L152-L218
train
Take the simulation forward one cycle and set the value of the current value of the next wire.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,g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zQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=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__ ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + '\157' + '\x31' + chr(53) + '\066', 0o10), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(111) + chr(0b101010 + 0o10) + '\064' + chr(440 - 391), 0b1000), nzTpIcepk0o8(chr(173 - 125) + chr(3089 - 2978) + chr(1870 - 1820) + chr(0b101000 + 0o16) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(1519 - 1471) + '\157' + '\x32' + chr(0b110101) + chr(0b10011 + 0o41), 27449 - 27441), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(0b1101111) + '\062' + '\x35' + '\x33', 0o10), nzTpIcepk0o8(chr(1768 - 1720) + chr(111) + '\x31' + chr(0b110001) + '\x31', 50869 - 50861), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(2212 - 2162) + chr(2266 - 2218) + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(1097 - 1049) + chr(7455 - 7344) + '\x32' + '\066' + chr(51), 20632 - 20624), nzTpIcepk0o8(chr(0b110000) + chr(0b111111 + 0o60) + chr(0b110011) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b10111 + 0o31) + '\x6f' + '\x31' + '\064', 0o10), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(111) + chr(0b110001) + chr(54) + chr(52), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(49) + chr(0b110011) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b100001 + 0o17) + '\x6f' + '\062' + chr(2636 - 2583) + chr(1093 - 1045), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(55) + chr(2426 - 2373), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1010110 + 0o31) + chr(2144 - 2095) + '\062' + chr(54), 0b1000), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(2069 - 1958) + chr(0b110010) + chr(0b110100), 0b1000), nzTpIcepk0o8('\060' + chr(0b1001111 + 0o40) + chr(0b110010) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(0b100010 + 0o115) + chr(0b11010 + 0o31) + chr(1071 - 1023), 8), nzTpIcepk0o8('\x30' + '\x6f' + '\062' + chr(0b110110) + '\063', 8), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(111) + chr(0b110010) + chr(0b101110 + 0o5) + chr(2006 - 1955), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110001) + '\x37' + '\063', 2436 - 2428), nzTpIcepk0o8(chr(2296 - 2248) + chr(0b1101111) + chr(50) + chr(0b10101 + 0o33) + chr(0b10000 + 0o46), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(0b110111) + chr(0b10111 + 0o34), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(0b100111 + 0o14) + chr(374 - 321), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b10 + 0o155) + chr(0b10000 + 0o45) + '\062', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(51) + chr(0b110100) + '\061', 25324 - 25316), nzTpIcepk0o8(chr(2141 - 2093) + '\157' + chr(49) + '\064' + chr(50), 0o10), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\157' + '\x31' + chr(0b110100) + '\x34', 28278 - 28270), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x31' + chr(651 - 601) + chr(0b100010 + 0o20), 5940 - 5932), nzTpIcepk0o8(chr(953 - 905) + '\x6f' + '\x36' + chr(2732 - 2677), 23322 - 23314), nzTpIcepk0o8(chr(1428 - 1380) + chr(111) + '\x31' + '\062' + chr(0b100001 + 0o22), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(51) + chr(0b11000 + 0o37) + chr(55), 46300 - 46292), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(200 - 149) + chr(55) + '\063', ord("\x08")), nzTpIcepk0o8(chr(1530 - 1482) + chr(111) + chr(0b110011) + chr(0b110000) + chr(1140 - 1088), 0o10), nzTpIcepk0o8(chr(0b110 + 0o52) + chr(0b1101111) + '\x31' + '\x32' + chr(0b11011 + 0o31), 0b1000), nzTpIcepk0o8(chr(1848 - 1800) + chr(10393 - 10282) + chr(991 - 941) + chr(0b110010) + '\062', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(825 - 775) + '\060' + chr(0b110000), 0o10), nzTpIcepk0o8('\x30' + chr(10399 - 10288) + chr(1467 - 1418) + chr(0b10101 + 0o41), 48784 - 48776), nzTpIcepk0o8('\x30' + chr(0b111001 + 0o66) + '\x32' + chr(0b110001 + 0o3) + chr(0b10100 + 0o36), 22788 - 22780), nzTpIcepk0o8('\060' + chr(111) + chr(50) + chr(598 - 550) + '\x32', 29630 - 29622)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(99 - 51) + '\157' + chr(53) + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)]) def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J): try: return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'@'), chr(100) + '\x65' + '\143' + '\157' + chr(0b11011 + 0o111) + '\x65')('\x75' + chr(116) + chr(0b1100110) + chr(0b101101) + '\070') + pXRQUD7VR93J) except fPFTJxVnGShv: return zGgTE_CdZfvi(pOp6HxxfV61L) def ZiKB99Xs91Lo(hXMPsSrOQzbh, CPmaQQFYxObb): SkVAAihbpfDu = hXMPsSrOQzbh.block.wirevector_subset(KM7OV44bHlPg) eGDY7edQM5Zh = Bvi71nNyvlqO() for ZlbFMSG8gCoF in CPmaQQFYxObb: if suIjIS24Zkqw(ZlbFMSG8gCoF, hBqSj3R2EjDG): SLVB2BPA_mIe = ZlbFMSG8gCoF.SLVB2BPA_mIe else: SLVB2BPA_mIe = ZlbFMSG8gCoF Pc_pkaTRpeop = hXMPsSrOQzbh.block.wirevector_by_name[SLVB2BPA_mIe] if Pc_pkaTRpeop not in SkVAAihbpfDu: raise cZ96N8MzPn1b(roI3spqORKae(ES5oEprVxulp(b'\x1d\xd5\xd0\xdc\x8b9\xf5\xdcne\x109\xcc\x1d74`y\xdf\xee\x1e\xa6\xdd2X\xc1\x0b\n"B\'\xdf\x9d\xab&\xb2\xa2+\xd1\xa0N\xd6\xdd\xc5\xc8!\xa7\xdak,\x1a3\xdc\x1d74}v\xdc\xec\x15\xa6\xd23Z\x94\x16D'), chr(0b10 + 0o142) + '\145' + chr(99) + chr(0b110111 + 0o70) + chr(100) + chr(101))(chr(0b1110101) + '\x74' + '\x66' + '\055' + '\x38') % SLVB2BPA_mIe) if not suIjIS24Zkqw(CPmaQQFYxObb[ZlbFMSG8gCoF], roI3spqORKae(vlxREQkYI3ar, roI3spqORKae(ES5oEprVxulp(b"'\xcf\xc1\xc9\xcc;\xe6\xdf"), '\144' + '\145' + '\x63' + chr(111) + '\144' + chr(101))('\x75' + '\x74' + chr(0b1100110) + '\x2d' + chr(0b111000)))) or CPmaQQFYxObb[ZlbFMSG8gCoF] < nzTpIcepk0o8(chr(0b110000) + chr(1798 - 1687) + chr(100 - 52), 0b1000): raise cZ96N8MzPn1b(roI3spqORKae(ES5oEprVxulp(b'\x1d\xd5\xd0\xdc\x8b9\xf5\xdcne\x109\xcc\x1d7z6q\xdd\xeb\x0e\xf2\x9b\x7f\x0f\x92@D%_:\x9c\x93\xe4=\xe1\xa0`\xcd\xf6N\xc0\x95\xda\xca%\xee\xd78|\x1b/\xc1I?bs8\xda\xf5\x0f\xe3\xdc8X'), chr(0b100011 + 0o101) + chr(0b1100101) + chr(5462 - 5363) + chr(0b1101111) + chr(0b101101 + 0o67) + '\x65')('\x75' + chr(0b1110100) + chr(0b101100 + 0o72) + chr(0b101100 + 0o1) + chr(56)) % CPmaQQFYxObb[ZlbFMSG8gCoF]) if ftfygxgFas5X(fBqfYi7uj_uC(CPmaQQFYxObb[ZlbFMSG8gCoF])) - nzTpIcepk0o8(chr(0b1010 + 0o46) + '\157' + '\062', 0b1000) > roI3spqORKae(Pc_pkaTRpeop, roI3spqORKae(ES5oEprVxulp(b'\x0c\xc8\xc1\xdb\xc2-\xf3\xdb'), '\x64' + chr(101) + chr(0b10011 + 0o120) + chr(0b1101111) + chr(9720 - 9620) + chr(0b1000011 + 0o42))(chr(0b1 + 0o164) + '\164' + chr(0b1100110) + chr(0b10111 + 0o26) + chr(56))): raise cZ96N8MzPn1b(roI3spqORKae(ES5oEprVxulp(b'\x1a\xc9\xd0\x8c\xc9 \xf3\xc4qh\x004\x88[9f6:\x96\xe8Y\xa6\xd2.\n\xc4\x06HrU&\x8b\xdb\xb0<\xf7\xa0~\xd0\xed\x18\xc8\xd1\xc9\xcfi\xee\xddhy\x00|\x8dYvfsi\xc6\xf2\t\xe3\xc8}\x0f\x85B\x06;C \xdf\x8f\xabt\xe0\xe5~\xd0\xe7\x1d\xc4\xdb\xd8'), chr(100) + chr(8843 - 8742) + chr(0b1100 + 0o127) + chr(0b1101111) + '\x64' + chr(101))(chr(117) + chr(8118 - 8002) + chr(0b11000 + 0o116) + '\055' + chr(0b111000)) % (SLVB2BPA_mIe, roI3spqORKae(Pc_pkaTRpeop, roI3spqORKae(ES5oEprVxulp(b'\x0c\xc8\xc1\xdb\xc2-\xf3\xdb'), '\144' + '\x65' + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))('\165' + chr(116) + chr(9090 - 8988) + '\055' + chr(667 - 611))), CPmaQQFYxObb[ZlbFMSG8gCoF], ftfygxgFas5X(fBqfYi7uj_uC(CPmaQQFYxObb[ZlbFMSG8gCoF])) - nzTpIcepk0o8('\x30' + chr(111) + chr(0b11100 + 0o26), 8))) hXMPsSrOQzbh.uV9iBiw0y_Mp[Pc_pkaTRpeop] = CPmaQQFYxObb[ZlbFMSG8gCoF] roI3spqORKae(eGDY7edQM5Zh, roI3spqORKae(ES5oEprVxulp(b'\x1b\x92\xe4\xc8\xc2:\xce\xc2\\j78'), chr(2566 - 2466) + chr(7966 - 7865) + chr(99) + '\x6f' + chr(0b10010 + 0o122) + '\145')('\x75' + chr(0b1100010 + 0o22) + '\x66' + '\x2d' + chr(56)))(Pc_pkaTRpeop) if SkVAAihbpfDu != eGDY7edQM5Zh: for ZlbFMSG8gCoF in roI3spqORKae(SkVAAihbpfDu, roI3spqORKae(ES5oEprVxulp(b'\n\xc8\xd3\xca\xce;\xe2\xdd{i'), chr(3682 - 3582) + chr(0b111111 + 0o46) + chr(0b1100011) + '\157' + '\x64' + '\145')('\x75' + chr(0b1110100) + '\146' + '\055' + '\x38'))(eGDY7edQM5Zh): raise cZ96N8MzPn1b(roI3spqORKae(ES5oEprVxulp(b"'\xcf\xc5\xd9\xdfi\xa5\x96k.T4\xc9Nvzy8\xda\xf5\x0b\xf3\xcf}\\\x80\x0e\x117\x17 \x8f\x9e\xa7=\xf4\xe9k\xc6"), chr(100) + '\x65' + chr(99) + chr(0b110100 + 0o73) + chr(0b1100100) + '\x65')(chr(0b1110101) + '\164' + '\146' + '\055' + chr(0b1101 + 0o53)) % roI3spqORKae(ZlbFMSG8gCoF, roI3spqORKae(ES5oEprVxulp(b'=\xed\xe3\xee\x99\x0b\xd7\xf2Ga=9'), chr(9739 - 9639) + '\x65' + chr(99) + chr(0b11001 + 0o126) + chr(673 - 573) + chr(10123 - 10022))(chr(9669 - 9552) + '\164' + chr(0b10 + 0o144) + chr(0b11010 + 0o23) + chr(0b100001 + 0o27)))) roI3spqORKae(hXMPsSrOQzbh.value, roI3spqORKae(ES5oEprVxulp(b'$\xfe\xde\x9e\xe2\x10\xc5\x82{i\x052'), chr(0b1100100) + chr(0b1001001 + 0o34) + '\x63' + '\157' + '\x64' + chr(101))(chr(117) + chr(0b1110100) + '\x66' + chr(1039 - 994) + '\x38'))(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x1e\xf9\xdd\xf8\xc61\xc5\xd7A\\&1'), chr(0b1100100) + chr(101) + chr(4272 - 4173) + '\157' + '\144' + chr(0b110101 + 0o60))(chr(117) + '\x74' + chr(0b1100110) + '\x2d' + chr(0b111000)))) for AGZr9pNUmyNf in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x08\xc5\xef\x95\xe1=\xd7\x85~=D>'), chr(9623 - 9523) + chr(101) + '\x63' + chr(0b111101 + 0o62) + chr(100) + chr(6905 - 6804))(chr(0b1110010 + 0o3) + '\x74' + '\x66' + chr(869 - 824) + chr(903 - 847))): roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x0f\xca\xf9\xc3\xc6z\xe8\xd4/<0-'), chr(0b100000 + 0o104) + chr(0b1100101) + '\x63' + chr(0b1000111 + 0o50) + chr(0b1011111 + 0o5) + chr(0b11110 + 0o107))(chr(117) + chr(6684 - 6568) + chr(102) + chr(1844 - 1799) + chr(0b111000)))(AGZr9pNUmyNf) for AGZr9pNUmyNf in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'#\xd7\xc7\xc4\xc23\xc4\xdb+K\r:'), '\144' + chr(0b1100101) + '\143' + '\157' + '\144' + '\145')(chr(117) + chr(8669 - 8553) + '\146' + '\x2d' + chr(0b10100 + 0o44))): roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'1\xcc\xd0\xc1\xf4<\xf7\xd7yx\x11'), chr(0b10010 + 0o122) + '\x65' + '\143' + '\x6f' + chr(0b1010101 + 0o17) + chr(0b1011011 + 0o12))(chr(117) + chr(116) + chr(8779 - 8677) + '\x2d' + chr(78 - 22)))(AGZr9pNUmyNf) if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x1a\xd3\xd4\xcf\xce;'), '\x64' + '\x65' + chr(99) + chr(1623 - 1512) + chr(5837 - 5737) + '\145')('\x75' + '\164' + chr(0b100010 + 0o104) + chr(0b10100 + 0o31) + chr(0b111000))) is not None: roI3spqORKae(hXMPsSrOQzbh.tracer, roI3spqORKae(ES5oEprVxulp(b'\x0f\xc5\xd1\xf3\xd8=\xe2\xc3'), '\x64' + '\145' + '\x63' + chr(0b11010 + 0o125) + chr(0b1010101 + 0o17) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(793 - 691) + '\055' + chr(0b100000 + 0o30)))(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x1b\xf7\x8c\xc5\xe9 \xf0\x83aS9,'), chr(740 - 640) + chr(101) + chr(99) + chr(111) + chr(100) + chr(101))('\x75' + '\x74' + chr(5007 - 4905) + chr(0b1010 + 0o43) + '\070'))) for AGZr9pNUmyNf in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b' \xc2\xea\xd5\xc1;\xb7\xddjIM8'), chr(8749 - 8649) + '\145' + '\x63' + '\157' + '\144' + chr(0b1100101))('\x75' + chr(116) + '\x66' + chr(0b101101) + chr(0b11110 + 0o32))): LHCLDSZ9ypt0 = hXMPsSrOQzbh.uV9iBiw0y_Mp[AGZr9pNUmyNf.eemPYp2vtTSr[nzTpIcepk0o8(chr(0b10001 + 0o37) + '\x6f' + chr(48), 8)]] hXMPsSrOQzbh.pXhTmxBdYPRm[AGZr9pNUmyNf.o4OsHEFLyv24[nzTpIcepk0o8('\060' + '\157' + '\x30', 8)]] = hXMPsSrOQzbh._sanitize(LHCLDSZ9ypt0, AGZr9pNUmyNf.o4OsHEFLyv24[nzTpIcepk0o8('\060' + chr(0b101101 + 0o102) + chr(0b101 + 0o53), 8)]) il9W9Ydc0xZm(hXMPsSrOQzbh)