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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
quantopian/zipline
|
zipline/utils/functional.py
|
unzip
|
def unzip(seq, elem_len=None):
"""Unzip a length n sequence of length m sequences into m seperate length
n sequences.
Parameters
----------
seq : iterable[iterable]
The sequence to unzip.
elem_len : int, optional
The expected length of each element of ``seq``. If not provided this
will be infered from the length of the first element of ``seq``. This
can be used to ensure that code like: ``a, b = unzip(seq)`` does not
fail even when ``seq`` is empty.
Returns
-------
seqs : iterable[iterable]
The new sequences pulled out of the first iterable.
Raises
------
ValueError
Raised when ``seq`` is empty and ``elem_len`` is not provided.
Raised when elements of ``seq`` do not match the given ``elem_len`` or
the length of the first element of ``seq``.
Examples
--------
>>> seq = [('a', 1), ('b', 2), ('c', 3)]
>>> cs, ns = unzip(seq)
>>> cs
('a', 'b', 'c')
>>> ns
(1, 2, 3)
# checks that the elements are the same length
>>> seq = [('a', 1), ('b', 2), ('c', 3, 'extra')]
>>> cs, ns = unzip(seq)
Traceback (most recent call last):
...
ValueError: element at index 2 was length 3, expected 2
# allows an explicit element length instead of infering
>>> seq = [('a', 1, 'extra'), ('b', 2), ('c', 3)]
>>> cs, ns = unzip(seq, 2)
Traceback (most recent call last):
...
ValueError: element at index 0 was length 3, expected 2
# handles empty sequences when a length is given
>>> cs, ns = unzip([], elem_len=2)
>>> cs == ns == ()
True
Notes
-----
This function will force ``seq`` to completion.
"""
ret = tuple(zip(*_gen_unzip(map(tuple, seq), elem_len)))
if ret:
return ret
if elem_len is None:
raise ValueError("cannot unzip empty sequence without 'elem_len'")
return ((),) * elem_len
|
python
|
def unzip(seq, elem_len=None):
"""Unzip a length n sequence of length m sequences into m seperate length
n sequences.
Parameters
----------
seq : iterable[iterable]
The sequence to unzip.
elem_len : int, optional
The expected length of each element of ``seq``. If not provided this
will be infered from the length of the first element of ``seq``. This
can be used to ensure that code like: ``a, b = unzip(seq)`` does not
fail even when ``seq`` is empty.
Returns
-------
seqs : iterable[iterable]
The new sequences pulled out of the first iterable.
Raises
------
ValueError
Raised when ``seq`` is empty and ``elem_len`` is not provided.
Raised when elements of ``seq`` do not match the given ``elem_len`` or
the length of the first element of ``seq``.
Examples
--------
>>> seq = [('a', 1), ('b', 2), ('c', 3)]
>>> cs, ns = unzip(seq)
>>> cs
('a', 'b', 'c')
>>> ns
(1, 2, 3)
# checks that the elements are the same length
>>> seq = [('a', 1), ('b', 2), ('c', 3, 'extra')]
>>> cs, ns = unzip(seq)
Traceback (most recent call last):
...
ValueError: element at index 2 was length 3, expected 2
# allows an explicit element length instead of infering
>>> seq = [('a', 1, 'extra'), ('b', 2), ('c', 3)]
>>> cs, ns = unzip(seq, 2)
Traceback (most recent call last):
...
ValueError: element at index 0 was length 3, expected 2
# handles empty sequences when a length is given
>>> cs, ns = unzip([], elem_len=2)
>>> cs == ns == ()
True
Notes
-----
This function will force ``seq`` to completion.
"""
ret = tuple(zip(*_gen_unzip(map(tuple, seq), elem_len)))
if ret:
return ret
if elem_len is None:
raise ValueError("cannot unzip empty sequence without 'elem_len'")
return ((),) * elem_len
|
[
"def",
"unzip",
"(",
"seq",
",",
"elem_len",
"=",
"None",
")",
":",
"ret",
"=",
"tuple",
"(",
"zip",
"(",
"*",
"_gen_unzip",
"(",
"map",
"(",
"tuple",
",",
"seq",
")",
",",
"elem_len",
")",
")",
")",
"if",
"ret",
":",
"return",
"ret",
"if",
"elem_len",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"cannot unzip empty sequence without 'elem_len'\"",
")",
"return",
"(",
"(",
")",
",",
")",
"*",
"elem_len"
] |
Unzip a length n sequence of length m sequences into m seperate length
n sequences.
Parameters
----------
seq : iterable[iterable]
The sequence to unzip.
elem_len : int, optional
The expected length of each element of ``seq``. If not provided this
will be infered from the length of the first element of ``seq``. This
can be used to ensure that code like: ``a, b = unzip(seq)`` does not
fail even when ``seq`` is empty.
Returns
-------
seqs : iterable[iterable]
The new sequences pulled out of the first iterable.
Raises
------
ValueError
Raised when ``seq`` is empty and ``elem_len`` is not provided.
Raised when elements of ``seq`` do not match the given ``elem_len`` or
the length of the first element of ``seq``.
Examples
--------
>>> seq = [('a', 1), ('b', 2), ('c', 3)]
>>> cs, ns = unzip(seq)
>>> cs
('a', 'b', 'c')
>>> ns
(1, 2, 3)
# checks that the elements are the same length
>>> seq = [('a', 1), ('b', 2), ('c', 3, 'extra')]
>>> cs, ns = unzip(seq)
Traceback (most recent call last):
...
ValueError: element at index 2 was length 3, expected 2
# allows an explicit element length instead of infering
>>> seq = [('a', 1, 'extra'), ('b', 2), ('c', 3)]
>>> cs, ns = unzip(seq, 2)
Traceback (most recent call last):
...
ValueError: element at index 0 was length 3, expected 2
# handles empty sequences when a length is given
>>> cs, ns = unzip([], elem_len=2)
>>> cs == ns == ()
True
Notes
-----
This function will force ``seq`` to completion.
|
[
"Unzip",
"a",
"length",
"n",
"sequence",
"of",
"length",
"m",
"sequences",
"into",
"m",
"seperate",
"length",
"n",
"sequences",
".",
"Parameters",
"----------",
"seq",
":",
"iterable",
"[",
"iterable",
"]",
"The",
"sequence",
"to",
"unzip",
".",
"elem_len",
":",
"int",
"optional",
"The",
"expected",
"length",
"of",
"each",
"element",
"of",
"seq",
".",
"If",
"not",
"provided",
"this",
"will",
"be",
"infered",
"from",
"the",
"length",
"of",
"the",
"first",
"element",
"of",
"seq",
".",
"This",
"can",
"be",
"used",
"to",
"ensure",
"that",
"code",
"like",
":",
"a",
"b",
"=",
"unzip",
"(",
"seq",
")",
"does",
"not",
"fail",
"even",
"when",
"seq",
"is",
"empty",
".",
"Returns",
"-------",
"seqs",
":",
"iterable",
"[",
"iterable",
"]",
"The",
"new",
"sequences",
"pulled",
"out",
"of",
"the",
"first",
"iterable",
".",
"Raises",
"------",
"ValueError",
"Raised",
"when",
"seq",
"is",
"empty",
"and",
"elem_len",
"is",
"not",
"provided",
".",
"Raised",
"when",
"elements",
"of",
"seq",
"do",
"not",
"match",
"the",
"given",
"elem_len",
"or",
"the",
"length",
"of",
"the",
"first",
"element",
"of",
"seq",
".",
"Examples",
"--------",
">>>",
"seq",
"=",
"[",
"(",
"a",
"1",
")",
"(",
"b",
"2",
")",
"(",
"c",
"3",
")",
"]",
">>>",
"cs",
"ns",
"=",
"unzip",
"(",
"seq",
")",
">>>",
"cs",
"(",
"a",
"b",
"c",
")",
">>>",
"ns",
"(",
"1",
"2",
"3",
")"
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/utils/functional.py#L190-L250
|
train
|
Unzip a length n sequence of length m seperate length
n sequences.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIF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Osy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + chr(51) + chr(0b11010 + 0o33) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b111010 + 0o65) + chr(0b110011) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + chr(0b101110 + 0o4) + chr(0b110001), 65437 - 65429), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\x6f' + chr(0b1100 + 0o46) + chr(51) + chr(0b1110 + 0o51), 35394 - 35386), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101100 + 0o6) + chr(0b11101 + 0o27) + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(6247 - 6136) + chr(0b100110 + 0o13) + '\x35', 0o10), ehT0Px3KOsy9('\x30' + chr(0b101111 + 0o100) + chr(0b101111 + 0o2) + '\x34' + chr(317 - 262), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101 + 0o142) + '\x33' + chr(0b110000) + chr(1398 - 1348), ord("\x08")), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(5841 - 5730) + chr(801 - 750) + chr(50) + '\x30', 12933 - 12925), ehT0Px3KOsy9(chr(1810 - 1762) + '\157' + chr(50) + '\x37' + '\060', 8208 - 8200), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110100) + chr(1179 - 1128), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b11010 + 0o125) + '\062' + chr(0b110110) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(157 - 109) + chr(0b1101111) + chr(1236 - 1187) + chr(55) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b111011 + 0o64) + '\062' + chr(0b110011) + chr(49), 1014 - 1006), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101010 + 0o10) + chr(0b110100) + '\x32', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(0b0 + 0o62), 8), ehT0Px3KOsy9('\060' + chr(0b110 + 0o151) + '\062' + chr(0b110101) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1100 + 0o143) + '\061' + chr(0b100101 + 0o14) + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10011 + 0o36) + chr(2316 - 2263) + chr(1337 - 1289), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101011 + 0o10) + '\060' + chr(1248 - 1194), 2005 - 1997), ehT0Px3KOsy9(chr(1763 - 1715) + chr(0b1011 + 0o144) + '\063' + chr(2040 - 1990) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(1391 - 1343) + chr(0b11001 + 0o126) + '\061' + chr(1689 - 1634) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(5269 - 5158) + '\x33' + chr(0b110010) + '\064', 8), ehT0Px3KOsy9(chr(0b110000) + chr(9925 - 9814) + '\062' + chr(104 - 49) + '\x33', 0o10), ehT0Px3KOsy9(chr(658 - 610) + chr(111) + chr(0b101001 + 0o11) + chr(2253 - 2203) + chr(0b11110 + 0o27), 0b1000), ehT0Px3KOsy9(chr(1896 - 1848) + chr(111) + chr(0b101011 + 0o10), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(51) + chr(55), 8), ehT0Px3KOsy9(chr(48) + chr(0b101101 + 0o102) + chr(51) + chr(0b110100) + chr(0b110001 + 0o4), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(1524 - 1475) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(425 - 377) + '\157' + chr(0b110010) + chr(0b110010) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(7485 - 7374) + chr(0b110011) + '\062', 8), ehT0Px3KOsy9(chr(540 - 492) + chr(7437 - 7326) + chr(49) + chr(49) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(11941 - 11830) + chr(49) + '\062' + '\062', 61946 - 61938), ehT0Px3KOsy9(chr(687 - 639) + chr(0b1000001 + 0o56) + '\x31' + '\063' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\064' + '\x33', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(711 - 662), ord("\x08")), ehT0Px3KOsy9('\060' + chr(11761 - 11650) + chr(1960 - 1906) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\066' + chr(50), 0o10), ehT0Px3KOsy9(chr(975 - 927) + chr(0b1101111) + chr(0b110001) + chr(0b1 + 0o60) + '\066', 8), ehT0Px3KOsy9(chr(112 - 64) + chr(10402 - 10291) + chr(0b110010) + chr(48) + chr(0b100100 + 0o20), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(731 - 683) + '\157' + chr(53) + '\060', 59889 - 59881)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3'), '\144' + chr(4920 - 4819) + chr(0b1100011) + '\x6f' + '\144' + '\x65')(chr(0b101110 + 0o107) + '\164' + '\x66' + chr(45) + chr(599 - 543)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def a7sWLjl79ZMq(Rg74y3xRYTKF, w3IRo6TdmZ55=None):
VHn4CV4Ymrei = KNyTy8rYcwji(pZ0NK2y6HRbn(*dRsRck5Z5vir(abA97kOQKaLo(KNyTy8rYcwji, Rg74y3xRYTKF), w3IRo6TdmZ55)))
if VHn4CV4Ymrei:
return VHn4CV4Ymrei
if w3IRo6TdmZ55 is None:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e{\xbf\xf1\xc9yG\xb7\xbe\xc2J\xc5[\xfc\xcfj\xda2H\xb5\xb1\x0b\xa1\xde\xfb`\xfa\xc5\xfc\xfdn&=*W9\x16W"\xe1\x80E\xbd\xfa\xc8*'), chr(0b1011110 + 0o6) + chr(10168 - 10067) + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(0b1100101))('\x75' + chr(277 - 161) + '\146' + chr(0b11 + 0o52) + chr(0b1100 + 0o54)))
return ((),) * w3IRo6TdmZ55
|
quantopian/zipline
|
zipline/utils/functional.py
|
getattrs
|
def getattrs(value, attrs, default=_no_default):
"""
Perform a chained application of ``getattr`` on ``value`` with the values
in ``attrs``.
If ``default`` is supplied, return it if any of the attribute lookups fail.
Parameters
----------
value : object
Root of the lookup chain.
attrs : iterable[str]
Sequence of attributes to look up.
default : object, optional
Value to return if any of the lookups fail.
Returns
-------
result : object
Result of the lookup sequence.
Examples
--------
>>> class EmptyObject(object):
... pass
...
>>> obj = EmptyObject()
>>> obj.foo = EmptyObject()
>>> obj.foo.bar = "value"
>>> getattrs(obj, ('foo', 'bar'))
'value'
>>> getattrs(obj, ('foo', 'buzz'))
Traceback (most recent call last):
...
AttributeError: 'EmptyObject' object has no attribute 'buzz'
>>> getattrs(obj, ('foo', 'buzz'), 'default')
'default'
"""
try:
for attr in attrs:
value = getattr(value, attr)
except AttributeError:
if default is _no_default:
raise
value = default
return value
|
python
|
def getattrs(value, attrs, default=_no_default):
"""
Perform a chained application of ``getattr`` on ``value`` with the values
in ``attrs``.
If ``default`` is supplied, return it if any of the attribute lookups fail.
Parameters
----------
value : object
Root of the lookup chain.
attrs : iterable[str]
Sequence of attributes to look up.
default : object, optional
Value to return if any of the lookups fail.
Returns
-------
result : object
Result of the lookup sequence.
Examples
--------
>>> class EmptyObject(object):
... pass
...
>>> obj = EmptyObject()
>>> obj.foo = EmptyObject()
>>> obj.foo.bar = "value"
>>> getattrs(obj, ('foo', 'bar'))
'value'
>>> getattrs(obj, ('foo', 'buzz'))
Traceback (most recent call last):
...
AttributeError: 'EmptyObject' object has no attribute 'buzz'
>>> getattrs(obj, ('foo', 'buzz'), 'default')
'default'
"""
try:
for attr in attrs:
value = getattr(value, attr)
except AttributeError:
if default is _no_default:
raise
value = default
return value
|
[
"def",
"getattrs",
"(",
"value",
",",
"attrs",
",",
"default",
"=",
"_no_default",
")",
":",
"try",
":",
"for",
"attr",
"in",
"attrs",
":",
"value",
"=",
"getattr",
"(",
"value",
",",
"attr",
")",
"except",
"AttributeError",
":",
"if",
"default",
"is",
"_no_default",
":",
"raise",
"value",
"=",
"default",
"return",
"value"
] |
Perform a chained application of ``getattr`` on ``value`` with the values
in ``attrs``.
If ``default`` is supplied, return it if any of the attribute lookups fail.
Parameters
----------
value : object
Root of the lookup chain.
attrs : iterable[str]
Sequence of attributes to look up.
default : object, optional
Value to return if any of the lookups fail.
Returns
-------
result : object
Result of the lookup sequence.
Examples
--------
>>> class EmptyObject(object):
... pass
...
>>> obj = EmptyObject()
>>> obj.foo = EmptyObject()
>>> obj.foo.bar = "value"
>>> getattrs(obj, ('foo', 'bar'))
'value'
>>> getattrs(obj, ('foo', 'buzz'))
Traceback (most recent call last):
...
AttributeError: 'EmptyObject' object has no attribute 'buzz'
>>> getattrs(obj, ('foo', 'buzz'), 'default')
'default'
|
[
"Perform",
"a",
"chained",
"application",
"of",
"getattr",
"on",
"value",
"with",
"the",
"values",
"in",
"attrs",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/utils/functional.py#L256-L303
|
train
|
Perform a chained getattr on value with the values
in attrs.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW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dqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + '\x30' + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(53) + '\x32', 0b1000), ehT0Px3KOsy9(chr(468 - 420) + chr(111) + chr(0b1101 + 0o46) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1010001 + 0o36) + chr(152 - 102) + chr(0b110101) + chr(0b111 + 0o55), ord("\x08")), ehT0Px3KOsy9(chr(1260 - 1212) + '\x6f' + chr(1345 - 1292) + chr(0b100110 + 0o21), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(0b1000 + 0o55) + chr(564 - 513), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(948 - 899), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b100110 + 0o13) + chr(1772 - 1718) + chr(50), 57103 - 57095), ehT0Px3KOsy9(chr(0b110000) + chr(1655 - 1544) + '\061' + chr(0b100101 + 0o13) + '\x34', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b110100) + chr(0b11011 + 0o25), 23392 - 23384), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + '\x36' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(51) + chr(0b1001 + 0o52), 64659 - 64651), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1020 - 971) + chr(0b100100 + 0o22) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(8095 - 7984) + '\x31' + '\061' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(902 - 791) + chr(51) + chr(2314 - 2263) + chr(1926 - 1871), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(0b1 + 0o60) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1101111) + chr(0b110010) + chr(0b110010) + '\x32', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1011100 + 0o23) + chr(2468 - 2413) + chr(539 - 486), 0o10), ehT0Px3KOsy9(chr(966 - 918) + '\x6f' + chr(52) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(0b11110 + 0o22) + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(944 - 890) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(2296 - 2248) + chr(111) + chr(853 - 803) + chr(0b1100 + 0o47) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(1291 - 1243) + chr(0b11111 + 0o120) + '\x31' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(2272 - 2224) + chr(111) + '\x31' + '\x32' + chr(0b110010), 29873 - 29865), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(52) + chr(0b10101 + 0o40), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1658 - 1609) + chr(2228 - 2177) + chr(1620 - 1572), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x36' + '\063', 0b1000), ehT0Px3KOsy9('\060' + chr(7228 - 7117) + '\x36' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1327 - 1278) + '\x36' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1494 - 1445) + '\063' + '\062', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + chr(55), 0o10), ehT0Px3KOsy9(chr(1128 - 1080) + chr(0b1101111) + chr(1363 - 1312) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\x6f' + '\x33' + '\061' + '\064', 15652 - 15644), ehT0Px3KOsy9(chr(48) + chr(0b1011011 + 0o24) + chr(51) + chr(51) + chr(54), 0b1000), ehT0Px3KOsy9(chr(1041 - 993) + chr(0b1110 + 0o141) + '\062' + chr(55) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(518 - 468) + chr(50) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(0b101000 + 0o107) + '\063' + chr(0b110 + 0o60) + chr(53), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b11101 + 0o24) + chr(0b101111 + 0o1) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10100 + 0o36) + chr(2508 - 2453) + chr(0b10111 + 0o40), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100000 + 0o23) + chr(51) + '\x31', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1150 - 1102) + chr(0b1101111) + chr(53) + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa9'), chr(0b110001 + 0o63) + chr(0b1100011 + 0o2) + chr(1097 - 998) + chr(111) + chr(0b1100100) + chr(0b1100101))('\165' + '\164' + chr(102) + chr(0b101101) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def xjYOM3EDdlRi(QmmgWUB13VCJ, oIhwMA96NShQ, t1v7afVhe01t=c3MsK66u7V9I):
try:
for uwnd9_euJYKT in oIhwMA96NShQ:
QmmgWUB13VCJ = xafqLlk3kkUe(QmmgWUB13VCJ, uwnd9_euJYKT)
except sHOWSIAKtU58:
if t1v7afVhe01t is c3MsK66u7V9I:
raise
QmmgWUB13VCJ = t1v7afVhe01t
return QmmgWUB13VCJ
|
quantopian/zipline
|
zipline/utils/functional.py
|
set_attribute
|
def set_attribute(name, value):
"""
Decorator factory for setting attributes on a function.
Doesn't change the behavior of the wrapped function.
Examples
--------
>>> @set_attribute('__name__', 'foo')
... def bar():
... return 3
...
>>> bar()
3
>>> bar.__name__
'foo'
"""
def decorator(f):
setattr(f, name, value)
return f
return decorator
|
python
|
def set_attribute(name, value):
"""
Decorator factory for setting attributes on a function.
Doesn't change the behavior of the wrapped function.
Examples
--------
>>> @set_attribute('__name__', 'foo')
... def bar():
... return 3
...
>>> bar()
3
>>> bar.__name__
'foo'
"""
def decorator(f):
setattr(f, name, value)
return f
return decorator
|
[
"def",
"set_attribute",
"(",
"name",
",",
"value",
")",
":",
"def",
"decorator",
"(",
"f",
")",
":",
"setattr",
"(",
"f",
",",
"name",
",",
"value",
")",
"return",
"f",
"return",
"decorator"
] |
Decorator factory for setting attributes on a function.
Doesn't change the behavior of the wrapped function.
Examples
--------
>>> @set_attribute('__name__', 'foo')
... def bar():
... return 3
...
>>> bar()
3
>>> bar.__name__
'foo'
|
[
"Decorator",
"factory",
"for",
"setting",
"attributes",
"on",
"a",
"function",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/utils/functional.py#L307-L327
|
train
|
Decorator for setting attributes on a single object.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAY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g0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(3393 - 3282) + '\x32' + chr(0b110000) + '\060', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(1527 - 1473) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(89 - 34), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\x6f' + chr(0b101100 + 0o5) + chr(54), 38439 - 38431), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + '\067' + chr(48), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(1472 - 1423) + chr(1947 - 1892) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + '\065' + chr(732 - 678), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(0b101110 + 0o2) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + '\060' + chr(50), 1593 - 1585), ehT0Px3KOsy9(chr(48) + chr(4147 - 4036) + chr(2251 - 2200) + '\x30' + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(751 - 696) + chr(0b11100 + 0o25), 0b1000), ehT0Px3KOsy9(chr(1796 - 1748) + chr(0b1101111) + chr(53) + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8940 - 8829) + '\062' + '\x33' + chr(0b101 + 0o61), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(49) + '\063' + chr(53), 11001 - 10993), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + '\x33' + '\x36' + chr(0b1100 + 0o47), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + '\x32', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\067' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + chr(1631 - 1580) + chr(0b110000) + chr(1940 - 1885), 0b1000), ehT0Px3KOsy9(chr(119 - 71) + '\x6f' + '\x36' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(4662 - 4551) + '\061' + chr(0b110101 + 0o1) + chr(0b101101 + 0o3), 0o10), ehT0Px3KOsy9(chr(48) + chr(2797 - 2686) + chr(51) + chr(0b110011) + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b10111 + 0o130) + chr(0b110001) + '\x37' + chr(0b110100 + 0o2), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1897 - 1846) + chr(0b110101) + chr(55), 1668 - 1660), ehT0Px3KOsy9(chr(1153 - 1105) + chr(0b1101111) + '\062' + chr(0b110000) + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + '\067' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(363 - 314) + chr(954 - 902), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(686 - 635) + chr(48) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110 + 0o54) + chr(0b100000 + 0o21) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101010 + 0o10) + '\062' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(665 - 614) + '\x37' + chr(48), 30873 - 30865), ehT0Px3KOsy9('\x30' + chr(9480 - 9369) + chr(0b100001 + 0o21) + chr(0b110101) + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100 + 0o55) + '\x33' + chr(0b110000), 12065 - 12057), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + '\062' + '\060' + chr(0b100000 + 0o24), 0b1000), ehT0Px3KOsy9(chr(2012 - 1964) + chr(111) + chr(0b110001) + '\060' + chr(51), 0o10), ehT0Px3KOsy9('\060' + chr(11120 - 11009) + '\x31' + chr(0b110001) + chr(0b0 + 0o65), 18355 - 18347), ehT0Px3KOsy9(chr(199 - 151) + chr(4570 - 4459) + chr(1931 - 1880) + '\067' + chr(0b10010 + 0o43), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b101110 + 0o101) + chr(0b110010) + '\062' + chr(0b101110 + 0o5), 23808 - 23800), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + '\x31' + chr(0b110101) + chr(0b101100 + 0o6), 0b1000), ehT0Px3KOsy9(chr(546 - 498) + chr(0b1101111) + chr(0b1111 + 0o43) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110110 + 0o71) + chr(0b110011) + chr(0b110111) + chr(0b1111 + 0o44), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + '\065' + chr(0b10110 + 0o32), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xae'), chr(7915 - 7815) + chr(0b1100101) + chr(4422 - 4323) + '\157' + chr(100) + chr(101))(chr(0b1110101) + chr(11121 - 11005) + chr(102) + chr(45) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def lbtVNbHpCGMZ(AIvJRzLdDfgF, QmmgWUB13VCJ):
def aInxBLSrGyiI(EGyt1xfPT1P6):
t0rOMsrOC7R_(EGyt1xfPT1P6, AIvJRzLdDfgF, QmmgWUB13VCJ)
return EGyt1xfPT1P6
return aInxBLSrGyiI
|
quantopian/zipline
|
zipline/utils/functional.py
|
foldr
|
def foldr(f, seq, default=_no_default):
"""Fold a function over a sequence with right associativity.
Parameters
----------
f : callable[any, any]
The function to reduce the sequence with.
The first argument will be the element of the sequence; the second
argument will be the accumulator.
seq : iterable[any]
The sequence to reduce.
default : any, optional
The starting value to reduce with. If not provided, the sequence
cannot be empty, and the last value of the sequence will be used.
Returns
-------
folded : any
The folded value.
Notes
-----
This functions works by reducing the list in a right associative way.
For example, imagine we are folding with ``operator.add`` or ``+``:
.. code-block:: python
foldr(add, seq) -> seq[0] + (seq[1] + (seq[2] + (...seq[-1], default)))
In the more general case with an arbitrary function, ``foldr`` will expand
like so:
.. code-block:: python
foldr(f, seq) -> f(seq[0], f(seq[1], f(seq[2], ...f(seq[-1], default))))
For a more in depth discussion of left and right folds, see:
`https://en.wikipedia.org/wiki/Fold_(higher-order_function)`_
The images in that page are very good for showing the differences between
``foldr`` and ``foldl`` (``reduce``).
.. note::
For performance reasons is is best to pass a strict (non-lazy) sequence,
for example, a list.
See Also
--------
:func:`functools.reduce`
:func:`sum`
"""
return reduce(
flip(f),
reversed(seq),
*(default,) if default is not _no_default else ()
)
|
python
|
def foldr(f, seq, default=_no_default):
"""Fold a function over a sequence with right associativity.
Parameters
----------
f : callable[any, any]
The function to reduce the sequence with.
The first argument will be the element of the sequence; the second
argument will be the accumulator.
seq : iterable[any]
The sequence to reduce.
default : any, optional
The starting value to reduce with. If not provided, the sequence
cannot be empty, and the last value of the sequence will be used.
Returns
-------
folded : any
The folded value.
Notes
-----
This functions works by reducing the list in a right associative way.
For example, imagine we are folding with ``operator.add`` or ``+``:
.. code-block:: python
foldr(add, seq) -> seq[0] + (seq[1] + (seq[2] + (...seq[-1], default)))
In the more general case with an arbitrary function, ``foldr`` will expand
like so:
.. code-block:: python
foldr(f, seq) -> f(seq[0], f(seq[1], f(seq[2], ...f(seq[-1], default))))
For a more in depth discussion of left and right folds, see:
`https://en.wikipedia.org/wiki/Fold_(higher-order_function)`_
The images in that page are very good for showing the differences between
``foldr`` and ``foldl`` (``reduce``).
.. note::
For performance reasons is is best to pass a strict (non-lazy) sequence,
for example, a list.
See Also
--------
:func:`functools.reduce`
:func:`sum`
"""
return reduce(
flip(f),
reversed(seq),
*(default,) if default is not _no_default else ()
)
|
[
"def",
"foldr",
"(",
"f",
",",
"seq",
",",
"default",
"=",
"_no_default",
")",
":",
"return",
"reduce",
"(",
"flip",
"(",
"f",
")",
",",
"reversed",
"(",
"seq",
")",
",",
"*",
"(",
"default",
",",
")",
"if",
"default",
"is",
"not",
"_no_default",
"else",
"(",
")",
")"
] |
Fold a function over a sequence with right associativity.
Parameters
----------
f : callable[any, any]
The function to reduce the sequence with.
The first argument will be the element of the sequence; the second
argument will be the accumulator.
seq : iterable[any]
The sequence to reduce.
default : any, optional
The starting value to reduce with. If not provided, the sequence
cannot be empty, and the last value of the sequence will be used.
Returns
-------
folded : any
The folded value.
Notes
-----
This functions works by reducing the list in a right associative way.
For example, imagine we are folding with ``operator.add`` or ``+``:
.. code-block:: python
foldr(add, seq) -> seq[0] + (seq[1] + (seq[2] + (...seq[-1], default)))
In the more general case with an arbitrary function, ``foldr`` will expand
like so:
.. code-block:: python
foldr(f, seq) -> f(seq[0], f(seq[1], f(seq[2], ...f(seq[-1], default))))
For a more in depth discussion of left and right folds, see:
`https://en.wikipedia.org/wiki/Fold_(higher-order_function)`_
The images in that page are very good for showing the differences between
``foldr`` and ``foldl`` (``reduce``).
.. note::
For performance reasons is is best to pass a strict (non-lazy) sequence,
for example, a list.
See Also
--------
:func:`functools.reduce`
:func:`sum`
|
[
"Fold",
"a",
"function",
"over",
"a",
"sequence",
"with",
"right",
"associativity",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/utils/functional.py#L337-L393
|
train
|
Fold a function over a sequence with right associativity.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x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ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b111 + 0o150) + '\063' + '\x31' + chr(1436 - 1383), 12087 - 12079), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1657 - 1608) + '\x31' + '\063', 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1101111) + chr(51) + chr(0b110100) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101100 + 0o3) + '\063' + chr(0b110001) + chr(51), 48685 - 48677), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\065' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\157' + chr(0b111 + 0o53) + '\x30' + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101001 + 0o11) + chr(54) + chr(51), 46375 - 46367), ehT0Px3KOsy9(chr(48) + chr(7787 - 7676) + chr(0b110001) + chr(55) + chr(1021 - 968), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + chr(0b100011 + 0o22) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + '\x30' + chr(2221 - 2173), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(2063 - 1952) + chr(0b110 + 0o55) + chr(0b110001) + chr(48), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101010 + 0o105) + chr(2505 - 2454) + chr(0b10000 + 0o42) + '\x32', 38478 - 38470), ehT0Px3KOsy9(chr(48) + '\157' + chr(668 - 614) + chr(0b100011 + 0o20), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(2343 - 2294) + '\062' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + chr(0b101011 + 0o7) + chr(1872 - 1819) + '\067', 0o10), ehT0Px3KOsy9('\x30' + chr(8115 - 8004) + '\x33' + '\064' + chr(771 - 720), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(49) + chr(2596 - 2543), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(0b110101) + chr(1447 - 1397), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(53) + chr(1551 - 1496), 0o10), ehT0Px3KOsy9(chr(48) + chr(4729 - 4618) + '\061' + chr(54) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(547 - 498) + '\x35' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(1300 - 1252) + chr(111) + chr(0b10001 + 0o42) + chr(51) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + '\x36' + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + '\064' + '\x33', 8), ehT0Px3KOsy9(chr(48) + chr(0b1000011 + 0o54) + chr(0b1110 + 0o46) + chr(211 - 163), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(1522 - 1411) + chr(50) + chr(2005 - 1957) + '\x36', 0b1000), ehT0Px3KOsy9(chr(2265 - 2217) + '\x6f' + '\061' + chr(0b1001 + 0o52) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(748 - 700) + chr(2469 - 2358) + chr(1410 - 1361) + chr(53) + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(5518 - 5407) + chr(0b11010 + 0o31) + '\x31' + '\x35', 8), ehT0Px3KOsy9(chr(48) + chr(2178 - 2067) + chr(0b1001 + 0o52) + chr(0b110001) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b111000 + 0o67) + chr(180 - 130) + '\x37' + chr(2236 - 2181), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b111 + 0o150) + '\x31' + chr(1698 - 1649) + chr(51), 8), ehT0Px3KOsy9('\x30' + chr(0b1000111 + 0o50) + chr(0b110001) + '\062' + chr(248 - 197), 0o10), ehT0Px3KOsy9(chr(1411 - 1363) + chr(111) + '\062' + chr(0b100111 + 0o14) + chr(676 - 622), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101110 + 0o5) + '\062' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(552 - 504) + chr(6987 - 6876) + chr(0b101100 + 0o6) + chr(0b101010 + 0o7), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(0b11 + 0o57) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\157' + chr(0b110010) + chr(0b110001) + '\060', 0b1000), ehT0Px3KOsy9('\x30' + chr(1313 - 1202) + chr(52) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100001 + 0o116) + chr(2183 - 2133) + '\067' + chr(0b0 + 0o66), 43598 - 43590)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110101) + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe3'), chr(584 - 484) + '\x65' + chr(99) + chr(111) + chr(1458 - 1358) + chr(0b1100101))(chr(10646 - 10529) + '\164' + chr(0b1100110) + chr(0b10101 + 0o30) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
(RSYsB9TMxo_y,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xab>\x8d\xa8^\xea\xdc\x11\x1c'), '\x64' + chr(0b100011 + 0o102) + '\x63' + chr(111) + chr(0b101 + 0o137) + '\x65')('\x75' + chr(0b1100100 + 0o20) + '\x66' + '\055' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xbf.\x87\xbeI\xe0'), chr(100) + '\x65' + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(101))(chr(0b1010010 + 0o43) + chr(2437 - 2321) + chr(2210 - 2108) + chr(0b101101) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\xbf.\x87\xbeI\xe0'), chr(0b1100100) + chr(0b1100101) + '\x63' + '\x6f' + chr(100) + chr(4445 - 4344))(chr(0b1110101) + '\x74' + '\146' + '\055' + chr(0b111000))),)
def MmxWr6yHAc0x(EGyt1xfPT1P6, Rg74y3xRYTKF, t1v7afVhe01t=c3MsK66u7V9I):
return RSYsB9TMxo_y(mFx6gsZ1V8KW(EGyt1xfPT1P6), RFiwrCZH9Ie6(Rg74y3xRYTKF), *((t1v7afVhe01t,) if t1v7afVhe01t is not c3MsK66u7V9I else ()))
|
quantopian/zipline
|
zipline/utils/functional.py
|
invert
|
def invert(d):
"""
Invert a dictionary into a dictionary of sets.
>>> invert({'a': 1, 'b': 2, 'c': 1}) # doctest: +SKIP
{1: {'a', 'c'}, 2: {'b'}}
"""
out = {}
for k, v in iteritems(d):
try:
out[v].add(k)
except KeyError:
out[v] = {k}
return out
|
python
|
def invert(d):
"""
Invert a dictionary into a dictionary of sets.
>>> invert({'a': 1, 'b': 2, 'c': 1}) # doctest: +SKIP
{1: {'a', 'c'}, 2: {'b'}}
"""
out = {}
for k, v in iteritems(d):
try:
out[v].add(k)
except KeyError:
out[v] = {k}
return out
|
[
"def",
"invert",
"(",
"d",
")",
":",
"out",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"iteritems",
"(",
"d",
")",
":",
"try",
":",
"out",
"[",
"v",
"]",
".",
"add",
"(",
"k",
")",
"except",
"KeyError",
":",
"out",
"[",
"v",
"]",
"=",
"{",
"k",
"}",
"return",
"out"
] |
Invert a dictionary into a dictionary of sets.
>>> invert({'a': 1, 'b': 2, 'c': 1}) # doctest: +SKIP
{1: {'a', 'c'}, 2: {'b'}}
|
[
"Invert",
"a",
"dictionary",
"into",
"a",
"dictionary",
"of",
"sets",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/utils/functional.py#L396-L409
|
train
|
Invert a dictionary into a dictionary of sets.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzI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GspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\157' + '\x37' + '\x33', 52876 - 52868), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(48) + chr(0b11001 + 0o31), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(48) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\157' + chr(0b110111) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1000010 + 0o55) + chr(806 - 757) + chr(1854 - 1806) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\063' + chr(1466 - 1412) + chr(722 - 671), 0b1000), ehT0Px3KOsy9(chr(48) + chr(2207 - 2096) + chr(288 - 239) + '\x32' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + chr(0b10000 + 0o42) + chr(1515 - 1461) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(0b100001 + 0o21) + chr(0b10011 + 0o43), 18646 - 18638), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(269 - 217) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110000 + 0o77) + chr(2118 - 2068) + chr(49) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b101100 + 0o103) + chr(1227 - 1177) + chr(0b110010) + chr(393 - 341), ord("\x08")), ehT0Px3KOsy9(chr(1178 - 1130) + chr(6141 - 6030) + '\062' + chr(553 - 501) + chr(0b100 + 0o63), 0o10), ehT0Px3KOsy9('\x30' + chr(11919 - 11808) + chr(0b11001 + 0o33) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\157' + chr(0b110010) + chr(51) + chr(822 - 768), 61235 - 61227), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x35' + chr(703 - 654), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(0b10100 + 0o35), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110111) + chr(53), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + '\061' + chr(0b110011), 58912 - 58904), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11111 + 0o24) + '\x37' + '\x35', 0o10), ehT0Px3KOsy9(chr(345 - 297) + '\157' + '\062' + '\064' + '\060', 0o10), ehT0Px3KOsy9(chr(1472 - 1424) + chr(0b101000 + 0o107) + '\x31' + chr(715 - 660) + '\063', 30600 - 30592), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(55) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(165 - 113) + chr(0b1000 + 0o50), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110000 + 0o1) + '\060' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(1936 - 1888) + chr(0b1101111) + chr(971 - 922) + '\x37' + '\x35', 27290 - 27282), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110100) + chr(0b11100 + 0o26), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(1392 - 1342) + chr(50) + chr(0b10011 + 0o44), 0o10), ehT0Px3KOsy9('\060' + chr(0b1100001 + 0o16) + '\x31' + chr(561 - 509) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\157' + chr(0b101010 + 0o10) + '\x33' + chr(1292 - 1237), 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\157' + '\067' + chr(0b110101), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(55) + chr(0b110011), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10 + 0o60) + chr(52) + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(947 - 899) + '\066', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(878 - 826) + chr(49), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(1987 - 1936) + chr(53) + chr(684 - 632), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(5156 - 5045) + chr(2419 - 2368) + chr(117 - 67), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101111 + 0o2) + '\065' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(810 - 762) + '\x6f' + '\063' + chr(2011 - 1959) + chr(0b110000), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1000010 + 0o55) + chr(0b1001 + 0o54) + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x15'), chr(0b1100100) + chr(4296 - 4195) + '\x63' + '\x6f' + chr(100) + '\x65')(chr(0b110100 + 0o101) + chr(0b1010111 + 0o35) + '\146' + chr(0b101001 + 0o4) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def wQfSXUShc0uj(pd3lxn9vqWxp):
UkrMp_I0RDmo = {}
for (OolUPRJhRaJd, cMbll0QYhULo) in WYXqUHkBa2Bx(pd3lxn9vqWxp):
try:
xafqLlk3kkUe(UkrMp_I0RDmo[cMbll0QYhULo], xafqLlk3kkUe(SXOLrMavuUCe(b'N\x88\xb4Iy\x90\x17\x81\x8c.\xd9\xa7'), chr(1175 - 1075) + chr(5487 - 5386) + chr(99) + '\x6f' + chr(0b1100100) + '\x65')(chr(0b101110 + 0o107) + chr(11682 - 11566) + chr(0b1010111 + 0o17) + chr(45) + '\070'))(OolUPRJhRaJd)
except RQ6CSRrFArYB:
UkrMp_I0RDmo[cMbll0QYhULo] = {OolUPRJhRaJd}
return UkrMp_I0RDmo
|
quantopian/zipline
|
zipline/examples/olmar.py
|
simplex_projection
|
def simplex_projection(v, b=1):
r"""Projection vectors to the simplex domain
Implemented according to the paper: Efficient projections onto the
l1-ball for learning in high dimensions, John Duchi, et al. ICML 2008.
Implementation Time: 2011 June 17 by Bin@libin AT pmail.ntu.edu.sg
Optimization Problem: min_{w}\| w - v \|_{2}^{2}
s.t. sum_{i=1}^{m}=z, w_{i}\geq 0
Input: A vector v \in R^{m}, and a scalar z > 0 (default=1)
Output: Projection vector w
:Example:
>>> proj = simplex_projection([.4 ,.3, -.4, .5])
>>> proj # doctest: +NORMALIZE_WHITESPACE
array([ 0.33333333, 0.23333333, 0. , 0.43333333])
>>> print(proj.sum())
1.0
Original matlab implementation: John Duchi (jduchi@cs.berkeley.edu)
Python-port: Copyright 2013 by Thomas Wiecki (thomas.wiecki@gmail.com).
"""
v = np.asarray(v)
p = len(v)
# Sort v into u in descending order
v = (v > 0) * v
u = np.sort(v)[::-1]
sv = np.cumsum(u)
rho = np.where(u > (sv - b) / np.arange(1, p + 1))[0][-1]
theta = np.max([0, (sv[rho] - b) / (rho + 1)])
w = (v - theta)
w[w < 0] = 0
return w
|
python
|
def simplex_projection(v, b=1):
r"""Projection vectors to the simplex domain
Implemented according to the paper: Efficient projections onto the
l1-ball for learning in high dimensions, John Duchi, et al. ICML 2008.
Implementation Time: 2011 June 17 by Bin@libin AT pmail.ntu.edu.sg
Optimization Problem: min_{w}\| w - v \|_{2}^{2}
s.t. sum_{i=1}^{m}=z, w_{i}\geq 0
Input: A vector v \in R^{m}, and a scalar z > 0 (default=1)
Output: Projection vector w
:Example:
>>> proj = simplex_projection([.4 ,.3, -.4, .5])
>>> proj # doctest: +NORMALIZE_WHITESPACE
array([ 0.33333333, 0.23333333, 0. , 0.43333333])
>>> print(proj.sum())
1.0
Original matlab implementation: John Duchi (jduchi@cs.berkeley.edu)
Python-port: Copyright 2013 by Thomas Wiecki (thomas.wiecki@gmail.com).
"""
v = np.asarray(v)
p = len(v)
# Sort v into u in descending order
v = (v > 0) * v
u = np.sort(v)[::-1]
sv = np.cumsum(u)
rho = np.where(u > (sv - b) / np.arange(1, p + 1))[0][-1]
theta = np.max([0, (sv[rho] - b) / (rho + 1)])
w = (v - theta)
w[w < 0] = 0
return w
|
[
"def",
"simplex_projection",
"(",
"v",
",",
"b",
"=",
"1",
")",
":",
"v",
"=",
"np",
".",
"asarray",
"(",
"v",
")",
"p",
"=",
"len",
"(",
"v",
")",
"# Sort v into u in descending order",
"v",
"=",
"(",
"v",
">",
"0",
")",
"*",
"v",
"u",
"=",
"np",
".",
"sort",
"(",
"v",
")",
"[",
":",
":",
"-",
"1",
"]",
"sv",
"=",
"np",
".",
"cumsum",
"(",
"u",
")",
"rho",
"=",
"np",
".",
"where",
"(",
"u",
">",
"(",
"sv",
"-",
"b",
")",
"/",
"np",
".",
"arange",
"(",
"1",
",",
"p",
"+",
"1",
")",
")",
"[",
"0",
"]",
"[",
"-",
"1",
"]",
"theta",
"=",
"np",
".",
"max",
"(",
"[",
"0",
",",
"(",
"sv",
"[",
"rho",
"]",
"-",
"b",
")",
"/",
"(",
"rho",
"+",
"1",
")",
"]",
")",
"w",
"=",
"(",
"v",
"-",
"theta",
")",
"w",
"[",
"w",
"<",
"0",
"]",
"=",
"0",
"return",
"w"
] |
r"""Projection vectors to the simplex domain
Implemented according to the paper: Efficient projections onto the
l1-ball for learning in high dimensions, John Duchi, et al. ICML 2008.
Implementation Time: 2011 June 17 by Bin@libin AT pmail.ntu.edu.sg
Optimization Problem: min_{w}\| w - v \|_{2}^{2}
s.t. sum_{i=1}^{m}=z, w_{i}\geq 0
Input: A vector v \in R^{m}, and a scalar z > 0 (default=1)
Output: Projection vector w
:Example:
>>> proj = simplex_projection([.4 ,.3, -.4, .5])
>>> proj # doctest: +NORMALIZE_WHITESPACE
array([ 0.33333333, 0.23333333, 0. , 0.43333333])
>>> print(proj.sum())
1.0
Original matlab implementation: John Duchi (jduchi@cs.berkeley.edu)
Python-port: Copyright 2013 by Thomas Wiecki (thomas.wiecki@gmail.com).
|
[
"r",
"Projection",
"vectors",
"to",
"the",
"simplex",
"domain"
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/examples/olmar.py#L111-L146
|
train
|
r Projections a vector v onto the simplex domain.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA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xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10001 + 0o46) + chr(1722 - 1672), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1101 + 0o44) + chr(0b101110 + 0o6) + '\x35', 64627 - 64619), ehT0Px3KOsy9(chr(624 - 576) + '\157' + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(0b11110 + 0o22) + chr(0b100011 + 0o22), 63914 - 63906), ehT0Px3KOsy9('\060' + chr(0b1011110 + 0o21) + chr(0b0 + 0o65) + chr(2457 - 2407), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(54) + chr(0b110010), 10029 - 10021), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(0b101111 + 0o2) + '\063' + '\067', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101100 + 0o3) + chr(0b110111) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(111) + '\x31' + chr(0b110100) + '\063', 0b1000), ehT0Px3KOsy9('\060' + chr(0b10111 + 0o130) + '\x35' + chr(49), 2162 - 2154), ehT0Px3KOsy9(chr(0b110000) + chr(0b111 + 0o150) + chr(2484 - 2434) + chr(53), 0b1000), ehT0Px3KOsy9(chr(823 - 775) + chr(111) + chr(50) + '\x34' + chr(0b11011 + 0o34), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(1210 - 1160) + chr(307 - 253) + '\061', 53535 - 53527), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\067' + '\x34', 0o10), ehT0Px3KOsy9('\x30' + chr(3447 - 3336) + chr(2547 - 2495) + chr(0b111 + 0o54), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + chr(0b11001 + 0o30) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + '\x32' + '\x35', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1740 - 1690) + '\x34' + chr(0b101011 + 0o6), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(54) + '\x31', 0o10), ehT0Px3KOsy9('\x30' + chr(0b11100 + 0o123) + '\061' + '\x33' + '\064', 0o10), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\157' + '\x33' + chr(0b10101 + 0o40) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(5304 - 5193) + chr(0b1100 + 0o46) + chr(0b110011) + '\061', 63132 - 63124), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(8375 - 8264) + '\x31' + chr(0b110111) + chr(53), 15949 - 15941), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2592 - 2541) + chr(2304 - 2253) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(6093 - 5982) + '\063' + '\067' + chr(54), 13838 - 13830), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(369 - 258) + chr(835 - 785) + '\x32' + '\060', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(1165 - 1111) + chr(499 - 446), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(49), 28171 - 28163), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(51) + '\061', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1011110 + 0o21) + chr(49) + chr(1834 - 1785) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\157' + '\063' + chr(0b100000 + 0o23) + chr(131 - 83), 12893 - 12885), ehT0Px3KOsy9(chr(271 - 223) + chr(0b1101111) + '\061' + chr(2113 - 2064) + chr(0b110001), 21286 - 21278), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110 + 0o53) + '\064' + chr(0b10111 + 0o37), 0b1000), ehT0Px3KOsy9(chr(871 - 823) + chr(3030 - 2919) + chr(0b1010 + 0o47) + '\x37', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(0b1011 + 0o47) + '\x35', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1101 + 0o50) + chr(0b101100 + 0o5), 8), ehT0Px3KOsy9(chr(591 - 543) + chr(111) + '\x33' + chr(0b110010) + chr(709 - 660), 44475 - 44467), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(0b10 + 0o56), 6718 - 6710), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(5795 - 5684) + '\x32' + chr(0b10011 + 0o43) + chr(0b10010 + 0o40), 5378 - 5370)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\065' + chr(0b10101 + 0o33), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x14'), chr(0b1100011 + 0o1) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(0b1000001 + 0o43) + chr(0b1110 + 0o127))(chr(2478 - 2361) + '\164' + chr(0b1100110) + chr(0b101101) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def IIkuWGest_W7(cMbll0QYhULo, wmN3dvez4qzC=ehT0Px3KOsy9('\x30' + chr(111) + '\x31', 0b1000)):
cMbll0QYhULo = WqUC3KWvYVup.asarray(cMbll0QYhULo)
UyakMW2IMFEj = c2A0yzQpDQB3(cMbll0QYhULo)
cMbll0QYhULo = (cMbll0QYhULo > ehT0Px3KOsy9('\060' + chr(5183 - 5072) + '\x30', ord("\x08"))) * cMbll0QYhULo
SkdK71rGR8E7 = WqUC3KWvYVup.sort(cMbll0QYhULo)[::-ehT0Px3KOsy9(chr(2029 - 1981) + chr(111) + chr(49), 8)]
hzJ_cl7tr24o = WqUC3KWvYVup.i0lzZW3r00ue(SkdK71rGR8E7)
LPfvj1t4BQEU = WqUC3KWvYVup.dRFAC59yQBm_(SkdK71rGR8E7 > (hzJ_cl7tr24o - wmN3dvez4qzC) / WqUC3KWvYVup.arange(ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1264 - 1215), 8), UyakMW2IMFEj + ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\157' + '\061', 8)))[ehT0Px3KOsy9('\x30' + '\157' + chr(0b110000), 8)][-ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061', 8)]
E2KkDYRi6XTa = WqUC3KWvYVup.tsdjvlgh9gDP([ehT0Px3KOsy9(chr(0b110000) + chr(0b111010 + 0o65) + chr(59 - 11), 8), (hzJ_cl7tr24o[LPfvj1t4BQEU] - wmN3dvez4qzC) / (LPfvj1t4BQEU + ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b101000 + 0o11), 8))])
AOfzRywRzEXp = cMbll0QYhULo - E2KkDYRi6XTa
AOfzRywRzEXp[AOfzRywRzEXp < ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(48), 8)] = ehT0Px3KOsy9(chr(1811 - 1763) + chr(9049 - 8938) + chr(0b110000), 8)
return AOfzRywRzEXp
|
quantopian/zipline
|
zipline/examples/__init__.py
|
run_example
|
def run_example(example_name, environ):
"""
Run an example module from zipline.examples.
"""
mod = EXAMPLE_MODULES[example_name]
register_calendar("YAHOO", get_calendar("NYSE"), force=True)
return run_algorithm(
initialize=getattr(mod, 'initialize', None),
handle_data=getattr(mod, 'handle_data', None),
before_trading_start=getattr(mod, 'before_trading_start', None),
analyze=getattr(mod, 'analyze', None),
bundle='test',
environ=environ,
# Provide a default capital base, but allow the test to override.
**merge({'capital_base': 1e7}, mod._test_args())
)
|
python
|
def run_example(example_name, environ):
"""
Run an example module from zipline.examples.
"""
mod = EXAMPLE_MODULES[example_name]
register_calendar("YAHOO", get_calendar("NYSE"), force=True)
return run_algorithm(
initialize=getattr(mod, 'initialize', None),
handle_data=getattr(mod, 'handle_data', None),
before_trading_start=getattr(mod, 'before_trading_start', None),
analyze=getattr(mod, 'analyze', None),
bundle='test',
environ=environ,
# Provide a default capital base, but allow the test to override.
**merge({'capital_base': 1e7}, mod._test_args())
)
|
[
"def",
"run_example",
"(",
"example_name",
",",
"environ",
")",
":",
"mod",
"=",
"EXAMPLE_MODULES",
"[",
"example_name",
"]",
"register_calendar",
"(",
"\"YAHOO\"",
",",
"get_calendar",
"(",
"\"NYSE\"",
")",
",",
"force",
"=",
"True",
")",
"return",
"run_algorithm",
"(",
"initialize",
"=",
"getattr",
"(",
"mod",
",",
"'initialize'",
",",
"None",
")",
",",
"handle_data",
"=",
"getattr",
"(",
"mod",
",",
"'handle_data'",
",",
"None",
")",
",",
"before_trading_start",
"=",
"getattr",
"(",
"mod",
",",
"'before_trading_start'",
",",
"None",
")",
",",
"analyze",
"=",
"getattr",
"(",
"mod",
",",
"'analyze'",
",",
"None",
")",
",",
"bundle",
"=",
"'test'",
",",
"environ",
"=",
"environ",
",",
"# Provide a default capital base, but allow the test to override.",
"*",
"*",
"merge",
"(",
"{",
"'capital_base'",
":",
"1e7",
"}",
",",
"mod",
".",
"_test_args",
"(",
")",
")",
")"
] |
Run an example module from zipline.examples.
|
[
"Run",
"an",
"example",
"module",
"from",
"zipline",
".",
"examples",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/examples/__init__.py#L64-L81
|
train
|
Run an example module from zipline. examples.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2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wkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\x6f' + chr(0b10110 + 0o35) + chr(0b110011) + chr(2573 - 2518), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + chr(1283 - 1235), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\064' + chr(53), 0o10), ehT0Px3KOsy9(chr(2140 - 2092) + chr(685 - 574) + chr(0b110001) + '\060', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(1761 - 1708), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(50) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(111) + chr(0b110010) + '\063' + chr(0b11110 + 0o22), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(231 - 179) + chr(0b110000), 18868 - 18860), ehT0Px3KOsy9(chr(48) + chr(0b1001101 + 0o42) + chr(0b1011 + 0o47) + chr(0b11111 + 0o27), 0b1000), ehT0Px3KOsy9(chr(1343 - 1295) + chr(0b1101111) + '\061' + chr(0b110001) + chr(0b100110 + 0o15), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(626 - 577) + chr(2743 - 2689) + chr(0b101100 + 0o13), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(1418 - 1363) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(49), 0b1000), ehT0Px3KOsy9(chr(655 - 607) + chr(4562 - 4451) + '\x31' + chr(0b110101) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(50) + chr(1952 - 1900), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011101 + 0o22) + chr(0b11001 + 0o33) + chr(0b10110 + 0o40), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100100 + 0o13) + chr(0b110001 + 0o0) + chr(0b110000) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(0b110011) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100010 + 0o15) + chr(2184 - 2134) + chr(53) + '\x37', 53132 - 53124), ehT0Px3KOsy9('\x30' + chr(1950 - 1839) + chr(0b110010) + '\065' + chr(55), 8), ehT0Px3KOsy9(chr(976 - 928) + '\157' + '\x37' + chr(0b101011 + 0o5), 51740 - 51732), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b110001) + chr(54), 28731 - 28723), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1237 - 1188) + chr(1545 - 1493) + chr(0b100100 + 0o14), 55674 - 55666), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + '\063' + chr(0b11010 + 0o33) + chr(0b1 + 0o65), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11222 - 11111) + chr(1326 - 1277) + chr(0b10001 + 0o46) + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + chr(1911 - 1861) + chr(0b110010) + chr(55), 44770 - 44762), ehT0Px3KOsy9(chr(48) + chr(11300 - 11189) + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(205 - 156) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(1573 - 1525) + chr(0b11101 + 0o122) + chr(1960 - 1911) + chr(721 - 671) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + '\061' + chr(0b110001) + chr(0b100111 + 0o14), 8), ehT0Px3KOsy9(chr(1194 - 1146) + chr(111) + chr(0b110001) + '\061' + chr(1409 - 1358), 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b1 + 0o60) + chr(0b1100 + 0o47) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b101100 + 0o103) + chr(0b10000 + 0o41) + chr(0b110100) + chr(0b1110 + 0o43), 27516 - 27508), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1282 - 1233) + chr(0b110001) + chr(1477 - 1424), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + '\x32' + '\064', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11000 + 0o31) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(4261 - 4150) + chr(0b110001) + chr(50) + chr(349 - 300), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11 + 0o56) + chr(0b110011) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(1708 - 1658) + chr(2246 - 2194), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1100 + 0o46) + '\060' + chr(0b11101 + 0o24), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1000011 + 0o54) + chr(53) + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf1'), '\144' + chr(0b110100 + 0o61) + chr(0b1001001 + 0o32) + chr(943 - 832) + chr(0b1100100) + chr(2911 - 2810))(chr(0b1110101) + '\164' + '\x66' + chr(45) + chr(0b10010 + 0o46)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def uRwTRqMhSz9I(lWQuNalyfmvP, rNK60KZ67nXB):
JHJR37KvkQhF = TfHb5cZy6iz5[lWQuNalyfmvP]
ALBO0Zdve_mP(xafqLlk3kkUe(SXOLrMavuUCe(b'\x86ImGZ'), chr(100) + chr(0b1100101) + chr(99) + chr(9561 - 9450) + '\x64' + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b1000011 + 0o43) + '\x2d' + chr(0b111000)), qV4fO1AoRtpp(xafqLlk3kkUe(SXOLrMavuUCe(b'\x91QvM'), '\x64' + chr(0b1100101) + chr(0b110101 + 0o56) + chr(11979 - 11868) + '\144' + chr(0b1010101 + 0o20))(chr(117) + chr(0b100111 + 0o115) + chr(102) + chr(45) + '\x38')), force=ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(301 - 252), 0b1000))
return B4uIs1QwnOgb(initialize=xafqLlk3kkUe(JHJR37KvkQhF, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6fL||\xb5\xf4Il.'), chr(0b10 + 0o142) + chr(1102 - 1001) + chr(0b1100011) + chr(1917 - 1806) + chr(0b10100 + 0o120) + '\x65')(chr(0b100000 + 0o125) + chr(116) + chr(0b1100110) + chr(45) + chr(0b110111 + 0o1)), None), handle_data=xafqLlk3kkUe(JHJR37KvkQhF, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7iKly\xb1\xc7Dw?\x16'), chr(0b1100100) + chr(101) + '\x63' + '\x6f' + chr(100) + chr(0b11111 + 0o106))(chr(0b1110101) + chr(0b110010 + 0o102) + '\146' + chr(45) + '\070'), None), before_trading_start=xafqLlk3kkUe(JHJR37KvkQhF, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbdmCgg\xb1\xc7Td*\x13W\x7f\x0e\x0bU5=\xdd\xdb'), chr(0b1011001 + 0o13) + chr(2991 - 2890) + '\143' + chr(0b1100010 + 0o15) + chr(0b1100001 + 0o3) + chr(101))(chr(0b1110101) + chr(9023 - 8907) + chr(8642 - 8540) + chr(1282 - 1237) + chr(0b111000)), None), analyze=xafqLlk3kkUe(JHJR37KvkQhF, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbefDdl\xae\xfd'), chr(100) + '\x65' + chr(0b1010000 + 0o23) + '\x6f' + chr(6760 - 6660) + chr(8729 - 8628))(chr(117) + chr(0b1110 + 0o146) + chr(0b1100000 + 0o6) + chr(45) + chr(0b10111 + 0o41)), None), bundle=xafqLlk3kkUe(SXOLrMavuUCe(b'\xabmV|'), chr(313 - 213) + chr(101) + chr(8347 - 8248) + chr(0b1101111) + chr(100) + '\145')(chr(0b1110101) + chr(7975 - 7859) + chr(3497 - 3395) + '\055' + chr(56)), environ=rNK60KZ67nXB, **mP5l0dPhBkus({xafqLlk3kkUe(SXOLrMavuUCe(b'\xbciUaa\xb5\xf4\x7ft*\x04['), '\x64' + chr(0b1100101) + '\143' + '\x6f' + chr(100) + chr(101))(chr(2411 - 2294) + '\164' + chr(0b1100110) + '\055' + chr(0b1000 + 0o60)): 10000000.0}, xafqLlk3kkUe(JHJR37KvkQhF, xafqLlk3kkUe(SXOLrMavuUCe(b'\x80|@{a\x8b\xf9Rq8'), '\144' + '\145' + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(0b100000 + 0o105))(chr(117) + chr(116) + '\146' + chr(0b10010 + 0o33) + chr(0b111000)))()))
|
quantopian/zipline
|
zipline/pipeline/factors/statistical.py
|
vectorized_beta
|
def vectorized_beta(dependents, independent, allowed_missing, out=None):
"""
Compute slopes of linear regressions between columns of ``dependents`` and
``independent``.
Parameters
----------
dependents : np.array[N, M]
Array with columns of data to be regressed against ``independent``.
independent : np.array[N, 1]
Independent variable of the regression
allowed_missing : int
Number of allowed missing (NaN) observations per column. Columns with
more than this many non-nan observations in both ``dependents`` and
``independents`` will output NaN as the regression coefficient.
Returns
-------
slopes : np.array[M]
Linear regression coefficients for each column of ``dependents``.
"""
# Cache these as locals since we're going to call them multiple times.
nan = np.nan
isnan = np.isnan
N, M = dependents.shape
if out is None:
out = np.full(M, nan)
# Copy N times as a column vector and fill with nans to have the same
# missing value pattern as the dependent variable.
#
# PERF_TODO: We could probably avoid the space blowup by doing this in
# Cython.
# shape: (N, M)
independent = np.where(
isnan(dependents),
nan,
independent,
)
# Calculate beta as Cov(X, Y) / Cov(X, X).
# https://en.wikipedia.org/wiki/Simple_linear_regression#Fitting_the_regression_line # noqa
#
# NOTE: The usual formula for covariance is::
#
# mean((X - mean(X)) * (Y - mean(Y)))
#
# However, we don't actually need to take the mean of both sides of the
# product, because of the folllowing equivalence::
#
# Let X_res = (X - mean(X)).
# We have:
#
# mean(X_res * (Y - mean(Y))) = mean(X_res * (Y - mean(Y)))
# (1) = mean((X_res * Y) - (X_res * mean(Y)))
# (2) = mean(X_res * Y) - mean(X_res * mean(Y))
# (3) = mean(X_res * Y) - mean(X_res) * mean(Y)
# (4) = mean(X_res * Y) - 0 * mean(Y)
# (5) = mean(X_res * Y)
#
#
# The tricky step in the above derivation is step (4). We know that
# mean(X_res) is zero because, for any X:
#
# mean(X - mean(X)) = mean(X) - mean(X) = 0.
#
# The upshot of this is that we only have to center one of `independent`
# and `dependent` when calculating covariances. Since we need the centered
# `independent` to calculate its variance in the next step, we choose to
# center `independent`.
# shape: (N, M)
ind_residual = independent - nanmean(independent, axis=0)
# shape: (M,)
covariances = nanmean(ind_residual * dependents, axis=0)
# We end up with different variances in each column here because each
# column may have a different subset of the data dropped due to missing
# data in the corresponding dependent column.
# shape: (M,)
independent_variances = nanmean(ind_residual ** 2, axis=0)
# shape: (M,)
np.divide(covariances, independent_variances, out=out)
# Write nans back to locations where we have more then allowed number of
# missing entries.
nanlocs = isnan(independent).sum(axis=0) > allowed_missing
out[nanlocs] = nan
return out
|
python
|
def vectorized_beta(dependents, independent, allowed_missing, out=None):
"""
Compute slopes of linear regressions between columns of ``dependents`` and
``independent``.
Parameters
----------
dependents : np.array[N, M]
Array with columns of data to be regressed against ``independent``.
independent : np.array[N, 1]
Independent variable of the regression
allowed_missing : int
Number of allowed missing (NaN) observations per column. Columns with
more than this many non-nan observations in both ``dependents`` and
``independents`` will output NaN as the regression coefficient.
Returns
-------
slopes : np.array[M]
Linear regression coefficients for each column of ``dependents``.
"""
# Cache these as locals since we're going to call them multiple times.
nan = np.nan
isnan = np.isnan
N, M = dependents.shape
if out is None:
out = np.full(M, nan)
# Copy N times as a column vector and fill with nans to have the same
# missing value pattern as the dependent variable.
#
# PERF_TODO: We could probably avoid the space blowup by doing this in
# Cython.
# shape: (N, M)
independent = np.where(
isnan(dependents),
nan,
independent,
)
# Calculate beta as Cov(X, Y) / Cov(X, X).
# https://en.wikipedia.org/wiki/Simple_linear_regression#Fitting_the_regression_line # noqa
#
# NOTE: The usual formula for covariance is::
#
# mean((X - mean(X)) * (Y - mean(Y)))
#
# However, we don't actually need to take the mean of both sides of the
# product, because of the folllowing equivalence::
#
# Let X_res = (X - mean(X)).
# We have:
#
# mean(X_res * (Y - mean(Y))) = mean(X_res * (Y - mean(Y)))
# (1) = mean((X_res * Y) - (X_res * mean(Y)))
# (2) = mean(X_res * Y) - mean(X_res * mean(Y))
# (3) = mean(X_res * Y) - mean(X_res) * mean(Y)
# (4) = mean(X_res * Y) - 0 * mean(Y)
# (5) = mean(X_res * Y)
#
#
# The tricky step in the above derivation is step (4). We know that
# mean(X_res) is zero because, for any X:
#
# mean(X - mean(X)) = mean(X) - mean(X) = 0.
#
# The upshot of this is that we only have to center one of `independent`
# and `dependent` when calculating covariances. Since we need the centered
# `independent` to calculate its variance in the next step, we choose to
# center `independent`.
# shape: (N, M)
ind_residual = independent - nanmean(independent, axis=0)
# shape: (M,)
covariances = nanmean(ind_residual * dependents, axis=0)
# We end up with different variances in each column here because each
# column may have a different subset of the data dropped due to missing
# data in the corresponding dependent column.
# shape: (M,)
independent_variances = nanmean(ind_residual ** 2, axis=0)
# shape: (M,)
np.divide(covariances, independent_variances, out=out)
# Write nans back to locations where we have more then allowed number of
# missing entries.
nanlocs = isnan(independent).sum(axis=0) > allowed_missing
out[nanlocs] = nan
return out
|
[
"def",
"vectorized_beta",
"(",
"dependents",
",",
"independent",
",",
"allowed_missing",
",",
"out",
"=",
"None",
")",
":",
"# Cache these as locals since we're going to call them multiple times.",
"nan",
"=",
"np",
".",
"nan",
"isnan",
"=",
"np",
".",
"isnan",
"N",
",",
"M",
"=",
"dependents",
".",
"shape",
"if",
"out",
"is",
"None",
":",
"out",
"=",
"np",
".",
"full",
"(",
"M",
",",
"nan",
")",
"# Copy N times as a column vector and fill with nans to have the same",
"# missing value pattern as the dependent variable.",
"#",
"# PERF_TODO: We could probably avoid the space blowup by doing this in",
"# Cython.",
"# shape: (N, M)",
"independent",
"=",
"np",
".",
"where",
"(",
"isnan",
"(",
"dependents",
")",
",",
"nan",
",",
"independent",
",",
")",
"# Calculate beta as Cov(X, Y) / Cov(X, X).",
"# https://en.wikipedia.org/wiki/Simple_linear_regression#Fitting_the_regression_line # noqa",
"#",
"# NOTE: The usual formula for covariance is::",
"#",
"# mean((X - mean(X)) * (Y - mean(Y)))",
"#",
"# However, we don't actually need to take the mean of both sides of the",
"# product, because of the folllowing equivalence::",
"#",
"# Let X_res = (X - mean(X)).",
"# We have:",
"#",
"# mean(X_res * (Y - mean(Y))) = mean(X_res * (Y - mean(Y)))",
"# (1) = mean((X_res * Y) - (X_res * mean(Y)))",
"# (2) = mean(X_res * Y) - mean(X_res * mean(Y))",
"# (3) = mean(X_res * Y) - mean(X_res) * mean(Y)",
"# (4) = mean(X_res * Y) - 0 * mean(Y)",
"# (5) = mean(X_res * Y)",
"#",
"#",
"# The tricky step in the above derivation is step (4). We know that",
"# mean(X_res) is zero because, for any X:",
"#",
"# mean(X - mean(X)) = mean(X) - mean(X) = 0.",
"#",
"# The upshot of this is that we only have to center one of `independent`",
"# and `dependent` when calculating covariances. Since we need the centered",
"# `independent` to calculate its variance in the next step, we choose to",
"# center `independent`.",
"# shape: (N, M)",
"ind_residual",
"=",
"independent",
"-",
"nanmean",
"(",
"independent",
",",
"axis",
"=",
"0",
")",
"# shape: (M,)",
"covariances",
"=",
"nanmean",
"(",
"ind_residual",
"*",
"dependents",
",",
"axis",
"=",
"0",
")",
"# We end up with different variances in each column here because each",
"# column may have a different subset of the data dropped due to missing",
"# data in the corresponding dependent column.",
"# shape: (M,)",
"independent_variances",
"=",
"nanmean",
"(",
"ind_residual",
"**",
"2",
",",
"axis",
"=",
"0",
")",
"# shape: (M,)",
"np",
".",
"divide",
"(",
"covariances",
",",
"independent_variances",
",",
"out",
"=",
"out",
")",
"# Write nans back to locations where we have more then allowed number of",
"# missing entries.",
"nanlocs",
"=",
"isnan",
"(",
"independent",
")",
".",
"sum",
"(",
"axis",
"=",
"0",
")",
">",
"allowed_missing",
"out",
"[",
"nanlocs",
"]",
"=",
"nan",
"return",
"out"
] |
Compute slopes of linear regressions between columns of ``dependents`` and
``independent``.
Parameters
----------
dependents : np.array[N, M]
Array with columns of data to be regressed against ``independent``.
independent : np.array[N, 1]
Independent variable of the regression
allowed_missing : int
Number of allowed missing (NaN) observations per column. Columns with
more than this many non-nan observations in both ``dependents`` and
``independents`` will output NaN as the regression coefficient.
Returns
-------
slopes : np.array[M]
Linear regression coefficients for each column of ``dependents``.
|
[
"Compute",
"slopes",
"of",
"linear",
"regressions",
"between",
"columns",
"of",
"dependents",
"and",
"independent",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/factors/statistical.py#L572-L665
|
train
|
Compute the beta of a set of variables for each column of dependents and independent.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,G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lZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(55) + chr(0b101110 + 0o2), 34450 - 34442), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(789 - 739) + chr(0b110010) + chr(970 - 919), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(3654 - 3543) + chr(0b110110) + chr(0b110010), 22998 - 22990), ehT0Px3KOsy9(chr(48) + chr(10037 - 9926) + chr(2450 - 2399) + '\x32' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11100 + 0o27) + chr(0b110100) + chr(0b110011), 13224 - 13216), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(0b110000 + 0o2) + chr(2224 - 2176), 47502 - 47494), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\x30' + chr(52), 39216 - 39208), ehT0Px3KOsy9('\060' + chr(706 - 595) + chr(2186 - 2137) + chr(519 - 468) + chr(2117 - 2067), ord("\x08")), ehT0Px3KOsy9(chr(1998 - 1950) + '\x6f' + chr(50) + '\066' + '\x33', 0o10), ehT0Px3KOsy9(chr(2140 - 2092) + chr(2345 - 2234) + '\061' + '\x32' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(441 - 393) + chr(8106 - 7995) + chr(0b1101 + 0o45) + chr(0b110111) + chr(0b10011 + 0o37), 0o10), ehT0Px3KOsy9(chr(48) + chr(8703 - 8592) + chr(0b110011) + chr(0b100010 + 0o24) + chr(2658 - 2603), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(51) + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + '\062' + '\x30', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(53) + '\x34', 0b1000), ehT0Px3KOsy9(chr(685 - 637) + '\157' + chr(50) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b100 + 0o153) + chr(49) + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11111 + 0o24) + chr(0b100 + 0o56) + chr(1426 - 1374), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(586 - 537) + chr(52) + chr(1788 - 1736), 0o10), ehT0Px3KOsy9('\060' + chr(0b111010 + 0o65) + '\x33' + chr(0b110001) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101000 + 0o7) + chr(50) + chr(48) + '\063', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101101 + 0o2) + '\062' + chr(0b11011 + 0o26) + chr(0b10011 + 0o36), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + '\x34' + chr(1445 - 1397), 62955 - 62947), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1 + 0o62) + chr(0b1011 + 0o51) + '\x33', 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(55) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(725 - 677) + chr(111) + '\x32' + chr(1494 - 1441) + chr(0b10011 + 0o35), 14845 - 14837), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b11011 + 0o124) + chr(0b10011 + 0o37) + chr(54) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(651 - 603) + '\x6f' + chr(50) + chr(0b100001 + 0o20) + chr(1419 - 1364), 0o10), ehT0Px3KOsy9('\060' + chr(12077 - 11966) + '\x31' + chr(0b110 + 0o56) + chr(48), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x37' + chr(48), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b101 + 0o54) + '\x30', 50033 - 50025), ehT0Px3KOsy9(chr(849 - 801) + '\x6f' + '\x33' + chr(49) + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(0b11001 + 0o31) + chr(0b100 + 0o63), 0o10), ehT0Px3KOsy9(chr(2283 - 2235) + chr(111) + chr(0b110010 + 0o0) + chr(0b100110 + 0o12) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(5215 - 5104) + '\x32' + '\067' + chr(50), 8), ehT0Px3KOsy9(chr(572 - 524) + chr(111) + chr(49) + chr(0b110001) + '\061', 41636 - 41628), ehT0Px3KOsy9('\x30' + chr(0b101010 + 0o105) + chr(0b110011) + '\x37' + chr(0b100001 + 0o26), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000100 + 0o53) + chr(0b110011) + '\066' + '\064', 30682 - 30674), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1101111) + chr(50) + chr(2598 - 2545) + chr(52), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(48) + chr(0b11011 + 0o25), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(4525 - 4414) + '\065' + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x16'), chr(5458 - 5358) + chr(0b1100101) + chr(5264 - 5165) + '\x6f' + '\144' + chr(9483 - 9382))(chr(12381 - 12264) + chr(0b1110100) + chr(102) + chr(193 - 148) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ZXuGTbC5wYxr(hiuVGwNJvZZN, nMrH1_Xib0Nw, hCOL4d9zGwt9, UkrMp_I0RDmo=None):
wL5W1xj47aOd = WqUC3KWvYVup.nan
wN4RVZAxJEhp = WqUC3KWvYVup.wN4RVZAxJEhp
(vn4sOrFiSB4c, ed0oVQ7n0Y_q) = hiuVGwNJvZZN.nauYfLglTpcb
if UkrMp_I0RDmo is None:
UkrMp_I0RDmo = WqUC3KWvYVup.full(ed0oVQ7n0Y_q, wL5W1xj47aOd)
nMrH1_Xib0Nw = WqUC3KWvYVup.dRFAC59yQBm_(wN4RVZAxJEhp(hiuVGwNJvZZN), wL5W1xj47aOd, nMrH1_Xib0Nw)
of9xJCtDS4i6 = nMrH1_Xib0Nw - urRpF0TT1DTC(nMrH1_Xib0Nw, axis=ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11110 + 0o22), 0b1000))
YYhjzigd821G = urRpF0TT1DTC(of9xJCtDS4i6 * hiuVGwNJvZZN, axis=ehT0Px3KOsy9('\x30' + chr(1600 - 1489) + chr(1133 - 1085), 8))
ePkFyrc0HTBn = urRpF0TT1DTC(of9xJCtDS4i6 ** ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010), 21051 - 21043), axis=ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1000001 + 0o56) + chr(0b110000), 8))
xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\\\xfaD\xbd\x875'), chr(4704 - 4604) + chr(8504 - 8403) + '\x63' + '\x6f' + '\x64' + chr(0b1100101))('\x75' + chr(116) + chr(102) + chr(0b0 + 0o55) + '\070'))(YYhjzigd821G, ePkFyrc0HTBn, out=UkrMp_I0RDmo)
_XbuLQ5zu9t9 = wN4RVZAxJEhp(nMrH1_Xib0Nw).xkxBmo49x2An(axis=ehT0Px3KOsy9(chr(390 - 342) + chr(0b1101111) + chr(0b1101 + 0o43), 8)) > hCOL4d9zGwt9
UkrMp_I0RDmo[_XbuLQ5zu9t9] = wL5W1xj47aOd
return UkrMp_I0RDmo
|
quantopian/zipline
|
zipline/data/treasuries_can.py
|
_format_url
|
def _format_url(instrument_type,
instrument_ids,
start_date,
end_date,
earliest_allowed_date):
"""
Format a URL for loading data from Bank of Canada.
"""
return (
"http://www.bankofcanada.ca/stats/results/csv"
"?lP=lookup_{instrument_type}_yields.php"
"&sR={restrict}"
"&se={instrument_ids}"
"&dF={start}"
"&dT={end}".format(
instrument_type=instrument_type,
instrument_ids='-'.join(map(prepend("L_"), instrument_ids)),
restrict=earliest_allowed_date.strftime("%Y-%m-%d"),
start=start_date.strftime("%Y-%m-%d"),
end=end_date.strftime("%Y-%m-%d"),
)
)
|
python
|
def _format_url(instrument_type,
instrument_ids,
start_date,
end_date,
earliest_allowed_date):
"""
Format a URL for loading data from Bank of Canada.
"""
return (
"http://www.bankofcanada.ca/stats/results/csv"
"?lP=lookup_{instrument_type}_yields.php"
"&sR={restrict}"
"&se={instrument_ids}"
"&dF={start}"
"&dT={end}".format(
instrument_type=instrument_type,
instrument_ids='-'.join(map(prepend("L_"), instrument_ids)),
restrict=earliest_allowed_date.strftime("%Y-%m-%d"),
start=start_date.strftime("%Y-%m-%d"),
end=end_date.strftime("%Y-%m-%d"),
)
)
|
[
"def",
"_format_url",
"(",
"instrument_type",
",",
"instrument_ids",
",",
"start_date",
",",
"end_date",
",",
"earliest_allowed_date",
")",
":",
"return",
"(",
"\"http://www.bankofcanada.ca/stats/results/csv\"",
"\"?lP=lookup_{instrument_type}_yields.php\"",
"\"&sR={restrict}\"",
"\"&se={instrument_ids}\"",
"\"&dF={start}\"",
"\"&dT={end}\"",
".",
"format",
"(",
"instrument_type",
"=",
"instrument_type",
",",
"instrument_ids",
"=",
"'-'",
".",
"join",
"(",
"map",
"(",
"prepend",
"(",
"\"L_\"",
")",
",",
"instrument_ids",
")",
")",
",",
"restrict",
"=",
"earliest_allowed_date",
".",
"strftime",
"(",
"\"%Y-%m-%d\"",
")",
",",
"start",
"=",
"start_date",
".",
"strftime",
"(",
"\"%Y-%m-%d\"",
")",
",",
"end",
"=",
"end_date",
".",
"strftime",
"(",
"\"%Y-%m-%d\"",
")",
",",
")",
")"
] |
Format a URL for loading data from Bank of Canada.
|
[
"Format",
"a",
"URL",
"for",
"loading",
"data",
"from",
"Bank",
"of",
"Canada",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/treasuries_can.py#L39-L60
|
train
|
Format a URL for loading data from Bank of Canada.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,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,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(961 - 912) + '\067' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(7298 - 7187) + '\x33' + chr(0b110000 + 0o0) + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011001 + 0o26) + chr(50) + chr(0b101110 + 0o3) + chr(2097 - 2048), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(54) + chr(0b100101 + 0o21), 39889 - 39881), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(54) + chr(95 - 43), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2381 - 2330) + chr(233 - 178) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b110101 + 0o0) + '\062', 41063 - 41055), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + '\x32' + chr(0b110010), 49159 - 49151), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + '\063' + chr(0b110110), 57636 - 57628), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + chr(2067 - 2016) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110111 + 0o70) + chr(0b100111 + 0o15) + chr(55), 0o10), ehT0Px3KOsy9('\x30' + chr(11230 - 11119) + chr(53) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\066' + '\060', 18018 - 18010), ehT0Px3KOsy9(chr(204 - 156) + '\x6f' + chr(0b110010) + chr(0b110100 + 0o2) + chr(0b110001 + 0o2), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(9889 - 9778) + '\x33' + chr(0b10001 + 0o37), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b11000 + 0o31) + chr(2580 - 2529) + chr(780 - 731), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(0b110010) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + '\064' + chr(54), 0o10), ehT0Px3KOsy9(chr(2057 - 2009) + chr(0b1101111) + '\x31' + '\x31' + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\065' + '\065', 8), ehT0Px3KOsy9('\x30' + chr(111) + '\x36' + chr(1672 - 1622), 0o10), ehT0Px3KOsy9(chr(678 - 630) + '\x6f' + chr(1730 - 1680) + '\x35' + chr(0b10011 + 0o41), 40308 - 40300), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(0b10 + 0o64) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\157' + chr(1481 - 1431) + '\x33' + chr(1490 - 1437), 47823 - 47815), ehT0Px3KOsy9('\060' + chr(0b1011010 + 0o25) + '\061' + chr(0b110011) + chr(306 - 255), 0b1000), ehT0Px3KOsy9('\x30' + chr(9769 - 9658) + '\x31' + chr(0b110111) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(10432 - 10321) + chr(2245 - 2193) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1389 - 1338) + '\066' + '\064', 8), ehT0Px3KOsy9(chr(48) + chr(0b110010 + 0o75) + '\x36' + chr(52), 12585 - 12577), ehT0Px3KOsy9(chr(48) + chr(4041 - 3930) + '\061' + '\066' + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(6497 - 6386) + chr(0b11011 + 0o26) + chr(1250 - 1200) + chr(52), 41516 - 41508), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + '\x36' + chr(0b100101 + 0o22), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b11 + 0o154) + chr(412 - 362) + chr(0b110110) + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1001111 + 0o40) + chr(2545 - 2494) + chr(0b10001 + 0o43) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\157' + chr(1125 - 1074) + chr(274 - 224) + '\x34', 39987 - 39979), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2220 - 2171) + chr(0b101101 + 0o7) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + chr(0b100 + 0o56) + chr(879 - 829) + '\x34', 54222 - 54214), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + '\061' + chr(1653 - 1602), 19186 - 19178), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(0b1110 + 0o46) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b100 + 0o54) + chr(49), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1035 - 987) + '\x6f' + chr(53) + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'T'), chr(100) + chr(0b1100101) + '\143' + '\157' + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b1100110) + '\x2d' + chr(0b10010 + 0o46)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def _sKsDQJNU3M5(EUxhubQFd0bs, pmym0rK0L76F, NcwNd9gvgEB5, joOGoPpJ_sck, xbMv1yaBnhev):
return xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x12\xb7\xfd\x86\xce\xd1E%\xe9\xac\tOQ\xdds6\xb1\xc5,CS\xc8\x12\xb38\x19\x0f\x87@\x17 \x84\x98\x94\xb1\x17\xe1\xe7\x94\xb2U\xa0\xfa\x80\xcb\x92:o\xf2\xb4HFE\xc3G"\xbe\xc8>Y@\xd9\x1e\xf85\x0c\x7f\x80M\x061\x8a\xe8\x9f\xbd\x01\xf8\xef\x93\xef\n\xab\xf9\xd0\x87\xacW)\xec\xbeTYB\xda{-\xaa\x80>H\x0f\xd7\x1a\xf3(\x0cR\x81Y\x13:\x83\xe8\x8f\xb0\x17\xe9\xad\x84\x87G\xb8\xfa\x82\x95\x8c\x1e/\xb8\xbfs\x10K\xd6v=\xaa'), '\144' + chr(0b1100101) + '\x63' + chr(0b1101111) + '\x64' + '\x65')('\165' + chr(0b111000 + 0o74) + chr(1947 - 1845) + '\055' + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b',\xf7\xfb\x99\xbc\x9f9a\xce\xabBG'), chr(100) + chr(0b100110 + 0o77) + chr(7739 - 7640) + chr(0b1001101 + 0o42) + chr(100) + chr(4829 - 4728))(chr(0b1 + 0o164) + chr(116) + chr(102) + chr(868 - 823) + '\070'))(instrument_type=EUxhubQFd0bs, instrument_ids=xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'W'), chr(1444 - 1344) + '\145' + '\x63' + chr(11773 - 11662) + '\144' + '\x65')('\x75' + '\x74' + chr(0b1010 + 0o134) + chr(1167 - 1122) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'%\xac\xde\xae\x8e\x8a<\x1c\xf0\xaaok'), '\144' + chr(0b1100101) + chr(99) + chr(0b1 + 0o156) + chr(0b1100100) + '\145')('\165' + chr(0b1000001 + 0o63) + '\x66' + chr(0b100110 + 0o7) + chr(232 - 176)))(abA97kOQKaLo(vB8WhsoLOtpG(xafqLlk3kkUe(SXOLrMavuUCe(b'6\x9c'), chr(0b1100011 + 0o1) + '\x65' + chr(99) + chr(111) + '\x64' + chr(101))(chr(7220 - 7103) + '\x74' + chr(102) + chr(0b101101) + '\070')), pmym0rK0L76F)), restrict=xafqLlk3kkUe(xbMv1yaBnhev, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xb7\xfb\x90\x80\x97\x077'), chr(0b10101 + 0o117) + chr(0b1100101) + '\143' + '\x6f' + chr(0b1001 + 0o133) + chr(0b1100101))(chr(0b1101011 + 0o12) + chr(116) + '\146' + chr(0b101101) + chr(3092 - 3036)))(xafqLlk3kkUe(SXOLrMavuUCe(b'_\x9a\xa4\xd3\x99\xd3O6'), '\x64' + '\x65' + chr(99) + chr(0b1101111) + '\144' + chr(101))(chr(117) + chr(0b1110100) + '\146' + chr(1512 - 1467) + chr(56))), start=xafqLlk3kkUe(NcwNd9gvgEB5, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xb7\xfb\x90\x80\x97\x077'), chr(100) + chr(101) + chr(99) + '\157' + chr(100) + '\x65')('\x75' + '\x74' + chr(7015 - 6913) + chr(1835 - 1790) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'_\x9a\xa4\xd3\x99\xd3O6'), chr(0b10 + 0o142) + '\x65' + chr(99) + '\x6f' + chr(0b1100100) + '\x65')('\x75' + chr(0b1100100 + 0o20) + '\x66' + chr(1604 - 1559) + chr(0b111000))), end=xafqLlk3kkUe(joOGoPpJ_sck, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xb7\xfb\x90\x80\x97\x077'), chr(0b1100100) + '\145' + chr(4145 - 4046) + chr(111) + '\x64' + chr(4556 - 4455))(chr(0b1110101) + '\164' + '\x66' + chr(0b11010 + 0o23) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'_\x9a\xa4\xd3\x99\xd3O6'), chr(100) + chr(3444 - 3343) + '\x63' + chr(0b1101111) + chr(7847 - 7747) + chr(0b111010 + 0o53))(chr(0b1110101) + chr(116) + chr(0b1010001 + 0o25) + '\x2d' + chr(841 - 785))))
|
quantopian/zipline
|
zipline/data/treasuries_can.py
|
load_frame
|
def load_frame(url, skiprows):
"""
Load a DataFrame of data from a Bank of Canada site.
"""
return pd.read_csv(
url,
skiprows=skiprows,
skipinitialspace=True,
na_values=["Bank holiday", "Not available"],
parse_dates=["Date"],
index_col="Date",
).dropna(how='all') \
.tz_localize('UTC') \
.rename(columns=COLUMN_NAMES)
|
python
|
def load_frame(url, skiprows):
"""
Load a DataFrame of data from a Bank of Canada site.
"""
return pd.read_csv(
url,
skiprows=skiprows,
skipinitialspace=True,
na_values=["Bank holiday", "Not available"],
parse_dates=["Date"],
index_col="Date",
).dropna(how='all') \
.tz_localize('UTC') \
.rename(columns=COLUMN_NAMES)
|
[
"def",
"load_frame",
"(",
"url",
",",
"skiprows",
")",
":",
"return",
"pd",
".",
"read_csv",
"(",
"url",
",",
"skiprows",
"=",
"skiprows",
",",
"skipinitialspace",
"=",
"True",
",",
"na_values",
"=",
"[",
"\"Bank holiday\"",
",",
"\"Not available\"",
"]",
",",
"parse_dates",
"=",
"[",
"\"Date\"",
"]",
",",
"index_col",
"=",
"\"Date\"",
",",
")",
".",
"dropna",
"(",
"how",
"=",
"'all'",
")",
".",
"tz_localize",
"(",
"'UTC'",
")",
".",
"rename",
"(",
"columns",
"=",
"COLUMN_NAMES",
")"
] |
Load a DataFrame of data from a Bank of Canada site.
|
[
"Load",
"a",
"DataFrame",
"of",
"data",
"from",
"a",
"Bank",
"of",
"Canada",
"site",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/treasuries_can.py#L67-L80
|
train
|
Load a DataFrame of data from a Bank of Canada site.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmC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UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101 + 0o55) + '\061' + chr(0b110000 + 0o0), 0o10), ehT0Px3KOsy9(chr(1314 - 1266) + chr(111) + chr(0b101110 + 0o5) + '\063' + chr(1250 - 1196), 0b1000), ehT0Px3KOsy9('\060' + chr(11074 - 10963) + chr(50) + '\067', 42325 - 42317), ehT0Px3KOsy9(chr(455 - 407) + chr(0b101001 + 0o106) + chr(54) + chr(2175 - 2124), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(55) + chr(481 - 433), ord("\x08")), ehT0Px3KOsy9(chr(887 - 839) + chr(0b1000110 + 0o51) + '\x33' + '\x33' + '\062', 8956 - 8948), ehT0Px3KOsy9(chr(0b110000) + chr(0b101000 + 0o107) + '\062' + chr(0b110000) + chr(558 - 506), 7581 - 7573), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(111) + chr(0b110001) + chr(1847 - 1795) + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1258 - 1204) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\x6f' + '\x32' + '\065' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(1891 - 1843) + chr(0b110100 + 0o73) + '\062' + chr(795 - 747) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + '\065' + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110000), 12707 - 12699), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100000 + 0o21) + chr(0b110001) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(860 - 812) + '\157' + chr(0b110010) + chr(54) + chr(0b101011 + 0o11), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001 + 0o2) + chr(0b11010 + 0o33) + chr(1710 - 1660), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(54) + '\067', 52829 - 52821), ehT0Px3KOsy9('\x30' + chr(0b1100110 + 0o11) + '\066' + chr(2211 - 2158), 0o10), ehT0Px3KOsy9(chr(322 - 274) + '\157' + '\x35' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + '\065' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(2033 - 1985) + '\157' + chr(0b101001 + 0o11) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(0b110010) + chr(0b110101) + chr(0b100 + 0o54), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + '\x35' + chr(2349 - 2295), 0o10), ehT0Px3KOsy9(chr(1465 - 1417) + chr(10521 - 10410) + chr(0b1100 + 0o47) + chr(2384 - 2333) + '\062', 8), ehT0Px3KOsy9(chr(705 - 657) + chr(111) + chr(0b0 + 0o61) + chr(48) + chr(1739 - 1691), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(0b110010) + chr(1874 - 1826), 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(111) + '\x32' + chr(0b110110) + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2056 - 2005) + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1852 - 1802) + '\x32' + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b110000) + chr(3696 - 3585) + '\x33' + chr(2487 - 2436) + chr(0b1010 + 0o51), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1110 + 0o141) + chr(0b100010 + 0o20) + chr(0b110011) + chr(1843 - 1792), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b101 + 0o152) + chr(566 - 517) + chr(2271 - 2223) + chr(0b100001 + 0o26), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6015 - 5904) + '\063' + chr(0b110110) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1001 + 0o52) + '\x34' + '\067', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4805 - 4694) + chr(0b101011 + 0o10) + '\063' + chr(48), 2757 - 2749), ehT0Px3KOsy9('\x30' + chr(0b1100101 + 0o12) + chr(49) + chr(0b100000 + 0o20) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + '\067' + chr(51), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(459 - 410) + chr(0b110010) + chr(2634 - 2582), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(0b110111) + chr(0b10000 + 0o41), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4037 - 3926) + '\x31' + chr(0b110111) + chr(1223 - 1171), 37823 - 37815)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11001 + 0o34) + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa6'), '\144' + chr(101) + '\x63' + '\157' + chr(0b1101 + 0o127) + chr(1197 - 1096))('\165' + chr(0b1110100) + chr(0b1100110) + chr(0b1 + 0o54) + chr(0b100111 + 0o21)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Lx4O_M_jZx6j(CYCr3xzMHl4K, PMa4nyZ8k1u5):
return xafqLlk3kkUe(dubtF9GfzOdC.read_csv(CYCr3xzMHl4K, skiprows=PMa4nyZ8k1u5, skipinitialspace=ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1000001 + 0o56) + chr(49), 0o10), na_values=[xafqLlk3kkUe(SXOLrMavuUCe(b'\xca\xbfyX\x18\xb2\xeb\x08X\xcc\xe1\x16'), chr(1782 - 1682) + '\x65' + chr(0b1100011) + chr(0b100111 + 0o110) + chr(9296 - 9196) + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(0b1001100 + 0o32) + '\055' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc6\xb1c\x13Y\xac\xe5\r]\xc9\xe2\x03e'), chr(7563 - 7463) + chr(3300 - 3199) + chr(0b1100011) + '\157' + '\144' + chr(0b1100101))(chr(0b101100 + 0o111) + chr(3907 - 3791) + chr(102) + chr(321 - 276) + '\x38')], parse_dates=[xafqLlk3kkUe(SXOLrMavuUCe(b'\xcc\xbfcV'), '\144' + chr(8636 - 8535) + chr(0b1100011) + chr(2929 - 2818) + '\144' + chr(1140 - 1039))(chr(0b1100101 + 0o20) + chr(116) + '\146' + chr(691 - 646) + chr(0b111000))], index_col=xafqLlk3kkUe(SXOLrMavuUCe(b'\xcc\xbfcV'), chr(0b1000011 + 0o41) + chr(4774 - 4673) + '\143' + '\157' + chr(0b1100100) + '\145')('\165' + chr(116) + '\x66' + '\055' + chr(0b10101 + 0o43))).dropna(how=xafqLlk3kkUe(SXOLrMavuUCe(b'\xe9\xb2{'), chr(0b1011111 + 0o5) + chr(101) + chr(0b1100011) + chr(0b100001 + 0o116) + chr(0b1100100) + chr(3033 - 2932))('\165' + chr(9277 - 9161) + '\146' + chr(0b11100 + 0o21) + chr(1100 - 1044))).tz_localize(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\x8aT'), '\x64' + '\145' + '\x63' + chr(4409 - 4298) + '\x64' + chr(0b1100101))('\165' + '\164' + chr(0b1010010 + 0o24) + chr(0b101101) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa\xbbyRU\xbf'), '\144' + chr(0b110111 + 0o56) + chr(99) + '\157' + '\144' + '\x65')('\x75' + chr(116) + chr(3693 - 3591) + '\055' + chr(0b110110 + 0o2)))(columns=amWzKqYZbiER)
|
quantopian/zipline
|
zipline/data/treasuries_can.py
|
check_known_inconsistencies
|
def check_known_inconsistencies(bill_data, bond_data):
"""
There are a couple quirks in the data provided by Bank of Canada.
Check that no new quirks have been introduced in the latest download.
"""
inconsistent_dates = bill_data.index.sym_diff(bond_data.index)
known_inconsistencies = [
# bill_data has an entry for 2010-02-15, which bond_data doesn't.
# bond_data has an entry for 2006-09-04, which bill_data doesn't.
# Both of these dates are bank holidays (Flag Day and Labor Day,
# respectively).
pd.Timestamp('2006-09-04', tz='UTC'),
pd.Timestamp('2010-02-15', tz='UTC'),
# 2013-07-25 comes back as "Not available" from the bills endpoint.
# This date doesn't seem to be a bank holiday, but the previous
# calendar implementation dropped this entry, so we drop it as well.
# If someone cares deeply about the integrity of the Canadian trading
# calendar, they may want to consider forward-filling here rather than
# dropping the row.
pd.Timestamp('2013-07-25', tz='UTC'),
]
unexpected_inconsistences = inconsistent_dates.drop(known_inconsistencies)
if len(unexpected_inconsistences):
in_bills = bill_data.index.difference(bond_data.index).difference(
known_inconsistencies
)
in_bonds = bond_data.index.difference(bill_data.index).difference(
known_inconsistencies
)
raise ValueError(
"Inconsistent dates for Canadian treasury bills vs bonds. \n"
"Dates with bills but not bonds: {in_bills}.\n"
"Dates with bonds but not bills: {in_bonds}.".format(
in_bills=in_bills,
in_bonds=in_bonds,
)
)
|
python
|
def check_known_inconsistencies(bill_data, bond_data):
"""
There are a couple quirks in the data provided by Bank of Canada.
Check that no new quirks have been introduced in the latest download.
"""
inconsistent_dates = bill_data.index.sym_diff(bond_data.index)
known_inconsistencies = [
# bill_data has an entry for 2010-02-15, which bond_data doesn't.
# bond_data has an entry for 2006-09-04, which bill_data doesn't.
# Both of these dates are bank holidays (Flag Day and Labor Day,
# respectively).
pd.Timestamp('2006-09-04', tz='UTC'),
pd.Timestamp('2010-02-15', tz='UTC'),
# 2013-07-25 comes back as "Not available" from the bills endpoint.
# This date doesn't seem to be a bank holiday, but the previous
# calendar implementation dropped this entry, so we drop it as well.
# If someone cares deeply about the integrity of the Canadian trading
# calendar, they may want to consider forward-filling here rather than
# dropping the row.
pd.Timestamp('2013-07-25', tz='UTC'),
]
unexpected_inconsistences = inconsistent_dates.drop(known_inconsistencies)
if len(unexpected_inconsistences):
in_bills = bill_data.index.difference(bond_data.index).difference(
known_inconsistencies
)
in_bonds = bond_data.index.difference(bill_data.index).difference(
known_inconsistencies
)
raise ValueError(
"Inconsistent dates for Canadian treasury bills vs bonds. \n"
"Dates with bills but not bonds: {in_bills}.\n"
"Dates with bonds but not bills: {in_bonds}.".format(
in_bills=in_bills,
in_bonds=in_bonds,
)
)
|
[
"def",
"check_known_inconsistencies",
"(",
"bill_data",
",",
"bond_data",
")",
":",
"inconsistent_dates",
"=",
"bill_data",
".",
"index",
".",
"sym_diff",
"(",
"bond_data",
".",
"index",
")",
"known_inconsistencies",
"=",
"[",
"# bill_data has an entry for 2010-02-15, which bond_data doesn't.",
"# bond_data has an entry for 2006-09-04, which bill_data doesn't.",
"# Both of these dates are bank holidays (Flag Day and Labor Day,",
"# respectively).",
"pd",
".",
"Timestamp",
"(",
"'2006-09-04'",
",",
"tz",
"=",
"'UTC'",
")",
",",
"pd",
".",
"Timestamp",
"(",
"'2010-02-15'",
",",
"tz",
"=",
"'UTC'",
")",
",",
"# 2013-07-25 comes back as \"Not available\" from the bills endpoint.",
"# This date doesn't seem to be a bank holiday, but the previous",
"# calendar implementation dropped this entry, so we drop it as well.",
"# If someone cares deeply about the integrity of the Canadian trading",
"# calendar, they may want to consider forward-filling here rather than",
"# dropping the row.",
"pd",
".",
"Timestamp",
"(",
"'2013-07-25'",
",",
"tz",
"=",
"'UTC'",
")",
",",
"]",
"unexpected_inconsistences",
"=",
"inconsistent_dates",
".",
"drop",
"(",
"known_inconsistencies",
")",
"if",
"len",
"(",
"unexpected_inconsistences",
")",
":",
"in_bills",
"=",
"bill_data",
".",
"index",
".",
"difference",
"(",
"bond_data",
".",
"index",
")",
".",
"difference",
"(",
"known_inconsistencies",
")",
"in_bonds",
"=",
"bond_data",
".",
"index",
".",
"difference",
"(",
"bill_data",
".",
"index",
")",
".",
"difference",
"(",
"known_inconsistencies",
")",
"raise",
"ValueError",
"(",
"\"Inconsistent dates for Canadian treasury bills vs bonds. \\n\"",
"\"Dates with bills but not bonds: {in_bills}.\\n\"",
"\"Dates with bonds but not bills: {in_bonds}.\"",
".",
"format",
"(",
"in_bills",
"=",
"in_bills",
",",
"in_bonds",
"=",
"in_bonds",
",",
")",
")"
] |
There are a couple quirks in the data provided by Bank of Canada.
Check that no new quirks have been introduced in the latest download.
|
[
"There",
"are",
"a",
"couple",
"quirks",
"in",
"the",
"data",
"provided",
"by",
"Bank",
"of",
"Canada",
".",
"Check",
"that",
"no",
"new",
"quirks",
"have",
"been",
"introduced",
"in",
"the",
"latest",
"download",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/treasuries_can.py#L83-L119
|
train
|
Check that there are no unexpected inconsistencies in the data provided by Bank of Canada.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yRO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dZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1697 - 1649) + chr(111) + '\x33' + chr(0b110000) + chr(869 - 814), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\063' + chr(0b110111) + chr(2082 - 2033), 12377 - 12369), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101111) + chr(336 - 286) + chr(53) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2297 - 2248) + chr(0b11 + 0o57) + '\x36', 0o10), ehT0Px3KOsy9(chr(54 - 6) + '\x6f' + chr(0b1110 + 0o43) + '\x34' + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1037 - 987) + '\064' + chr(0b110000), 23132 - 23124), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + chr(153 - 103) + '\061' + chr(52), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101001 + 0o106) + chr(52) + '\x32', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(1333 - 1284) + chr(0b110001 + 0o0), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11010 + 0o35) + chr(0b110010), 24941 - 24933), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\065' + chr(0b11110 + 0o25), 0b1000), ehT0Px3KOsy9(chr(1486 - 1438) + chr(0b1101111) + '\061' + '\060' + chr(0b110010), 16628 - 16620), ehT0Px3KOsy9(chr(559 - 511) + chr(0b1101111) + chr(0b101100 + 0o5) + chr(983 - 934), 0b1000), ehT0Px3KOsy9(chr(135 - 87) + '\157' + chr(49) + '\x30' + chr(2376 - 2327), 0o10), ehT0Px3KOsy9(chr(2216 - 2168) + chr(0b1100011 + 0o14) + chr(0b110001) + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + '\x36' + chr(51), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b110001 + 0o76) + '\063' + chr(53) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(0b10 + 0o60) + chr(0b11101 + 0o31), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b0 + 0o64) + '\062', 8), ehT0Px3KOsy9('\060' + chr(0b101 + 0o152) + '\x32' + chr(0b1000 + 0o56) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9709 - 9598) + chr(0b110001) + '\x37' + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b110110 + 0o71) + chr(734 - 685) + '\060' + chr(0b100000 + 0o22), 8), ehT0Px3KOsy9(chr(171 - 123) + chr(0b1101111) + '\x31' + '\x34' + '\x33', 9669 - 9661), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1675 - 1625) + '\061' + chr(2095 - 2045), 0o10), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\157' + chr(0b110010) + chr(0b110000) + chr(0b10011 + 0o37), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101000 + 0o7) + chr(0b10101 + 0o36) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + '\x32' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b10010 + 0o135) + '\063' + chr(54) + '\063', 36780 - 36772), ehT0Px3KOsy9(chr(1695 - 1647) + '\157' + chr(2174 - 2124) + chr(0b110110) + chr(0b11001 + 0o27), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1011110 + 0o21) + chr(0b110001) + '\x31' + chr(597 - 546), 37294 - 37286), ehT0Px3KOsy9(chr(0b110000) + chr(4234 - 4123) + chr(0b110010) + '\x32' + chr(0b100100 + 0o14), 0b1000), ehT0Px3KOsy9(chr(108 - 60) + '\157' + '\061' + '\x34' + chr(0b110111), 1037 - 1029), ehT0Px3KOsy9(chr(1230 - 1182) + chr(111) + chr(0b110001) + chr(2650 - 2595) + chr(1471 - 1420), 49398 - 49390), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1311 - 1258) + '\062', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001), 23631 - 23623), ehT0Px3KOsy9(chr(1755 - 1707) + '\157' + chr(50) + chr(582 - 534) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(1325 - 1214) + chr(0b101011 + 0o7) + chr(55) + chr(51), 0b1000), ehT0Px3KOsy9(chr(2070 - 2022) + chr(0b100010 + 0o115) + chr(50) + chr(2194 - 2141) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x36' + chr(218 - 167), 24260 - 24252), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + '\x31' + chr(0b110011), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + '\x35' + chr(48), 19848 - 19840)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe9'), '\144' + '\x65' + chr(2200 - 2101) + '\x6f' + chr(100) + chr(0b11001 + 0o114))(chr(0b1100101 + 0o20) + chr(0b110000 + 0o104) + chr(0b1100110) + chr(0b101101) + chr(0b11 + 0o65)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def kgTqLhrsbLRh(jFsPi6qSJb6w, QuWvEsn0ZYe_):
Bpr_yNnNxF8J = jFsPi6qSJb6w.index.sym_diff(QuWvEsn0ZYe_.XdowRbJKZWL9)
tZJLh5F_TKhz = [dubtF9GfzOdC.Timestamp(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\xc9\x9e`O\x90\xb5\x0fy\x0e'), chr(100) + chr(101) + chr(0b1100011) + chr(0b1000111 + 0o50) + '\x64' + chr(932 - 831))('\x75' + chr(116) + '\146' + chr(0b101101) + chr(56)), tz=xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xad\xed'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(0b101101 + 0o70))(chr(117) + chr(0b1110100) + chr(0b11011 + 0o113) + '\055' + chr(0b111000))), dubtF9GfzOdC.Timestamp(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\xc9\x9ffO\x90\xbe\x0fx\x0f'), chr(100) + chr(0b1100101) + chr(99) + chr(6060 - 5949) + chr(2988 - 2888) + chr(3548 - 3447))('\165' + chr(0b1110100) + '\x66' + chr(0b101101) + chr(0b111000)), tz=xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xad\xed'), '\x64' + chr(3397 - 3296) + '\143' + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(117) + '\164' + chr(102) + '\055' + chr(793 - 737))), dubtF9GfzOdC.Timestamp(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\xc9\x9feO\x90\xbb\x0f{\x0f'), chr(100) + chr(0b110100 + 0o61) + chr(0b1010111 + 0o14) + '\157' + '\144' + chr(101))('\x75' + chr(0b111110 + 0o66) + '\146' + chr(0b100101 + 0o10) + chr(2693 - 2637)), tz=xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xad\xed'), chr(100) + chr(0b1010101 + 0o20) + chr(8377 - 8278) + chr(0b1101111) + chr(0b1011100 + 0o10) + chr(4711 - 4610))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(45) + '\x38'))]
vZvoY0BKhgX5 = Bpr_yNnNxF8J.drop(tZJLh5F_TKhz)
if c2A0yzQpDQB3(vZvoY0BKhgX5):
OKek4KknKTDY = jFsPi6qSJb6w.index.difference(QuWvEsn0ZYe_.index).difference(tZJLh5F_TKhz)
dIR71HowAdjB = QuWvEsn0ZYe_.index.difference(jFsPi6qSJb6w.index).difference(tZJLh5F_TKhz)
raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e\x97\xcd9\x0c\xd3\xe5Q=_E6)%l\xc7\x8f\xa5\x02\xd4\x130C\xc9\xe3p0\x97\xd9*\xfeG\x0fXd\xe6\xc8\xdaA\xf2\xe7\x9b\xc7:\x0e\xd3\xacT:\x1aI-g%~\x9d\xca\xdcf\xd3\x08\'\x10\xaa\xf5w%\x9b\x90)\xf9\x0b\x17Y!\xe5\xce\xdb\x13\xe5\xa8\x8d\x8e4\r\xce\xe8Qs\x1aP+g\x1eo\xda\x86\xbaQ\xcfRH\'\xeb\xf6{"\xd3\xc7"\xe4\x0f[Hn\xe9\xdf\xdc\x13\xe9\xb2\x8d\x8e8\r\xd4\xac@ VG13av\xda\x84\x89@\xdd\x12&\x10\xf7\xac'), '\x64' + chr(0b1011110 + 0o7) + '\x63' + '\x6f' + '\144' + chr(7117 - 7016))(chr(117) + chr(0b101101 + 0o107) + '\x66' + '\x2d' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x91\xcd\xdc9*\xc1\xdf\x11\x19JN('), chr(0b110110 + 0o56) + chr(101) + chr(99) + chr(111) + chr(0b1111 + 0o125) + chr(101))(chr(9495 - 9378) + chr(116) + chr(102) + chr(0b101101) + chr(56)))(in_bills=OKek4KknKTDY, in_bonds=dIR71HowAdjB))
|
quantopian/zipline
|
zipline/data/treasuries_can.py
|
earliest_possible_date
|
def earliest_possible_date():
"""
The earliest date for which we can load data from this module.
"""
today = pd.Timestamp('now', tz='UTC').normalize()
# Bank of Canada only has the last 10 years of data at any given time.
return today.replace(year=today.year - 10)
|
python
|
def earliest_possible_date():
"""
The earliest date for which we can load data from this module.
"""
today = pd.Timestamp('now', tz='UTC').normalize()
# Bank of Canada only has the last 10 years of data at any given time.
return today.replace(year=today.year - 10)
|
[
"def",
"earliest_possible_date",
"(",
")",
":",
"today",
"=",
"pd",
".",
"Timestamp",
"(",
"'now'",
",",
"tz",
"=",
"'UTC'",
")",
".",
"normalize",
"(",
")",
"# Bank of Canada only has the last 10 years of data at any given time.",
"return",
"today",
".",
"replace",
"(",
"year",
"=",
"today",
".",
"year",
"-",
"10",
")"
] |
The earliest date for which we can load data from this module.
|
[
"The",
"earliest",
"date",
"for",
"which",
"we",
"can",
"load",
"data",
"from",
"this",
"module",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/treasuries_can.py#L122-L128
|
train
|
Returns the earliest possible date for which we can load data from this module.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCV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reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101111 + 0o4) + chr(0b110001 + 0o2) + chr(0b1011 + 0o46), 0o10), ehT0Px3KOsy9(chr(2250 - 2202) + chr(0b11010 + 0o125) + chr(49) + chr(1872 - 1823) + chr(1488 - 1434), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b11110 + 0o23), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000111 + 0o50) + chr(0b11001 + 0o31) + chr(0b100111 + 0o16) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1203 - 1153) + chr(0b110000) + '\x33', 58436 - 58428), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + '\x32' + chr(54) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101011 + 0o4) + chr(2417 - 2366) + '\065' + chr(0b1111 + 0o43), 0o10), ehT0Px3KOsy9(chr(1515 - 1467) + chr(111) + '\x33' + chr(0b110001) + chr(825 - 773), 43655 - 43647), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(421 - 372) + '\x37' + '\x35', 60855 - 60847), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b10110 + 0o32) + chr(0b101001 + 0o12), 8), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + chr(0b110001) + '\061' + chr(0b1 + 0o57), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(49) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1111 + 0o140) + '\064' + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(10447 - 10336) + '\x32' + chr(0b1110 + 0o51) + '\064', 16478 - 16470), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b1111 + 0o46) + chr(51), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(52) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(1265 - 1217) + '\157' + chr(50) + chr(49) + chr(808 - 754), 36647 - 36639), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(0b101010 + 0o12) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1101 + 0o142) + chr(0b1001 + 0o52) + '\060' + chr(54), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\061' + '\x33' + chr(2056 - 2002), 0o10), ehT0Px3KOsy9('\060' + chr(1583 - 1472) + '\x33' + '\065' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9882 - 9771) + '\062' + '\x35' + chr(0b10 + 0o60), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110000 + 0o6) + chr(913 - 865), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b110001 + 0o4) + chr(0b101101 + 0o3), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10010 + 0o37) + '\x34' + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b101001 + 0o106) + chr(1273 - 1218) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11101 + 0o26) + chr(52) + chr(407 - 356), 40917 - 40909), ehT0Px3KOsy9(chr(780 - 732) + chr(111) + '\063' + '\x30' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + '\066' + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + chr(1700 - 1645) + chr(987 - 935), 8), ehT0Px3KOsy9(chr(721 - 673) + '\x6f' + '\x33' + chr(0b100 + 0o63) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011101 + 0o22) + chr(1443 - 1391) + '\x35', 0o10), ehT0Px3KOsy9(chr(120 - 72) + chr(0b1101100 + 0o3) + chr(49) + '\060' + '\062', 38782 - 38774), ehT0Px3KOsy9('\060' + chr(5823 - 5712) + chr(49) + chr(0b110000 + 0o7) + '\060', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\065' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(12283 - 12172) + chr(49) + chr(53) + chr(489 - 438), 3014 - 3006), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(48) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b11011 + 0o124) + chr(303 - 253) + '\x33' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1011001 + 0o26) + '\x33' + chr(935 - 883) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + '\064' + chr(0b11001 + 0o33), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101100 + 0o3) + chr(0b1000 + 0o55) + chr(0b110000), 25050 - 25042)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf7'), chr(0b1100100) + '\x65' + chr(7899 - 7800) + chr(8373 - 8262) + chr(0b1100100) + '\x65')(chr(117) + chr(116) + '\x66' + chr(0b101101) + chr(0b101110 + 0o12)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def pW6hsWdWmtmo():
P6Se6Fvc_2Jv = dubtF9GfzOdC.Timestamp(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7!~'), '\x64' + chr(837 - 736) + chr(5028 - 4929) + '\x6f' + chr(0b1100010 + 0o2) + chr(0b11101 + 0o110))('\165' + chr(6188 - 6072) + chr(0b10101 + 0o121) + chr(1981 - 1936) + chr(0b111000)), tz=xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c\x1aJ'), chr(1364 - 1264) + chr(588 - 487) + '\x63' + '\x6f' + '\144' + chr(0b100010 + 0o103))(chr(12023 - 11906) + '\x74' + chr(102) + '\055' + '\x38')).IOBK62gJSlOh()
return xafqLlk3kkUe(P6Se6Fvc_2Jv, xafqLlk3kkUe(SXOLrMavuUCe(b'\xab+y\xc5\xe2\xd0\x8f'), '\144' + '\x65' + '\143' + '\157' + chr(100) + chr(8711 - 8610))('\165' + '\x74' + chr(0b1100110) + '\055' + chr(0b111000)))(year=xafqLlk3kkUe(P6Se6Fvc_2Jv, xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\x06M\xcb\xf9\xda\xa2\xb9E\xe6;!'), chr(0b1010011 + 0o21) + chr(0b1100101) + chr(9794 - 9695) + '\x6f' + chr(100) + chr(9686 - 9585))('\165' + '\164' + chr(0b1100110) + chr(1089 - 1044) + chr(0b111000))) - ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + chr(0b11100 + 0o25) + chr(0b11100 + 0o26), 0b1000))
|
quantopian/zipline
|
zipline/finance/slippage.py
|
fill_price_worse_than_limit_price
|
def fill_price_worse_than_limit_price(fill_price, order):
"""
Checks whether the fill price is worse than the order's limit price.
Parameters
----------
fill_price: float
The price to check.
order: zipline.finance.order.Order
The order whose limit price to check.
Returns
-------
bool: Whether the fill price is above the limit price (for a buy) or below
the limit price (for a sell).
"""
if order.limit:
# this is tricky! if an order with a limit price has reached
# the limit price, we will try to fill the order. do not fill
# these shares if the impacted price is worse than the limit
# price. return early to avoid creating the transaction.
# buy order is worse if the impacted price is greater than
# the limit price. sell order is worse if the impacted price
# is less than the limit price
if (order.direction > 0 and fill_price > order.limit) or \
(order.direction < 0 and fill_price < order.limit):
return True
return False
|
python
|
def fill_price_worse_than_limit_price(fill_price, order):
"""
Checks whether the fill price is worse than the order's limit price.
Parameters
----------
fill_price: float
The price to check.
order: zipline.finance.order.Order
The order whose limit price to check.
Returns
-------
bool: Whether the fill price is above the limit price (for a buy) or below
the limit price (for a sell).
"""
if order.limit:
# this is tricky! if an order with a limit price has reached
# the limit price, we will try to fill the order. do not fill
# these shares if the impacted price is worse than the limit
# price. return early to avoid creating the transaction.
# buy order is worse if the impacted price is greater than
# the limit price. sell order is worse if the impacted price
# is less than the limit price
if (order.direction > 0 and fill_price > order.limit) or \
(order.direction < 0 and fill_price < order.limit):
return True
return False
|
[
"def",
"fill_price_worse_than_limit_price",
"(",
"fill_price",
",",
"order",
")",
":",
"if",
"order",
".",
"limit",
":",
"# this is tricky! if an order with a limit price has reached",
"# the limit price, we will try to fill the order. do not fill",
"# these shares if the impacted price is worse than the limit",
"# price. return early to avoid creating the transaction.",
"# buy order is worse if the impacted price is greater than",
"# the limit price. sell order is worse if the impacted price",
"# is less than the limit price",
"if",
"(",
"order",
".",
"direction",
">",
"0",
"and",
"fill_price",
">",
"order",
".",
"limit",
")",
"or",
"(",
"order",
".",
"direction",
"<",
"0",
"and",
"fill_price",
"<",
"order",
".",
"limit",
")",
":",
"return",
"True",
"return",
"False"
] |
Checks whether the fill price is worse than the order's limit price.
Parameters
----------
fill_price: float
The price to check.
order: zipline.finance.order.Order
The order whose limit price to check.
Returns
-------
bool: Whether the fill price is above the limit price (for a buy) or below
the limit price (for a sell).
|
[
"Checks",
"whether",
"the",
"fill",
"price",
"is",
"worse",
"than",
"the",
"order",
"s",
"limit",
"price",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/finance/slippage.py#L50-L80
|
train
|
Checks whether the fill price is worse than the order s limit price.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdT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C8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(111) + '\061' + '\x30' + '\x37', 0o10), ehT0Px3KOsy9(chr(2304 - 2256) + chr(0b1010101 + 0o32) + chr(0b110010) + chr(0b110000) + '\060', 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1011110 + 0o21) + chr(51) + chr(0b110110) + chr(0b11010 + 0o31), 0b1000), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b1001101 + 0o42) + chr(54) + '\062', 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + '\064' + chr(50), 57376 - 57368), ehT0Px3KOsy9('\x30' + chr(5113 - 5002) + '\x31' + '\x35' + chr(51), 62322 - 62314), ehT0Px3KOsy9(chr(1647 - 1599) + '\x6f' + chr(0b110010) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100101 + 0o12) + '\x32' + '\064' + chr(0b10011 + 0o40), 23442 - 23434), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(0b110011) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011110 + 0o21) + chr(1443 - 1394) + chr(1979 - 1924) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b11111 + 0o120) + chr(0b1001 + 0o52) + '\066' + chr(2796 - 2743), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011000 + 0o27) + '\x31' + chr(0b110110) + chr(1075 - 1020), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + chr(843 - 792) + chr(50) + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + chr(620 - 509) + '\x34' + '\x35', 57963 - 57955), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(1708 - 1653) + chr(1895 - 1846), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2219 - 2170) + chr(53) + '\x31', 6549 - 6541), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(474 - 363) + chr(49) + '\063' + chr(0b10011 + 0o44), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(3249 - 3138) + chr(0b11000 + 0o32) + chr(0b110111) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(2034 - 1986) + chr(0b1101111) + chr(746 - 695) + chr(51) + chr(2197 - 2142), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(2220 - 2167) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(6353 - 6242) + '\063' + chr(0b110110) + '\x31', 0o10), ehT0Px3KOsy9(chr(1114 - 1066) + chr(0b100011 + 0o114) + chr(51) + chr(0b101111 + 0o4) + chr(2239 - 2185), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(48), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(0b11100 + 0o27) + chr(0b110110 + 0o0), 3813 - 3805), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101000 + 0o11) + '\x35' + chr(1154 - 1100), 0o10), ehT0Px3KOsy9(chr(1612 - 1564) + '\157' + chr(50) + chr(1990 - 1935) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\066' + chr(0b110001), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(0b110011) + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b111011 + 0o64) + '\063' + chr(0b1011 + 0o46) + chr(52), 23671 - 23663), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\157' + chr(303 - 252) + '\061' + '\065', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\065' + chr(0b110001), 61693 - 61685), ehT0Px3KOsy9('\x30' + chr(5831 - 5720) + chr(1944 - 1892), 0b1000), ehT0Px3KOsy9('\x30' + chr(5321 - 5210) + '\x35' + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + chr(3868 - 3757) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(4299 - 4188) + chr(0b110010) + chr(49) + '\x35', 41629 - 41621), ehT0Px3KOsy9(chr(2115 - 2067) + chr(11892 - 11781) + '\x32' + chr(0b110011) + chr(0b1100 + 0o51), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001 + 0o0) + chr(0b110010) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + chr(4386 - 4275) + chr(93 - 43) + chr(52) + '\x33', 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + '\x30' + '\x32', 0o10), ehT0Px3KOsy9('\060' + chr(4830 - 4719) + '\062' + '\x37' + '\x31', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110101) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'i'), chr(7063 - 6963) + chr(0b1001100 + 0o31) + '\x63' + chr(0b11 + 0o154) + '\x64' + '\145')('\165' + chr(0b1011111 + 0o25) + '\146' + '\x2d' + chr(1374 - 1318)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ZxtsehA4tpiJ(Tsbf6wyl6Sfj, hO2LnONV9lny):
if xafqLlk3kkUe(hO2LnONV9lny, xafqLlk3kkUe(SXOLrMavuUCe(b'-\xb8\xb1SS\x02_\xce8)\xc3\x00'), chr(0b1100100) + chr(0b110101 + 0o60) + '\x63' + chr(0b1101111) + chr(100) + chr(101))(chr(117) + chr(3125 - 3009) + chr(6581 - 6479) + chr(604 - 559) + chr(56))):
if xafqLlk3kkUe(hO2LnONV9lny, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1d\xfa\xa5\x06`"\\\xcf\x01\x19\x8d2'), chr(100) + chr(0b1100101) + chr(0b100101 + 0o76) + chr(11473 - 11362) + chr(0b1000100 + 0o40) + chr(1290 - 1189))(chr(117) + '\x74' + chr(0b1100110) + '\055' + '\070')) > ehT0Px3KOsy9('\x30' + chr(0b1101000 + 0o7) + '\x30', 0o10) and Tsbf6wyl6Sfj > xafqLlk3kkUe(hO2LnONV9lny, xafqLlk3kkUe(SXOLrMavuUCe(b'-\xb8\xb1SS\x02_\xce8)\xc3\x00'), chr(0b1010111 + 0o15) + chr(5904 - 5803) + '\x63' + '\x6f' + '\144' + '\145')('\165' + chr(462 - 346) + chr(4572 - 4470) + chr(0b101101) + chr(214 - 158))) or (xafqLlk3kkUe(hO2LnONV9lny, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1d\xfa\xa5\x06`"\\\xcf\x01\x19\x8d2'), chr(100) + chr(3584 - 3483) + chr(0b11110 + 0o105) + chr(0b111110 + 0o61) + '\144' + chr(8712 - 8611))('\165' + '\x74' + chr(102) + chr(0b101101) + chr(2858 - 2802))) < ehT0Px3KOsy9('\060' + '\157' + chr(2033 - 1985), 8) and Tsbf6wyl6Sfj < xafqLlk3kkUe(hO2LnONV9lny, xafqLlk3kkUe(SXOLrMavuUCe(b'-\xb8\xb1SS\x02_\xce8)\xc3\x00'), chr(0b1100100) + chr(0b1100001 + 0o4) + chr(99) + chr(1790 - 1679) + chr(100) + chr(101))('\165' + chr(5666 - 5550) + '\x66' + '\x2d' + chr(0b111000)))):
return ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + chr(878 - 829), 0o10)
return ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1375 - 1327), 8)
|
quantopian/zipline
|
zipline/finance/slippage.py
|
MarketImpactBase._get_window_data
|
def _get_window_data(self, data, asset, window_length):
"""
Internal utility method to return the trailing mean volume over the
past 'window_length' days, and volatility of close prices for a
specific asset.
Parameters
----------
data : The BarData from which to fetch the daily windows.
asset : The Asset whose data we are fetching.
window_length : Number of days of history used to calculate the mean
volume and close price volatility.
Returns
-------
(mean volume, volatility)
"""
try:
values = self._window_data_cache.get(asset, data.current_session)
except KeyError:
try:
# Add a day because we want 'window_length' complete days,
# excluding the current day.
volume_history = data.history(
asset, 'volume', window_length + 1, '1d',
)
close_history = data.history(
asset, 'close', window_length + 1, '1d',
)
except HistoryWindowStartsBeforeData:
# If there is not enough data to do a full history call, return
# values as if there was no data.
return 0, np.NaN
# Exclude the first value of the percent change array because it is
# always just NaN.
close_volatility = close_history[:-1].pct_change()[1:].std(
skipna=False,
)
values = {
'volume': volume_history[:-1].mean(),
'close': close_volatility * SQRT_252,
}
self._window_data_cache.set(asset, values, data.current_session)
return values['volume'], values['close']
|
python
|
def _get_window_data(self, data, asset, window_length):
"""
Internal utility method to return the trailing mean volume over the
past 'window_length' days, and volatility of close prices for a
specific asset.
Parameters
----------
data : The BarData from which to fetch the daily windows.
asset : The Asset whose data we are fetching.
window_length : Number of days of history used to calculate the mean
volume and close price volatility.
Returns
-------
(mean volume, volatility)
"""
try:
values = self._window_data_cache.get(asset, data.current_session)
except KeyError:
try:
# Add a day because we want 'window_length' complete days,
# excluding the current day.
volume_history = data.history(
asset, 'volume', window_length + 1, '1d',
)
close_history = data.history(
asset, 'close', window_length + 1, '1d',
)
except HistoryWindowStartsBeforeData:
# If there is not enough data to do a full history call, return
# values as if there was no data.
return 0, np.NaN
# Exclude the first value of the percent change array because it is
# always just NaN.
close_volatility = close_history[:-1].pct_change()[1:].std(
skipna=False,
)
values = {
'volume': volume_history[:-1].mean(),
'close': close_volatility * SQRT_252,
}
self._window_data_cache.set(asset, values, data.current_session)
return values['volume'], values['close']
|
[
"def",
"_get_window_data",
"(",
"self",
",",
"data",
",",
"asset",
",",
"window_length",
")",
":",
"try",
":",
"values",
"=",
"self",
".",
"_window_data_cache",
".",
"get",
"(",
"asset",
",",
"data",
".",
"current_session",
")",
"except",
"KeyError",
":",
"try",
":",
"# Add a day because we want 'window_length' complete days,",
"# excluding the current day.",
"volume_history",
"=",
"data",
".",
"history",
"(",
"asset",
",",
"'volume'",
",",
"window_length",
"+",
"1",
",",
"'1d'",
",",
")",
"close_history",
"=",
"data",
".",
"history",
"(",
"asset",
",",
"'close'",
",",
"window_length",
"+",
"1",
",",
"'1d'",
",",
")",
"except",
"HistoryWindowStartsBeforeData",
":",
"# If there is not enough data to do a full history call, return",
"# values as if there was no data.",
"return",
"0",
",",
"np",
".",
"NaN",
"# Exclude the first value of the percent change array because it is",
"# always just NaN.",
"close_volatility",
"=",
"close_history",
"[",
":",
"-",
"1",
"]",
".",
"pct_change",
"(",
")",
"[",
"1",
":",
"]",
".",
"std",
"(",
"skipna",
"=",
"False",
",",
")",
"values",
"=",
"{",
"'volume'",
":",
"volume_history",
"[",
":",
"-",
"1",
"]",
".",
"mean",
"(",
")",
",",
"'close'",
":",
"close_volatility",
"*",
"SQRT_252",
",",
"}",
"self",
".",
"_window_data_cache",
".",
"set",
"(",
"asset",
",",
"values",
",",
"data",
".",
"current_session",
")",
"return",
"values",
"[",
"'volume'",
"]",
",",
"values",
"[",
"'close'",
"]"
] |
Internal utility method to return the trailing mean volume over the
past 'window_length' days, and volatility of close prices for a
specific asset.
Parameters
----------
data : The BarData from which to fetch the daily windows.
asset : The Asset whose data we are fetching.
window_length : Number of days of history used to calculate the mean
volume and close price volatility.
Returns
-------
(mean volume, volatility)
|
[
"Internal",
"utility",
"method",
"to",
"return",
"the",
"trailing",
"mean",
"volume",
"over",
"the",
"past",
"window_length",
"days",
"and",
"volatility",
"of",
"close",
"prices",
"for",
"a",
"specific",
"asset",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/finance/slippage.py#L399-L444
|
train
|
Internal utility method to fetch the trailing mean volume over the window_length days and volatility of close prices for the specific asset.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,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sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b111101 + 0o62) + chr(0b110 + 0o53) + '\067' + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(843 - 789) + chr(2607 - 2554), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b110001) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110000 + 0o1) + '\065' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(1373 - 1325) + chr(0b110 + 0o151) + '\063' + '\x33' + '\066', 16221 - 16213), ehT0Px3KOsy9(chr(51 - 3) + '\157' + '\061' + '\x30' + chr(49), 21235 - 21227), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10000 + 0o46) + chr(51), 0o10), ehT0Px3KOsy9(chr(2032 - 1984) + chr(0b1101111) + chr(49) + chr(54) + chr(51), 51690 - 51682), ehT0Px3KOsy9(chr(48) + chr(2696 - 2585) + chr(0b11111 + 0o23) + chr(0b10000 + 0o44) + chr(50), 5131 - 5123), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + chr(0b10110 + 0o34) + chr(0b101001 + 0o12) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(5912 - 5801) + chr(0b101111 + 0o4) + chr(1665 - 1615) + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(511 - 461) + chr(0b110110) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1001101 + 0o42) + '\063' + chr(0b1111 + 0o44) + chr(552 - 502), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100100 + 0o20) + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(2420 - 2366) + chr(1576 - 1526), 0o10), ehT0Px3KOsy9(chr(901 - 853) + chr(0b1101111) + chr(0b110001) + chr(0b100110 + 0o15) + '\062', 25133 - 25125), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(0b11101 + 0o24) + chr(52), 31653 - 31645), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(0b100110 + 0o14), 39713 - 39705), ehT0Px3KOsy9('\x30' + chr(111) + chr(1337 - 1287) + chr(674 - 625) + chr(0b11010 + 0o31), 0o10), ehT0Px3KOsy9('\060' + chr(0b11001 + 0o126) + '\062' + chr(0b1010 + 0o47) + chr(0b110100), 8), ehT0Px3KOsy9('\060' + chr(0b1010110 + 0o31) + chr(57 - 7) + chr(51) + chr(911 - 858), 8), ehT0Px3KOsy9(chr(1820 - 1772) + chr(0b1101111) + '\x31' + '\066' + chr(0b100000 + 0o21), 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(7091 - 6980) + chr(51) + chr(0b110110) + chr(0b100010 + 0o23), ord("\x08")), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + '\x33' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000101 + 0o52) + chr(1714 - 1663) + '\x32' + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(8555 - 8444) + '\x33' + '\067' + chr(0b11011 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(1687 - 1639) + chr(0b1010111 + 0o30) + chr(0b101011 + 0o6) + '\x32' + chr(0b110111 + 0o0), 36554 - 36546), ehT0Px3KOsy9(chr(48) + chr(4807 - 4696) + '\062' + chr(1030 - 975) + '\066', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(53) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(635 - 524) + '\061' + chr(0b110011) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1000101 + 0o52) + chr(0b10110 + 0o35) + '\x37' + '\061', 0o10), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1011110 + 0o21) + chr(0b101000 + 0o11) + chr(0b100000 + 0o24) + '\066', 61234 - 61226), ehT0Px3KOsy9('\060' + '\157' + chr(0b1100 + 0o45) + chr(2298 - 2244) + '\x37', 58618 - 58610), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\x31' + chr(0b11000 + 0o34), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1468 - 1419) + chr(0b101100 + 0o11) + chr(0b1111 + 0o43), ord("\x08")), ehT0Px3KOsy9(chr(2272 - 2224) + '\x6f' + '\064', 10203 - 10195), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2420 - 2369) + '\x30' + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(52) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(51) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(8596 - 8485) + '\061' + chr(0b10010 + 0o45) + chr(0b110101), 38364 - 38356)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b111011 + 0o64) + chr(0b110101) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'T'), chr(0b1100100) + '\145' + chr(99) + chr(111) + chr(0b1100100) + chr(101))(chr(1635 - 1518) + chr(6713 - 6597) + chr(102) + '\x2d' + chr(0b10100 + 0o44)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def muPTAr4CKbas(oVre8I6UXc3b, ULnjp6D6efFH, tKJAwKiE1Zya, uIUHNEHOeEMG):
try:
SPnCNu54H1db = oVre8I6UXc3b._window_data_cache.get(tKJAwKiE1Zya, ULnjp6D6efFH.current_session)
except RQ6CSRrFArYB:
try:
QzfkwQLyeU0Q = ULnjp6D6efFH.sD1K7SLfPnDB(tKJAwKiE1Zya, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0cZ\xa1\x18\xb3$'), chr(8949 - 8849) + chr(398 - 297) + '\x63' + '\x6f' + chr(8585 - 8485) + chr(0b101001 + 0o74))('\x75' + chr(3411 - 3295) + chr(10206 - 10104) + chr(45) + chr(56)), uIUHNEHOeEMG + ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + chr(0b110001), 8765 - 8757), xafqLlk3kkUe(SXOLrMavuUCe(b'KQ'), chr(0b1100100) + '\145' + '\x63' + chr(0b1101111) + chr(0b111100 + 0o50) + chr(0b1100101))(chr(0b1110101) + '\x74' + '\x66' + chr(0b101101) + chr(56)))
Ksuap8MkSH8l = ULnjp6D6efFH.sD1K7SLfPnDB(tKJAwKiE1Zya, xafqLlk3kkUe(SXOLrMavuUCe(b'\x19Y\xa2\x1e\xbb'), chr(9418 - 9318) + chr(0b1001 + 0o134) + '\x63' + chr(0b1101111) + chr(100) + chr(0b100100 + 0o101))(chr(0b11101 + 0o130) + '\x74' + chr(8284 - 8182) + chr(45) + chr(0b10 + 0o66)), uIUHNEHOeEMG + ehT0Px3KOsy9(chr(1000 - 952) + chr(0b1101111) + '\061', 8), xafqLlk3kkUe(SXOLrMavuUCe(b'KQ'), chr(0b111001 + 0o53) + chr(0b1100101) + chr(5204 - 5105) + chr(0b1101111) + chr(0b1100100) + chr(2594 - 2493))('\x75' + '\164' + '\146' + '\055' + chr(0b111000)))
except VksmKhiMA_lY:
return (ehT0Px3KOsy9(chr(48) + '\157' + chr(1774 - 1726), ord("\x08")), xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'4T\x83'), '\144' + '\145' + chr(99) + chr(0b11 + 0o154) + '\144' + chr(0b1100101))(chr(117) + chr(0b111001 + 0o73) + '\x66' + '\055' + chr(0b111000))))
_VTmmPh9fUUN = Ksuap8MkSH8l[:-ehT0Px3KOsy9(chr(0b110000) + chr(2694 - 2583) + '\061', 8)].pct_change()[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001), 8):].o3E_VFExiNOk(skipna=ehT0Px3KOsy9('\060' + chr(7407 - 7296) + chr(1808 - 1760), 8))
SPnCNu54H1db = {xafqLlk3kkUe(SXOLrMavuUCe(b'\x0cZ\xa1\x18\xb3$'), chr(0b110101 + 0o57) + chr(101) + chr(9150 - 9051) + '\157' + '\x64' + '\x65')(chr(0b1001 + 0o154) + chr(0b1110100) + chr(112 - 10) + '\x2d' + chr(0b111000)): QzfkwQLyeU0Q[:-ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11000 + 0o31), 8)].aJhItC_Vawlw(), xafqLlk3kkUe(SXOLrMavuUCe(b'\x19Y\xa2\x1e\xbb'), chr(3770 - 3670) + chr(101) + chr(0b1101 + 0o126) + chr(9284 - 9173) + chr(100) + chr(0b1011000 + 0o15))(chr(117) + chr(116) + chr(0b111100 + 0o52) + chr(0b10100 + 0o31) + '\070'): _VTmmPh9fUUN * aU3XtWacsf9C}
xafqLlk3kkUe(oVre8I6UXc3b._window_data_cache, xafqLlk3kkUe(SXOLrMavuUCe(b'\tP\xb9'), chr(0b1100100) + chr(6919 - 6818) + chr(0b1010100 + 0o17) + chr(8572 - 8461) + chr(0b110100 + 0o60) + chr(101))('\x75' + chr(0b1101111 + 0o5) + chr(0b1100110) + chr(0b101101) + '\070'))(tKJAwKiE1Zya, SPnCNu54H1db, xafqLlk3kkUe(ULnjp6D6efFH, xafqLlk3kkUe(SXOLrMavuUCe(b'\x19@\xbf\x1f\xbb/G,\xd1\xf8\xa7\xc3\xb3H\\'), chr(0b11110 + 0o106) + chr(0b111 + 0o136) + chr(0b111110 + 0o45) + '\157' + chr(3024 - 2924) + chr(0b1100101))(chr(12045 - 11928) + chr(116) + '\x66' + chr(0b10100 + 0o31) + chr(0b111000))))
return (SPnCNu54H1db[xafqLlk3kkUe(SXOLrMavuUCe(b'\x0cZ\xa1\x18\xb3$'), chr(0b101000 + 0o74) + '\x65' + '\x63' + chr(0b1101111) + chr(4802 - 4702) + '\145')(chr(117) + chr(0b100110 + 0o116) + '\146' + '\055' + chr(0b111000))], SPnCNu54H1db[xafqLlk3kkUe(SXOLrMavuUCe(b'\x19Y\xa2\x1e\xbb'), '\x64' + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + '\144' + chr(10054 - 9953))(chr(0b1110101) + '\x74' + '\146' + '\055' + chr(56))])
|
quantopian/zipline
|
zipline/pipeline/term.py
|
validate_dtype
|
def validate_dtype(termname, dtype, missing_value):
"""
Validate a `dtype` and `missing_value` passed to Term.__new__.
Ensures that we know how to represent ``dtype``, and that missing_value
is specified for types without default missing values.
Returns
-------
validated_dtype, validated_missing_value : np.dtype, any
The dtype and missing_value to use for the new term.
Raises
------
DTypeNotSpecified
When no dtype was passed to the instance, and the class doesn't
provide a default.
NotDType
When either the class or the instance provides a value not
coercible to a numpy dtype.
NoDefaultMissingValue
When dtype requires an explicit missing_value, but
``missing_value`` is NotSpecified.
"""
if dtype is NotSpecified:
raise DTypeNotSpecified(termname=termname)
try:
dtype = dtype_class(dtype)
except TypeError:
raise NotDType(dtype=dtype, termname=termname)
if not can_represent_dtype(dtype):
raise UnsupportedDType(dtype=dtype, termname=termname)
if missing_value is NotSpecified:
missing_value = default_missing_value_for_dtype(dtype)
try:
if (dtype == categorical_dtype):
# This check is necessary because we use object dtype for
# categoricals, and numpy will allow us to promote numerical
# values to object even though we don't support them.
_assert_valid_categorical_missing_value(missing_value)
# For any other type, we can check if the missing_value is safe by
# making an array of that value and trying to safely convert it to
# the desired type.
# 'same_kind' allows casting between things like float32 and
# float64, but not str and int.
array([missing_value]).astype(dtype=dtype, casting='same_kind')
except TypeError as e:
raise TypeError(
"Missing value {value!r} is not a valid choice "
"for term {termname} with dtype {dtype}.\n\n"
"Coercion attempt failed with: {error}".format(
termname=termname,
value=missing_value,
dtype=dtype,
error=e,
)
)
return dtype, missing_value
|
python
|
def validate_dtype(termname, dtype, missing_value):
"""
Validate a `dtype` and `missing_value` passed to Term.__new__.
Ensures that we know how to represent ``dtype``, and that missing_value
is specified for types without default missing values.
Returns
-------
validated_dtype, validated_missing_value : np.dtype, any
The dtype and missing_value to use for the new term.
Raises
------
DTypeNotSpecified
When no dtype was passed to the instance, and the class doesn't
provide a default.
NotDType
When either the class or the instance provides a value not
coercible to a numpy dtype.
NoDefaultMissingValue
When dtype requires an explicit missing_value, but
``missing_value`` is NotSpecified.
"""
if dtype is NotSpecified:
raise DTypeNotSpecified(termname=termname)
try:
dtype = dtype_class(dtype)
except TypeError:
raise NotDType(dtype=dtype, termname=termname)
if not can_represent_dtype(dtype):
raise UnsupportedDType(dtype=dtype, termname=termname)
if missing_value is NotSpecified:
missing_value = default_missing_value_for_dtype(dtype)
try:
if (dtype == categorical_dtype):
# This check is necessary because we use object dtype for
# categoricals, and numpy will allow us to promote numerical
# values to object even though we don't support them.
_assert_valid_categorical_missing_value(missing_value)
# For any other type, we can check if the missing_value is safe by
# making an array of that value and trying to safely convert it to
# the desired type.
# 'same_kind' allows casting between things like float32 and
# float64, but not str and int.
array([missing_value]).astype(dtype=dtype, casting='same_kind')
except TypeError as e:
raise TypeError(
"Missing value {value!r} is not a valid choice "
"for term {termname} with dtype {dtype}.\n\n"
"Coercion attempt failed with: {error}".format(
termname=termname,
value=missing_value,
dtype=dtype,
error=e,
)
)
return dtype, missing_value
|
[
"def",
"validate_dtype",
"(",
"termname",
",",
"dtype",
",",
"missing_value",
")",
":",
"if",
"dtype",
"is",
"NotSpecified",
":",
"raise",
"DTypeNotSpecified",
"(",
"termname",
"=",
"termname",
")",
"try",
":",
"dtype",
"=",
"dtype_class",
"(",
"dtype",
")",
"except",
"TypeError",
":",
"raise",
"NotDType",
"(",
"dtype",
"=",
"dtype",
",",
"termname",
"=",
"termname",
")",
"if",
"not",
"can_represent_dtype",
"(",
"dtype",
")",
":",
"raise",
"UnsupportedDType",
"(",
"dtype",
"=",
"dtype",
",",
"termname",
"=",
"termname",
")",
"if",
"missing_value",
"is",
"NotSpecified",
":",
"missing_value",
"=",
"default_missing_value_for_dtype",
"(",
"dtype",
")",
"try",
":",
"if",
"(",
"dtype",
"==",
"categorical_dtype",
")",
":",
"# This check is necessary because we use object dtype for",
"# categoricals, and numpy will allow us to promote numerical",
"# values to object even though we don't support them.",
"_assert_valid_categorical_missing_value",
"(",
"missing_value",
")",
"# For any other type, we can check if the missing_value is safe by",
"# making an array of that value and trying to safely convert it to",
"# the desired type.",
"# 'same_kind' allows casting between things like float32 and",
"# float64, but not str and int.",
"array",
"(",
"[",
"missing_value",
"]",
")",
".",
"astype",
"(",
"dtype",
"=",
"dtype",
",",
"casting",
"=",
"'same_kind'",
")",
"except",
"TypeError",
"as",
"e",
":",
"raise",
"TypeError",
"(",
"\"Missing value {value!r} is not a valid choice \"",
"\"for term {termname} with dtype {dtype}.\\n\\n\"",
"\"Coercion attempt failed with: {error}\"",
".",
"format",
"(",
"termname",
"=",
"termname",
",",
"value",
"=",
"missing_value",
",",
"dtype",
"=",
"dtype",
",",
"error",
"=",
"e",
",",
")",
")",
"return",
"dtype",
",",
"missing_value"
] |
Validate a `dtype` and `missing_value` passed to Term.__new__.
Ensures that we know how to represent ``dtype``, and that missing_value
is specified for types without default missing values.
Returns
-------
validated_dtype, validated_missing_value : np.dtype, any
The dtype and missing_value to use for the new term.
Raises
------
DTypeNotSpecified
When no dtype was passed to the instance, and the class doesn't
provide a default.
NotDType
When either the class or the instance provides a value not
coercible to a numpy dtype.
NoDefaultMissingValue
When dtype requires an explicit missing_value, but
``missing_value`` is NotSpecified.
|
[
"Validate",
"a",
"dtype",
"and",
"missing_value",
"passed",
"to",
"Term",
".",
"__new__",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/term.py#L795-L858
|
train
|
Validate a dtype and a missing_value passed to Term. __new__.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,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_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(2204 - 2156) + chr(0b1101111) + '\x31' + '\064', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(51), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\063' + '\067' + chr(0b10000 + 0o40), 0o10), ehT0Px3KOsy9(chr(372 - 324) + chr(3299 - 3188) + chr(0b110010) + chr(0b101101 + 0o10) + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b101010 + 0o7) + '\065' + '\x31', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + chr(2354 - 2301) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(1344 - 1296) + '\x6f' + chr(0b100011 + 0o20) + chr(0b110001) + chr(0b101010 + 0o10), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(832 - 778) + chr(49), 33000 - 32992), ehT0Px3KOsy9(chr(48) + chr(0b111011 + 0o64) + chr(2272 - 2217) + chr(0b11 + 0o62), 17075 - 17067), ehT0Px3KOsy9('\060' + '\157' + chr(0b11011 + 0o30) + chr(0b1000 + 0o56) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(743 - 695) + '\x6f' + '\062' + chr(53) + chr(0b11 + 0o61), 6186 - 6178), ehT0Px3KOsy9(chr(438 - 390) + '\x6f' + chr(50) + chr(0b110100) + chr(53), 0o10), ehT0Px3KOsy9(chr(1119 - 1071) + chr(0b1101111) + chr(51) + chr(1737 - 1687) + chr(2668 - 2616), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(51) + chr(0b100000 + 0o23) + chr(1112 - 1058), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(1501 - 1448) + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1011010 + 0o25) + chr(0b100011 + 0o16) + '\x35' + chr(51), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100011 + 0o14) + chr(0b110010) + chr(49) + '\067', 42750 - 42742), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(1188 - 1077) + chr(0b11110 + 0o25) + '\065' + chr(1111 - 1057), ord("\x08")), ehT0Px3KOsy9(chr(513 - 465) + '\157' + chr(0b110010) + '\x35' + chr(0b110111), 8), ehT0Px3KOsy9('\x30' + chr(1987 - 1876) + chr(1699 - 1650) + chr(0b110111) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(0b10101 + 0o132) + '\062' + chr(48) + '\063', 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(111) + '\063' + chr(52) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b11001 + 0o126) + chr(0b110010) + chr(52) + chr(0b101 + 0o56), 41431 - 41423), ehT0Px3KOsy9(chr(887 - 839) + '\x6f' + chr(51) + '\x32' + chr(0b1100 + 0o44), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100000 + 0o21) + '\x35' + chr(858 - 810), 58036 - 58028), ehT0Px3KOsy9('\060' + '\157' + '\063' + '\060', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + chr(50) + chr(1418 - 1370), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + chr(0b10100 + 0o36) + chr(49), 7200 - 7192), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + '\x36' + chr(1407 - 1355), 47793 - 47785), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(0b110100) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(50) + '\x31' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(1272 - 1224) + chr(111) + chr(0b110001) + chr(0b110111 + 0o0) + chr(1716 - 1667), 16137 - 16129), ehT0Px3KOsy9(chr(805 - 757) + chr(10922 - 10811) + chr(320 - 270) + '\x35' + chr(0b10 + 0o62), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101100 + 0o5) + chr(0b110000 + 0o6) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(6719 - 6608) + chr(0b110010 + 0o0) + chr(55) + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000010 + 0o55) + chr(50) + chr(0b1101 + 0o44) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + chr(51) + '\062' + chr(276 - 225), 24875 - 24867), ehT0Px3KOsy9(chr(48) + chr(6970 - 6859) + chr(0b110001) + chr(0b10111 + 0o40) + chr(0b110000 + 0o7), 45568 - 45560), ehT0Px3KOsy9(chr(945 - 897) + chr(0b111010 + 0o65) + chr(0b10 + 0o60) + chr(0b110110) + '\064', 17410 - 17402), ehT0Px3KOsy9(chr(567 - 519) + '\157' + '\064' + '\064', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1001 + 0o146) + '\x35' + chr(1904 - 1856), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'"'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(3184 - 3073) + '\x64' + '\145')('\165' + chr(10717 - 10601) + '\x66' + chr(810 - 765) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def VkKwDQvUgecJ(Up4D05qu12Ot, jSV9IKnemH7K, cM6FSYO3vPuj):
if jSV9IKnemH7K is wxCCXClP4Gzp:
raise N1FHw58jIfsP(termname=Up4D05qu12Ot)
try:
jSV9IKnemH7K = ZfE4F0MvAZW6(jSV9IKnemH7K)
except sznFqDbNBHlx:
raise LdlUAyjY1L93(dtype=jSV9IKnemH7K, termname=Up4D05qu12Ot)
if not g4YXTCkK8CCP(jSV9IKnemH7K):
raise OBplM5VRUtaw(dtype=jSV9IKnemH7K, termname=Up4D05qu12Ot)
if cM6FSYO3vPuj is wxCCXClP4Gzp:
cM6FSYO3vPuj = lwRNtWdWENBS(jSV9IKnemH7K)
try:
if jSV9IKnemH7K == ONgSHNzXxi9R:
sE3mNrZFXJdV(cM6FSYO3vPuj)
xafqLlk3kkUe(B0ePDhpqxN5n([cM6FSYO3vPuj]), xafqLlk3kkUe(SXOLrMavuUCe(b'mh\x8c\xd3\x19\xca'), chr(0b1100100) + chr(2462 - 2361) + chr(0b110000 + 0o63) + chr(0b101100 + 0o103) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(0b1101101 + 0o7) + chr(0b1100110) + chr(45) + '\x38'))(dtype=jSV9IKnemH7K, casting=xafqLlk3kkUe(SXOLrMavuUCe(b'\x7fz\x95\xcf6\xc4\xa3_Y'), chr(0b10111 + 0o115) + chr(7299 - 7198) + chr(0b1100011) + '\x6f' + '\x64' + chr(610 - 509))(chr(117) + chr(116) + chr(0b1100110) + '\x2d' + chr(0b111000)))
except sznFqDbNBHlx as GlnVAPeT6CUe:
raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"Ar\x8b\xd9\x00\xc1\xad\x11K\x90\xc0\xd0\xb1\xfe\x15\x1d\xee\x82\xda\x19\xa2\x91\xde\xf0\x01kp?[\xd3\xae\x18\x8c\x06\xdf\xe7\xba\x1b\x94Gdt\x91\xc9\x0c\x8f\xac^O\xd1\xd8\xc0\xa6\xb3N\x10\xfb\x8b\xdd\x11\xed\x82\xce\xb5\x158'8@\xcf\xae\x1d\xd8\t\xce\xee\xf3\x04\xd0Puk\x9d\xd7G\xa5\xc0rR\x94\xde\xc6\xbd\xb1\x00K\xee\x9a\xdb\x19\xee\x93\xd7\xf0\x0ey9=Q\xc3\xae\x0e\xc5\x04\xd6\xb1\xf3\x04\xd1V~t\x8a\xd7"), chr(0b1100100) + chr(0b1100101) + chr(3838 - 3739) + '\157' + chr(7096 - 6996) + '\145')('\165' + chr(7248 - 7132) + '\x66' + chr(1499 - 1454) + chr(3021 - 2965)), xafqLlk3kkUe(SXOLrMavuUCe(b'Z/\x8a\xc5!\xce\x99\x02m\x81\xc9\xcf'), chr(7227 - 7127) + chr(4164 - 4063) + '\143' + '\x6f' + chr(7903 - 7803) + chr(101))('\165' + chr(116) + '\x66' + '\x2d' + chr(0b111000)))(termname=Up4D05qu12Ot, value=cM6FSYO3vPuj, dtype=jSV9IKnemH7K, error=GlnVAPeT6CUe))
return (jSV9IKnemH7K, cM6FSYO3vPuj)
|
quantopian/zipline
|
zipline/pipeline/term.py
|
_assert_valid_categorical_missing_value
|
def _assert_valid_categorical_missing_value(value):
"""
Check that value is a valid categorical missing_value.
Raises a TypeError if the value is cannot be used as the missing_value for
a categorical_dtype Term.
"""
label_types = LabelArray.SUPPORTED_SCALAR_TYPES
if not isinstance(value, label_types):
raise TypeError(
"Categorical terms must have missing values of type "
"{types}.".format(
types=' or '.join([t.__name__ for t in label_types]),
)
)
|
python
|
def _assert_valid_categorical_missing_value(value):
"""
Check that value is a valid categorical missing_value.
Raises a TypeError if the value is cannot be used as the missing_value for
a categorical_dtype Term.
"""
label_types = LabelArray.SUPPORTED_SCALAR_TYPES
if not isinstance(value, label_types):
raise TypeError(
"Categorical terms must have missing values of type "
"{types}.".format(
types=' or '.join([t.__name__ for t in label_types]),
)
)
|
[
"def",
"_assert_valid_categorical_missing_value",
"(",
"value",
")",
":",
"label_types",
"=",
"LabelArray",
".",
"SUPPORTED_SCALAR_TYPES",
"if",
"not",
"isinstance",
"(",
"value",
",",
"label_types",
")",
":",
"raise",
"TypeError",
"(",
"\"Categorical terms must have missing values of type \"",
"\"{types}.\"",
".",
"format",
"(",
"types",
"=",
"' or '",
".",
"join",
"(",
"[",
"t",
".",
"__name__",
"for",
"t",
"in",
"label_types",
"]",
")",
",",
")",
")"
] |
Check that value is a valid categorical missing_value.
Raises a TypeError if the value is cannot be used as the missing_value for
a categorical_dtype Term.
|
[
"Check",
"that",
"value",
"is",
"a",
"valid",
"categorical",
"missing_value",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/term.py#L861-L875
|
train
|
Checks that value is a valid categorical missing_value.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9Flfz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M2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101011 + 0o4) + chr(0b11101 + 0o26) + chr(0b110000), 41849 - 41841), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(281 - 170) + '\x32' + '\x37' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(54), 1093 - 1085), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + '\x31' + chr(0b1101 + 0o51), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(1291 - 1240) + chr(2399 - 2350) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(1166 - 1112) + chr(1617 - 1566), ord("\x08")), ehT0Px3KOsy9(chr(2213 - 2165) + chr(0b110 + 0o151) + chr(1529 - 1479) + chr(0b110100 + 0o0) + chr(0b10000 + 0o41), 0b1000), ehT0Px3KOsy9(chr(1572 - 1524) + '\157' + chr(0b111 + 0o53) + '\066' + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + '\x30' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b11101 + 0o122) + '\067' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(987 - 939) + chr(0b100010 + 0o115) + chr(0b11100 + 0o25) + chr(53) + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1233 - 1184) + chr(1483 - 1435) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + chr(0b110110) + '\x31', 0o10), ehT0Px3KOsy9(chr(1201 - 1153) + chr(5573 - 5462) + chr(0b10111 + 0o36) + chr(0b110101), 20448 - 20440), ehT0Px3KOsy9(chr(198 - 150) + '\x6f' + chr(1127 - 1078) + chr(2381 - 2332) + chr(422 - 367), ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101111) + '\063' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(1525 - 1477) + chr(6589 - 6478) + '\063' + chr(1856 - 1802) + chr(1811 - 1761), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(2636 - 2583) + chr(0b100 + 0o62), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(0b100 + 0o62) + chr(0b100000 + 0o25), 16185 - 16177), ehT0Px3KOsy9(chr(0b110000) + chr(0b110001 + 0o76) + chr(0b101111 + 0o2) + '\x36' + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11100 + 0o27) + chr(0b110100) + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + chr(4110 - 3999) + chr(0b110011) + chr(0b110111) + chr(0b101100 + 0o12), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\064' + chr(578 - 530), 0o10), ehT0Px3KOsy9(chr(725 - 677) + '\x6f' + chr(1789 - 1738) + chr(0b1 + 0o60) + chr(53), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(1360 - 1308) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(7757 - 7646) + chr(0b11000 + 0o33) + chr(0b110001 + 0o5), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(0b110111) + chr(0b110000), 35889 - 35881), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(0b110101) + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b110100) + chr(0b100000 + 0o22), 47137 - 47129), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + '\x37' + chr(0b11010 + 0o26), 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + chr(1124 - 1075) + chr(0b11110 + 0o23) + chr(0b100 + 0o55), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(738 - 687) + chr(0b110001), 8), ehT0Px3KOsy9('\060' + chr(0b100001 + 0o116) + chr(0b110011) + '\x33' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(6617 - 6506) + '\061' + chr(0b0 + 0o64) + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(0b110001 + 0o76) + chr(52) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + chr(0b101 + 0o54) + chr(265 - 210) + chr(1902 - 1853), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + '\060' + chr(51), 15545 - 15537), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(9305 - 9194) + chr(0b11110 + 0o24) + chr(620 - 568) + chr(0b1110 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(0b110010) + chr(1558 - 1509), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(0b110000) + '\x34', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(6004 - 5893) + '\x35' + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'6'), chr(0b1100100) + chr(0b110111 + 0o56) + chr(4911 - 4812) + chr(1319 - 1208) + chr(0b1100100) + chr(101))('\x75' + '\164' + chr(102) + chr(0b10111 + 0o26) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def sE3mNrZFXJdV(QmmgWUB13VCJ):
BqreFue9XfFJ = xHaqLS1eUVFC.SUPPORTED_SCALAR_TYPES
if not PlSM16l2KDPD(QmmgWUB13VCJ, BqreFue9XfFJ):
raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'[\xddr\xab\xad\x9c\xd3\xd8\xa1Z\x03b\x85H=t\x81\x8e\xd8\x01\x97\x8a\x00\xa5\xc5h\x9dI\x0f\x11:j\xb1\x0fAY\xb5\xc4\xfd1}\xcf&\xa1\xac\xd3\xd5\xc8\xb2^O9\x85T?|\x81\xd3\x9b'), '\144' + chr(0b1100101) + '\143' + '\x6f' + chr(5036 - 4936) + '\145')('\165' + chr(116) + chr(9674 - 9572) + chr(45) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'N\x88t\xa1\x82\x92\xf2\x82\x92K\n('), chr(1075 - 975) + chr(101) + chr(0b100 + 0o137) + chr(7392 - 7281) + '\x64' + chr(0b1100101))('\x75' + chr(0b1101101 + 0o7) + '\x66' + chr(0b10111 + 0o26) + chr(0b111000)))(types=xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'8\xd3t\xee'), chr(0b1100100) + '\x65' + '\143' + chr(8080 - 7969) + '\144' + '\145')(chr(0b1110101) + '\x74' + chr(102) + '\055' + chr(0b11101 + 0o33)), xafqLlk3kkUe(SXOLrMavuUCe(b"G\xd3Q\x96\xb0\x87\xf7\xff\xacJ'\x04"), chr(0b1100100) + '\145' + chr(0b1100011 + 0o0) + chr(0b1101111) + '\x64' + '\x65')(chr(5194 - 5077) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(876 - 820)))([xafqLlk3kkUe(YeT3l7JgTbWR, xafqLlk3kkUe(SXOLrMavuUCe(b'_\xdec\xa4\xfe\x9c\xfb\xc0\x89w.t'), '\x64' + chr(4146 - 4045) + chr(0b1100011) + chr(0b1101111) + chr(100) + '\x65')(chr(0b100101 + 0o120) + '\x74' + chr(102) + chr(0b100111 + 0o6) + chr(56))) for YeT3l7JgTbWR in BqreFue9XfFJ])))
|
quantopian/zipline
|
zipline/pipeline/term.py
|
Term._pop_params
|
def _pop_params(cls, kwargs):
"""
Pop entries from the `kwargs` passed to cls.__new__ based on the values
in `cls.params`.
Parameters
----------
kwargs : dict
The kwargs passed to cls.__new__.
Returns
-------
params : list[(str, object)]
A list of string, value pairs containing the entries in cls.params.
Raises
------
TypeError
Raised if any parameter values are not passed or not hashable.
"""
params = cls.params
if not isinstance(params, Mapping):
params = {k: NotSpecified for k in params}
param_values = []
for key, default_value in params.items():
try:
value = kwargs.pop(key, default_value)
if value is NotSpecified:
raise KeyError(key)
# Check here that the value is hashable so that we fail here
# instead of trying to hash the param values tuple later.
hash(value)
except KeyError:
raise TypeError(
"{typename} expected a keyword parameter {name!r}.".format(
typename=cls.__name__,
name=key
)
)
except TypeError:
# Value wasn't hashable.
raise TypeError(
"{typename} expected a hashable value for parameter "
"{name!r}, but got {value!r} instead.".format(
typename=cls.__name__,
name=key,
value=value,
)
)
param_values.append((key, value))
return tuple(param_values)
|
python
|
def _pop_params(cls, kwargs):
"""
Pop entries from the `kwargs` passed to cls.__new__ based on the values
in `cls.params`.
Parameters
----------
kwargs : dict
The kwargs passed to cls.__new__.
Returns
-------
params : list[(str, object)]
A list of string, value pairs containing the entries in cls.params.
Raises
------
TypeError
Raised if any parameter values are not passed or not hashable.
"""
params = cls.params
if not isinstance(params, Mapping):
params = {k: NotSpecified for k in params}
param_values = []
for key, default_value in params.items():
try:
value = kwargs.pop(key, default_value)
if value is NotSpecified:
raise KeyError(key)
# Check here that the value is hashable so that we fail here
# instead of trying to hash the param values tuple later.
hash(value)
except KeyError:
raise TypeError(
"{typename} expected a keyword parameter {name!r}.".format(
typename=cls.__name__,
name=key
)
)
except TypeError:
# Value wasn't hashable.
raise TypeError(
"{typename} expected a hashable value for parameter "
"{name!r}, but got {value!r} instead.".format(
typename=cls.__name__,
name=key,
value=value,
)
)
param_values.append((key, value))
return tuple(param_values)
|
[
"def",
"_pop_params",
"(",
"cls",
",",
"kwargs",
")",
":",
"params",
"=",
"cls",
".",
"params",
"if",
"not",
"isinstance",
"(",
"params",
",",
"Mapping",
")",
":",
"params",
"=",
"{",
"k",
":",
"NotSpecified",
"for",
"k",
"in",
"params",
"}",
"param_values",
"=",
"[",
"]",
"for",
"key",
",",
"default_value",
"in",
"params",
".",
"items",
"(",
")",
":",
"try",
":",
"value",
"=",
"kwargs",
".",
"pop",
"(",
"key",
",",
"default_value",
")",
"if",
"value",
"is",
"NotSpecified",
":",
"raise",
"KeyError",
"(",
"key",
")",
"# Check here that the value is hashable so that we fail here",
"# instead of trying to hash the param values tuple later.",
"hash",
"(",
"value",
")",
"except",
"KeyError",
":",
"raise",
"TypeError",
"(",
"\"{typename} expected a keyword parameter {name!r}.\"",
".",
"format",
"(",
"typename",
"=",
"cls",
".",
"__name__",
",",
"name",
"=",
"key",
")",
")",
"except",
"TypeError",
":",
"# Value wasn't hashable.",
"raise",
"TypeError",
"(",
"\"{typename} expected a hashable value for parameter \"",
"\"{name!r}, but got {value!r} instead.\"",
".",
"format",
"(",
"typename",
"=",
"cls",
".",
"__name__",
",",
"name",
"=",
"key",
",",
"value",
"=",
"value",
",",
")",
")",
"param_values",
".",
"append",
"(",
"(",
"key",
",",
"value",
")",
")",
"return",
"tuple",
"(",
"param_values",
")"
] |
Pop entries from the `kwargs` passed to cls.__new__ based on the values
in `cls.params`.
Parameters
----------
kwargs : dict
The kwargs passed to cls.__new__.
Returns
-------
params : list[(str, object)]
A list of string, value pairs containing the entries in cls.params.
Raises
------
TypeError
Raised if any parameter values are not passed or not hashable.
|
[
"Pop",
"entries",
"from",
"the",
"kwargs",
"passed",
"to",
"cls",
".",
"__new__",
"based",
"on",
"the",
"values",
"in",
"cls",
".",
"params",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipe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Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(6072 - 5961) + '\064' + chr(0b1000 + 0o57), 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\x6f' + chr(0b111 + 0o54) + '\060' + '\x36', 1594 - 1586), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101111) + chr(0b110010 + 0o2) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(0b110011) + chr(1314 - 1265), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1001 + 0o50) + '\061' + '\063', 15846 - 15838), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(0b100111 + 0o14), 0o10), ehT0Px3KOsy9('\060' + chr(0b1001000 + 0o47) + chr(49) + chr(0b110111) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(0b110011) + chr(0b1100 + 0o53), 43414 - 43406), ehT0Px3KOsy9('\x30' + chr(0b110001 + 0o76) + '\x33' + chr(48), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(1980 - 1930) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x36' + chr(50), 57929 - 57921), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + '\061' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(50) + chr(0b101101 + 0o7), 18205 - 18197), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101010 + 0o5) + chr(0b110001) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + chr(0b110000) + chr(0b101010 + 0o12), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101111) + '\062' + '\065' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(52) + '\064', 59491 - 59483), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + chr(0b110010) + chr(1698 - 1648) + chr(823 - 770), 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1011110 + 0o21) + '\x32' + '\x30' + chr(0b110011), 53925 - 53917), ehT0Px3KOsy9(chr(2146 - 2098) + chr(10635 - 10524) + chr(644 - 594) + chr(51) + chr(0b100000 + 0o21), 8), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\x33', 8), ehT0Px3KOsy9(chr(850 - 802) + '\x6f' + chr(49) + chr(0b110011) + chr(2076 - 2025), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(10275 - 10164) + '\065' + chr(49), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(49) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(2159 - 2111) + '\x6f' + chr(882 - 829) + chr(125 - 73), ord("\x08")), ehT0Px3KOsy9(chr(1936 - 1888) + chr(4437 - 4326) + chr(0b110100) + chr(806 - 753), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1907 - 1858) + chr(0b110000) + chr(1987 - 1937), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(0b11110 + 0o24) + '\061' + chr(55), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1101 + 0o45) + chr(0b10111 + 0o33) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b10001 + 0o136) + chr(206 - 157) + '\x35' + chr(0b101 + 0o56), ord("\x08")), ehT0Px3KOsy9(chr(1855 - 1807) + '\157' + chr(54) + chr(51), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(0b110000) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(49), 8), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\157' + chr(50) + chr(55) + chr(2470 - 2418), 0b1000), ehT0Px3KOsy9(chr(219 - 171) + chr(0b1101111) + chr(49) + '\x33' + chr(51), 8), ehT0Px3KOsy9(chr(48) + chr(0b101101 + 0o102) + '\063' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + chr(128 - 78) + chr(0b11011 + 0o32) + chr(0b10010 + 0o44), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(0b11000 + 0o34) + chr(0b110011 + 0o1), 8), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\x6f' + chr(50) + chr(51) + chr(1601 - 1549), 4362 - 4354)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(8315 - 8204) + chr(53) + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'?'), chr(0b1100100) + '\145' + '\143' + '\x6f' + '\144' + chr(0b1100101))('\x75' + chr(116) + '\x66' + chr(0b11010 + 0o23) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def FEWjiYX6DpMI(NSstowUUZlxS, M8EIoTs2GJXE):
nEbJZ4wfte2w = NSstowUUZlxS.nEbJZ4wfte2w
if not PlSM16l2KDPD(nEbJZ4wfte2w, PWiT5YHe31y6):
nEbJZ4wfte2w = {OolUPRJhRaJd: wxCCXClP4Gzp for OolUPRJhRaJd in nEbJZ4wfte2w}
uviSuHIGR2Qr = []
for (K3J4ZwSlE0sT, iQiGyxZrguoO) in xafqLlk3kkUe(nEbJZ4wfte2w, xafqLlk3kkUe(SXOLrMavuUCe(b'_]\xb0C\xd0\x1184\xb3K\x1f\x0b'), '\144' + '\145' + chr(99) + '\157' + chr(0b1100100) + chr(0b1100101))(chr(0b1001000 + 0o55) + chr(0b1011 + 0o151) + '\146' + '\x2d' + chr(1470 - 1414)))():
try:
QmmgWUB13VCJ = M8EIoTs2GJXE.pop(K3J4ZwSlE0sT, iQiGyxZrguoO)
if QmmgWUB13VCJ is wxCCXClP4Gzp:
raise RQ6CSRrFArYB(K3J4ZwSlE0sT)
xfhwxiBOH72k(QmmgWUB13VCJ)
except RQ6CSRrFArYB:
raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'jS\xbfV\xfc%j\x10\xbaewW\xb1\xe4j\xe7\xdd\x01\xf1\xa3\xf8+0L\xf6[J0\xeb\xb0\x1bR5p\xd1>h\xcb\x16\xbcjI\xa7K\xfcjy\x00\xf1'), chr(0b1010100 + 0o20) + chr(101) + chr(3267 - 3168) + chr(0b111101 + 0o62) + '\x64' + '\x65')('\x75' + '\x74' + '\146' + chr(45) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'G\x13\xb4I\xd1*XN\x8fh2X'), chr(0b1100100) + '\145' + chr(99) + '\x6f' + chr(5222 - 5122) + '\145')('\165' + chr(116) + chr(0b1100110) + '\x2d' + chr(56)))(typename=xafqLlk3kkUe(NSstowUUZlxS, xafqLlk3kkUe(SXOLrMavuUCe(b'VE\xa3L\xad$Q\x0c\x94T\x16\x04'), '\144' + '\145' + chr(2004 - 1905) + chr(0b1101111) + chr(0b1000010 + 0o42) + chr(101))(chr(0b1100001 + 0o24) + '\164' + chr(0b1100110) + chr(45) + '\070')), name=K3J4ZwSlE0sT))
except sznFqDbNBHlx:
raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'jS\xbfV\xfc%j\x10\xbaewW\xb1\xe4j\xe7\xdd\x01\xf1\xa3\xf8+3H\xfcDD \xe3\xf5KE&}\xc9><\xc8\x0b\xee1W\xa7T\xf8&n\t\xbajwI\xa7\xf5b\xe1\x88\x16\xe8\xaf\xb9i.]\xafKJ6\xaf\xeb\x1dR+d\xd9zn\xd3D\xf5\x7fT\xb2C\xf8/%'), '\x64' + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(0b1100101 + 0o20) + chr(0b1010001 + 0o43) + '\x66' + chr(0b101101) + chr(206 - 150)), xafqLlk3kkUe(SXOLrMavuUCe(b'G\x13\xb4I\xd1*XN\x8fh2X'), chr(0b1100100) + chr(0b1100101) + chr(4665 - 4566) + chr(3392 - 3281) + '\144' + '\x65')(chr(117) + '\164' + '\x66' + chr(0b10101 + 0o30) + '\070'))(typename=xafqLlk3kkUe(NSstowUUZlxS, xafqLlk3kkUe(SXOLrMavuUCe(b'VE\xa3L\xad$Q\x0c\x94T\x16\x04'), chr(0b11000 + 0o114) + '\145' + chr(0b1011010 + 0o11) + '\157' + chr(100) + '\145')(chr(13068 - 12951) + '\x74' + '\x66' + chr(0b11110 + 0o17) + chr(0b100101 + 0o23))), name=K3J4ZwSlE0sT, value=QmmgWUB13VCJ))
xafqLlk3kkUe(uviSuHIGR2Qr, xafqLlk3kkUe(SXOLrMavuUCe(b'pW\xb6C\xf7/'), '\144' + '\x65' + chr(99) + chr(111) + chr(0b1100100) + '\145')(chr(4198 - 4081) + '\x74' + '\x66' + chr(0b100100 + 0o11) + '\070'))((K3J4ZwSlE0sT, QmmgWUB13VCJ))
return KNyTy8rYcwji(uviSuHIGR2Qr)
|
quantopian/zipline
|
zipline/pipeline/term.py
|
Term._static_identity
|
def _static_identity(cls,
domain,
dtype,
missing_value,
window_safe,
ndim,
params):
"""
Return the identity of the Term that would be constructed from the
given arguments.
Identities that compare equal will cause us to return a cached instance
rather than constructing a new one. We do this primarily because it
makes dependency resolution easier.
This is a classmethod so that it can be called from Term.__new__ to
determine whether to produce a new instance.
"""
return (cls, domain, dtype, missing_value, window_safe, ndim, params)
|
python
|
def _static_identity(cls,
domain,
dtype,
missing_value,
window_safe,
ndim,
params):
"""
Return the identity of the Term that would be constructed from the
given arguments.
Identities that compare equal will cause us to return a cached instance
rather than constructing a new one. We do this primarily because it
makes dependency resolution easier.
This is a classmethod so that it can be called from Term.__new__ to
determine whether to produce a new instance.
"""
return (cls, domain, dtype, missing_value, window_safe, ndim, params)
|
[
"def",
"_static_identity",
"(",
"cls",
",",
"domain",
",",
"dtype",
",",
"missing_value",
",",
"window_safe",
",",
"ndim",
",",
"params",
")",
":",
"return",
"(",
"cls",
",",
"domain",
",",
"dtype",
",",
"missing_value",
",",
"window_safe",
",",
"ndim",
",",
"params",
")"
] |
Return the identity of the Term that would be constructed from the
given arguments.
Identities that compare equal will cause us to return a cached instance
rather than constructing a new one. We do this primarily because it
makes dependency resolution easier.
This is a classmethod so that it can be called from Term.__new__ to
determine whether to produce a new instance.
|
[
"Return",
"the",
"identity",
"of",
"the",
"Term",
"that",
"would",
"be",
"constructed",
"from",
"the",
"given",
"arguments",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/term.py#L217-L235
|
train
|
Static method that returns the identity of the Term that would be constructed from the given arguments.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24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YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\x6f' + chr(53) + chr(0b10001 + 0o45), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + chr(50) + '\x33' + '\061', 0b1000), ehT0Px3KOsy9(chr(1596 - 1548) + '\x6f' + '\x33' + chr(50) + chr(0b100111 + 0o14), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\x31' + chr(0b110010 + 0o0), ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + chr(0b111 + 0o54) + chr(537 - 487) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1233 - 1184) + chr(0b110010) + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(0b111 + 0o51) + '\067', 0b1000), ehT0Px3KOsy9(chr(1693 - 1645) + chr(111) + '\x32' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + '\063' + chr(0b100011 + 0o23) + '\x32', 0o10), ehT0Px3KOsy9('\060' + chr(3923 - 3812) + chr(2128 - 2078) + chr(0b110110) + chr(2116 - 2068), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110111) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + '\060' + chr(50), 0b1000), ehT0Px3KOsy9(chr(1426 - 1378) + chr(0b10110 + 0o131) + chr(0b110001) + '\x36' + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1000010 + 0o55) + chr(50) + chr(1318 - 1265) + chr(1672 - 1624), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b11 + 0o63) + chr(0b100110 + 0o14), 8), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\x6f' + chr(49) + chr(0b110111) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b100101 + 0o14) + chr(1612 - 1562) + chr(0b100110 + 0o16), 10567 - 10559), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + '\063' + '\060' + '\x32', 0b1000), ehT0Px3KOsy9('\060' + chr(11332 - 11221) + chr(53) + '\x30', 52164 - 52156), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101001 + 0o11) + '\064' + chr(2052 - 2004), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b110101 + 0o72) + '\062' + '\x36' + chr(131 - 78), 7103 - 7095), ehT0Px3KOsy9(chr(1279 - 1231) + '\157' + chr(0b110001) + chr(50) + '\061', 58338 - 58330), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(1283 - 1229) + chr(787 - 737), 8), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + chr(50) + chr(55) + chr(1446 - 1391), 40294 - 40286), ehT0Px3KOsy9('\x30' + chr(0b10101 + 0o132) + chr(0b11000 + 0o31) + chr(53) + chr(652 - 602), 10340 - 10332), ehT0Px3KOsy9(chr(995 - 947) + '\x6f' + chr(0b110001 + 0o0) + chr(48) + chr(820 - 770), 8), ehT0Px3KOsy9(chr(805 - 757) + '\x6f' + '\x33' + chr(0b110101) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + '\066' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b100010 + 0o115) + chr(0b110010) + '\x33' + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(2240 - 2190) + chr(0b10110 + 0o41), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + '\x32' + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(624 - 575) + chr(0b110111) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011001 + 0o26) + '\063' + chr(55) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100 + 0o143) + chr(500 - 450) + chr(52), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51), 9027 - 9019), ehT0Px3KOsy9('\060' + '\x6f' + chr(1086 - 1035) + chr(0b110101 + 0o2) + chr(976 - 923), 8), ehT0Px3KOsy9(chr(716 - 668) + '\157' + '\x32' + chr(0b10001 + 0o44) + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x35' + '\062', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b100001 + 0o21) + chr(53) + '\067', 3801 - 3793), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(0b11 + 0o60) + chr(52), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(1671 - 1560) + '\x35' + chr(48), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x00'), '\x64' + chr(101) + chr(99) + '\157' + '\144' + chr(408 - 307))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b10011 + 0o32) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def LLdu5GNkKH84(NSstowUUZlxS, psizfxY_oCoV, jSV9IKnemH7K, cM6FSYO3vPuj, O_h0iJ_jq6FX, gompHBiTsfJT, nEbJZ4wfte2w):
return (NSstowUUZlxS, psizfxY_oCoV, jSV9IKnemH7K, cM6FSYO3vPuj, O_h0iJ_jq6FX, gompHBiTsfJT, nEbJZ4wfte2w)
|
quantopian/zipline
|
zipline/pipeline/term.py
|
Term._init
|
def _init(self, domain, dtype, missing_value, window_safe, ndim, params):
"""
Parameters
----------
domain : zipline.pipeline.domain.Domain
The domain of this term.
dtype : np.dtype
Dtype of this term's output.
missing_value : object
Missing value for this term.
ndim : 1 or 2
The dimensionality of this term.
params : tuple[(str, hashable)]
Tuple of key/value pairs of additional parameters.
"""
self.domain = domain
self.dtype = dtype
self.missing_value = missing_value
self.window_safe = window_safe
self.ndim = ndim
for name, value in params:
if hasattr(self, name):
raise TypeError(
"Parameter {name!r} conflicts with already-present"
" attribute with value {value!r}.".format(
name=name,
value=getattr(self, name),
)
)
# TODO: Consider setting these values as attributes and replacing
# the boilerplate in NumericalExpression, Rank, and
# PercentileFilter.
self.params = dict(params)
# Make sure that subclasses call super() in their _validate() methods
# by setting this flag. The base class implementation of _validate
# should set this flag to True.
self._subclass_called_super_validate = False
self._validate()
assert self._subclass_called_super_validate, (
"Term._validate() was not called.\n"
"This probably means that you overrode _validate"
" without calling super()."
)
del self._subclass_called_super_validate
return self
|
python
|
def _init(self, domain, dtype, missing_value, window_safe, ndim, params):
"""
Parameters
----------
domain : zipline.pipeline.domain.Domain
The domain of this term.
dtype : np.dtype
Dtype of this term's output.
missing_value : object
Missing value for this term.
ndim : 1 or 2
The dimensionality of this term.
params : tuple[(str, hashable)]
Tuple of key/value pairs of additional parameters.
"""
self.domain = domain
self.dtype = dtype
self.missing_value = missing_value
self.window_safe = window_safe
self.ndim = ndim
for name, value in params:
if hasattr(self, name):
raise TypeError(
"Parameter {name!r} conflicts with already-present"
" attribute with value {value!r}.".format(
name=name,
value=getattr(self, name),
)
)
# TODO: Consider setting these values as attributes and replacing
# the boilerplate in NumericalExpression, Rank, and
# PercentileFilter.
self.params = dict(params)
# Make sure that subclasses call super() in their _validate() methods
# by setting this flag. The base class implementation of _validate
# should set this flag to True.
self._subclass_called_super_validate = False
self._validate()
assert self._subclass_called_super_validate, (
"Term._validate() was not called.\n"
"This probably means that you overrode _validate"
" without calling super()."
)
del self._subclass_called_super_validate
return self
|
[
"def",
"_init",
"(",
"self",
",",
"domain",
",",
"dtype",
",",
"missing_value",
",",
"window_safe",
",",
"ndim",
",",
"params",
")",
":",
"self",
".",
"domain",
"=",
"domain",
"self",
".",
"dtype",
"=",
"dtype",
"self",
".",
"missing_value",
"=",
"missing_value",
"self",
".",
"window_safe",
"=",
"window_safe",
"self",
".",
"ndim",
"=",
"ndim",
"for",
"name",
",",
"value",
"in",
"params",
":",
"if",
"hasattr",
"(",
"self",
",",
"name",
")",
":",
"raise",
"TypeError",
"(",
"\"Parameter {name!r} conflicts with already-present\"",
"\" attribute with value {value!r}.\"",
".",
"format",
"(",
"name",
"=",
"name",
",",
"value",
"=",
"getattr",
"(",
"self",
",",
"name",
")",
",",
")",
")",
"# TODO: Consider setting these values as attributes and replacing",
"# the boilerplate in NumericalExpression, Rank, and",
"# PercentileFilter.",
"self",
".",
"params",
"=",
"dict",
"(",
"params",
")",
"# Make sure that subclasses call super() in their _validate() methods",
"# by setting this flag. The base class implementation of _validate",
"# should set this flag to True.",
"self",
".",
"_subclass_called_super_validate",
"=",
"False",
"self",
".",
"_validate",
"(",
")",
"assert",
"self",
".",
"_subclass_called_super_validate",
",",
"(",
"\"Term._validate() was not called.\\n\"",
"\"This probably means that you overrode _validate\"",
"\" without calling super().\"",
")",
"del",
"self",
".",
"_subclass_called_super_validate",
"return",
"self"
] |
Parameters
----------
domain : zipline.pipeline.domain.Domain
The domain of this term.
dtype : np.dtype
Dtype of this term's output.
missing_value : object
Missing value for this term.
ndim : 1 or 2
The dimensionality of this term.
params : tuple[(str, hashable)]
Tuple of key/value pairs of additional parameters.
|
[
"Parameters",
"----------",
"domain",
":",
"zipline",
".",
"pipeline",
".",
"domain",
".",
"Domain",
"The",
"domain",
"of",
"this",
"term",
".",
"dtype",
":",
"np",
".",
"dtype",
"Dtype",
"of",
"this",
"term",
"s",
"output",
".",
"missing_value",
":",
"object",
"Missing",
"value",
"for",
"this",
"term",
".",
"ndim",
":",
"1",
"or",
"2",
"The",
"dimensionality",
"of",
"this",
"term",
".",
"params",
":",
"tuple",
"[",
"(",
"str",
"hashable",
")",
"]",
"Tuple",
"of",
"key",
"/",
"value",
"pairs",
"of",
"additional",
"parameters",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/term.py#L237-L285
|
train
|
Initializes the object with the given parameters.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_z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J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1496 - 1445) + chr(1650 - 1598) + chr(799 - 744), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110100) + chr(713 - 663), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\064' + chr(0b1100 + 0o53), 15748 - 15740), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1011111 + 0o20) + chr(49) + chr(49) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b111 + 0o53) + chr(0b11011 + 0o34) + chr(0b111 + 0o56), ord("\x08")), ehT0Px3KOsy9(chr(381 - 333) + chr(111) + '\x36' + chr(0b10001 + 0o45), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + '\065' + chr(0b110011), 55522 - 55514), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(1794 - 1742) + chr(0b100101 + 0o21), 16986 - 16978), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1000010 + 0o55) + '\062' + '\x37' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(1772 - 1724) + '\x6f' + chr(49) + chr(51) + chr(0b100001 + 0o24), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11100 + 0o123) + '\x31' + chr(0b101010 + 0o15) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011100 + 0o23) + chr(573 - 523) + chr(2494 - 2440) + chr(2275 - 2227), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + '\063' + chr(0b110 + 0o52) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(1991 - 1943) + chr(1647 - 1536) + chr(50) + chr(0b110110) + chr(2044 - 1994), 11875 - 11867), ehT0Px3KOsy9(chr(1081 - 1033) + chr(0b1110 + 0o141) + '\061' + '\x34' + chr(0b11001 + 0o31), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(0b110010) + chr(231 - 179), 10990 - 10982), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(6478 - 6367) + chr(2289 - 2238) + '\x36' + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1001000 + 0o47) + chr(0b110011) + chr(2046 - 1997) + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(1328 - 1278) + chr(1092 - 1042), 48329 - 48321), ehT0Px3KOsy9('\060' + chr(0b111000 + 0o67) + chr(49) + chr(54) + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b11 + 0o154) + '\062' + chr(2335 - 2283), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110101) + chr(1759 - 1704), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8491 - 8380) + chr(49) + chr(0b110001) + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + '\063' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + '\063' + '\x34' + chr(0b1011 + 0o52), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1001111 + 0o40) + chr(0b110101) + chr(48), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\x31', 48437 - 48429), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100111 + 0o10) + chr(0b1000 + 0o53) + chr(1770 - 1720) + chr(0b110 + 0o61), 0b1000), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + '\062' + '\x34' + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11001 + 0o30) + '\064' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(0b110110) + chr(1479 - 1424), ord("\x08")), ehT0Px3KOsy9(chr(837 - 789) + chr(0b1110 + 0o141) + chr(0b110001) + chr(0b101011 + 0o5) + chr(2109 - 2055), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b110101) + chr(806 - 752), 54547 - 54539), ehT0Px3KOsy9(chr(971 - 923) + '\157' + chr(641 - 592) + '\x32' + chr(0b101000 + 0o17), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100011 + 0o17) + chr(50) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(1352 - 1304) + '\157' + chr(0b101111 + 0o6) + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(1793 - 1743) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110110) + chr(0b101101 + 0o7), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(53), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(0b1111 + 0o42) + chr(0b110000), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(111) + '\065' + chr(0b110000), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9'), chr(6901 - 6801) + chr(101) + chr(121 - 22) + '\157' + chr(100) + '\x65')(chr(0b11101 + 0o130) + chr(0b101011 + 0o111) + '\x66' + chr(1230 - 1185) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def KhqlOPpfJpVu(oVre8I6UXc3b, psizfxY_oCoV, jSV9IKnemH7K, cM6FSYO3vPuj, O_h0iJ_jq6FX, gompHBiTsfJT, nEbJZ4wfte2w):
oVre8I6UXc3b.psizfxY_oCoV = psizfxY_oCoV
oVre8I6UXc3b.jSV9IKnemH7K = jSV9IKnemH7K
oVre8I6UXc3b.cM6FSYO3vPuj = cM6FSYO3vPuj
oVre8I6UXc3b.O_h0iJ_jq6FX = O_h0iJ_jq6FX
oVre8I6UXc3b.gompHBiTsfJT = gompHBiTsfJT
for (AIvJRzLdDfgF, QmmgWUB13VCJ) in nEbJZ4wfte2w:
if lot1PSoAwYhj(oVre8I6UXc3b, AIvJRzLdDfgF):
raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7CU.\xd0S\x9f\xc3\xcd}\x07\xde\xa5\xdf\x07u\x86\xb3\xb2\x12{A-\xb5\x8cK}\xa4\x87\x16\xde2\x86w\xf6@gQd,\x9e\x0fW=\xd8E\x8e\xc8\xcb}\x1d\xc4\xb0\xc0\x0b6\x81\xba\xf7QcF?\xb1\xc5^h\xbb\xd2\x04\x97=\x986\xfbYp\x15w5\xc9'), '\144' + chr(0b1011000 + 0o15) + chr(0b1011101 + 0o6) + chr(0b101 + 0o152) + chr(100) + chr(0b1011111 + 0o6))('\x75' + chr(0b1001101 + 0o47) + chr(0b1000101 + 0o41) + chr(0b101101) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\x16U \xf5W\xb8\x95\xef-\x19\xda'), chr(100) + chr(5768 - 5667) + '\x63' + '\157' + chr(0b1100100) + chr(8478 - 8377))(chr(117) + chr(0b1110100) + chr(0b1100110) + '\055' + '\070'))(name=AIvJRzLdDfgF, value=xafqLlk3kkUe(oVre8I6UXc3b, AIvJRzLdDfgF)))
oVre8I6UXc3b.nEbJZ4wfte2w = wLqBDw8l0eIm(nEbJZ4wfte2w)
oVre8I6UXc3b.PEbDyXh266Nx = ehT0Px3KOsy9(chr(48) + chr(0b1010110 + 0o31) + chr(0b101101 + 0o3), ord("\x08"))
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8TF#\xd4R\x8a\xd2\xda'), '\x64' + chr(1519 - 1418) + chr(0b101010 + 0o71) + chr(0b1000010 + 0o55) + '\x64' + chr(8270 - 8169))(chr(0b1101100 + 0o11) + chr(8860 - 8744) + chr(7309 - 7207) + chr(45) + '\070'))()
assert xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7gE\x0b\xc4n\x83\x94\x89k2\xc8'), chr(0b1000 + 0o134) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(100) + chr(101))(chr(0b1110101) + chr(6038 - 5922) + chr(102) + chr(0b101101) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb3GU"\x93i\x9d\xc7\xd34\x18\xd1\xb0\xd7J}\xd4\xb9\xf3\x024A$\xad\xc5Kh\xbb\xcb\x04\xd3h\xe4\x03\xffEf\x14u:\x88@F-\xd1O\xcb\xcb\xda<\x12\xc3\xe4\xc6\n5\x80\xee\xeb\x1ea\x0f$\xaf\x80Z{\xb8\xc3\x04\x97\x19\x986\xfbEqUq-\xc7UN;\xd5Y\x9e\xd2\x9f>\x1d\xdc\xa8\xdb\x0c3\xd4\xbd\xe7\x01q]c\xaa\x80Do\xf9\xf8>\xd4*\x8f$\xe4sJ\x18%;\x82NAf\x93'), '\144' + '\145' + '\143' + '\x6f' + chr(0b1100100) + '\x65')('\x75' + chr(116) + '\146' + chr(0b101101) + chr(56))
del xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7gE\x0b\xc4n\x83\x94\x89k2\xc8'), chr(9058 - 8958) + chr(4883 - 4782) + chr(99) + chr(111) + chr(0b100 + 0o140) + '\145')('\165' + chr(0b1110100) + '\146' + chr(0b11001 + 0o24) + chr(0b111000)))
return oVre8I6UXc3b
|
quantopian/zipline
|
zipline/pipeline/term.py
|
ComputableTerm.dependencies
|
def dependencies(self):
"""
The number of extra rows needed for each of our inputs to compute this
term.
"""
extra_input_rows = max(0, self.window_length - 1)
out = {}
for term in self.inputs:
out[term] = extra_input_rows
out[self.mask] = 0
return out
|
python
|
def dependencies(self):
"""
The number of extra rows needed for each of our inputs to compute this
term.
"""
extra_input_rows = max(0, self.window_length - 1)
out = {}
for term in self.inputs:
out[term] = extra_input_rows
out[self.mask] = 0
return out
|
[
"def",
"dependencies",
"(",
"self",
")",
":",
"extra_input_rows",
"=",
"max",
"(",
"0",
",",
"self",
".",
"window_length",
"-",
"1",
")",
"out",
"=",
"{",
"}",
"for",
"term",
"in",
"self",
".",
"inputs",
":",
"out",
"[",
"term",
"]",
"=",
"extra_input_rows",
"out",
"[",
"self",
".",
"mask",
"]",
"=",
"0",
"return",
"out"
] |
The number of extra rows needed for each of our inputs to compute this
term.
|
[
"The",
"number",
"of",
"extra",
"rows",
"needed",
"for",
"each",
"of",
"our",
"inputs",
"to",
"compute",
"this",
"term",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/term.py#L613-L623
|
train
|
A dictionary of all the term - level dependencies for this term.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,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K8V7h0,Rurm1zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(111) + '\063' + chr(315 - 260) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(389 - 341) + '\x6f' + '\x37' + chr(0b110 + 0o57), 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\x6f' + chr(2352 - 2303) + '\x32' + chr(54), 44319 - 44311), ehT0Px3KOsy9(chr(48) + chr(0b10100 + 0o133) + '\062' + '\x33' + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(12290 - 12179) + chr(603 - 552) + chr(50) + chr(0b1000 + 0o54), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2394 - 2343) + chr(52) + chr(2143 - 2088), 19571 - 19563), ehT0Px3KOsy9(chr(1957 - 1909) + chr(111) + '\063' + chr(50) + chr(0b1111 + 0o42), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x37' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + chr(0b100 + 0o55) + '\064' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(451 - 403) + chr(111) + chr(50) + chr(0b110000) + chr(232 - 182), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100100 + 0o13) + chr(50) + chr(51) + chr(52), 40903 - 40895), ehT0Px3KOsy9('\x30' + '\157' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11848 - 11737) + '\x37', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + '\x35' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + '\065', 15432 - 15424), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(2468 - 2417) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100011 + 0o17) + chr(2789 - 2734) + '\062', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + '\x32' + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + chr(11664 - 11553) + '\x32' + chr(0b1011 + 0o45) + '\x33', 5482 - 5474), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(305 - 251) + chr(2381 - 2331), 44872 - 44864), ehT0Px3KOsy9('\060' + chr(0b1010111 + 0o30) + chr(0b110011) + chr(0b101 + 0o56) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(53) + '\x34', 49966 - 49958), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(0b110010) + chr(1968 - 1919), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10100 + 0o35) + chr(1713 - 1660) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101111 + 0o3) + '\062' + chr(487 - 439), 42553 - 42545), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + chr(279 - 230) + '\x36' + chr(48), 63188 - 63180), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(0b110011) + chr(0b110000), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101101 + 0o2) + '\061' + chr(1078 - 1029) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(771 - 721) + chr(0b1010 + 0o53) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1558 - 1508) + chr(2158 - 2104) + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1815 - 1765) + '\063' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(436 - 325) + '\x32' + chr(52) + chr(0b100100 + 0o22), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b101010 + 0o14) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(0b110000) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(464 - 409) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(1072 - 1024) + chr(111) + chr(0b1000 + 0o53) + '\067' + chr(50), 0o10), ehT0Px3KOsy9(chr(111 - 63) + '\x6f' + chr(51) + chr(0b110011) + chr(0b110000), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + '\x35' + chr(1891 - 1843), 52551 - 52543), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(662 - 613) + chr(48) + chr(556 - 503), 0o10), ehT0Px3KOsy9(chr(632 - 584) + chr(552 - 441) + chr(85 - 30), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110101) + chr(0b110000), 11459 - 11451)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5'), '\144' + '\145' + chr(99) + chr(0b1101111) + chr(2493 - 2393) + chr(101))(chr(117) + '\164' + chr(102) + '\055' + chr(3050 - 2994)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Byl3zcCxSdim(oVre8I6UXc3b):
VAjQgfJhHcor = tsdjvlgh9gDP(ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110000), 0o10), oVre8I6UXc3b.window_length - ehT0Px3KOsy9(chr(1751 - 1703) + chr(0b1101111) + '\061', ord("\x08")))
UkrMp_I0RDmo = {}
for BnuOe7t2jDZ6 in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8de9\xee\xa4\x82\xa1v\x11\xc1\xc4R'), chr(100) + '\145' + chr(0b1100011) + '\x6f' + chr(100) + chr(0b1100101))(chr(0b1110101) + '\164' + '\146' + chr(1103 - 1058) + chr(0b101001 + 0o17))):
UkrMp_I0RDmo[BnuOe7t2jDZ6] = VAjQgfJhHcor
UkrMp_I0RDmo[oVre8I6UXc3b.Iz1jSgUKZDvt] = ehT0Px3KOsy9('\x30' + chr(7059 - 6948) + chr(0b10101 + 0o33), 8)
return UkrMp_I0RDmo
|
quantopian/zipline
|
zipline/pipeline/term.py
|
ComputableTerm.to_workspace_value
|
def to_workspace_value(self, result, assets):
"""
Called with a column of the result of a pipeline. This needs to put
the data into a format that can be used in a workspace to continue
doing computations.
Parameters
----------
result : pd.Series
A multiindexed series with (dates, assets) whose values are the
results of running this pipeline term over the dates.
assets : pd.Index
All of the assets being requested. This allows us to correctly
shape the workspace value.
Returns
-------
workspace_value : array-like
An array like value that the engine can consume.
"""
return result.unstack().fillna(self.missing_value).reindex(
columns=assets,
fill_value=self.missing_value,
).values
|
python
|
def to_workspace_value(self, result, assets):
"""
Called with a column of the result of a pipeline. This needs to put
the data into a format that can be used in a workspace to continue
doing computations.
Parameters
----------
result : pd.Series
A multiindexed series with (dates, assets) whose values are the
results of running this pipeline term over the dates.
assets : pd.Index
All of the assets being requested. This allows us to correctly
shape the workspace value.
Returns
-------
workspace_value : array-like
An array like value that the engine can consume.
"""
return result.unstack().fillna(self.missing_value).reindex(
columns=assets,
fill_value=self.missing_value,
).values
|
[
"def",
"to_workspace_value",
"(",
"self",
",",
"result",
",",
"assets",
")",
":",
"return",
"result",
".",
"unstack",
"(",
")",
".",
"fillna",
"(",
"self",
".",
"missing_value",
")",
".",
"reindex",
"(",
"columns",
"=",
"assets",
",",
"fill_value",
"=",
"self",
".",
"missing_value",
",",
")",
".",
"values"
] |
Called with a column of the result of a pipeline. This needs to put
the data into a format that can be used in a workspace to continue
doing computations.
Parameters
----------
result : pd.Series
A multiindexed series with (dates, assets) whose values are the
results of running this pipeline term over the dates.
assets : pd.Index
All of the assets being requested. This allows us to correctly
shape the workspace value.
Returns
-------
workspace_value : array-like
An array like value that the engine can consume.
|
[
"Called",
"with",
"a",
"column",
"of",
"the",
"result",
"of",
"a",
"pipeline",
".",
"This",
"needs",
"to",
"put",
"the",
"data",
"into",
"a",
"format",
"that",
"can",
"be",
"used",
"in",
"a",
"workspace",
"to",
"continue",
"doing",
"computations",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/term.py#L638-L661
|
train
|
This method converts the result of a pipeline into a workspace value that can be used in a workspace.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pd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eError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(889 - 841) + chr(635 - 524) + chr(163 - 113) + '\065' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(0b110101) + chr(2052 - 2002), 30247 - 30239), ehT0Px3KOsy9(chr(0b110000) + chr(0b10011 + 0o134) + '\x32' + chr(0b0 + 0o67) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5233 - 5122) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1034 - 983) + chr(55) + chr(1041 - 991), 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + chr(51) + chr(54) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + chr(0b110100) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b110111 + 0o70) + chr(0b110010), 23912 - 23904), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(0b111 + 0o56) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\x31' + '\x31', 49215 - 49207), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1101111) + '\063' + chr(690 - 640) + '\x34', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(93 - 44), 20338 - 20330), ehT0Px3KOsy9(chr(48) + chr(0b100100 + 0o113) + chr(1800 - 1745) + '\061', 17071 - 17063), ehT0Px3KOsy9('\060' + chr(111) + chr(1636 - 1586) + chr(51) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(240 - 190) + chr(54) + chr(1455 - 1405), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(2085 - 2033) + '\066', 0b1000), ehT0Px3KOsy9(chr(2152 - 2104) + '\x6f' + '\x33' + chr(924 - 876) + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + chr(10597 - 10486) + chr(578 - 529) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\157' + '\062' + chr(0b110111) + chr(0b1010 + 0o55), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010), 8), ehT0Px3KOsy9('\060' + chr(6664 - 6553) + '\x34' + chr(53), 27021 - 27013), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(467 - 414) + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(48) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1010 + 0o145) + chr(51) + chr(2078 - 2028) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(114 - 66) + chr(10124 - 10013) + chr(1806 - 1755) + chr(0b110000) + chr(2701 - 2646), 54644 - 54636), ehT0Px3KOsy9(chr(48) + chr(0b10110 + 0o131) + chr(517 - 466) + '\064' + chr(2418 - 2363), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110100) + chr(0b10111 + 0o40), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b110111 + 0o70) + chr(0b110001) + '\063' + chr(0b1000 + 0o50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10001 + 0o41) + chr(51) + '\060', 27573 - 27565), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b110001) + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(1050 - 998) + '\062', 0o10), ehT0Px3KOsy9(chr(1865 - 1817) + chr(0b1101111) + chr(281 - 232) + '\063' + '\066', 27969 - 27961), ehT0Px3KOsy9(chr(2265 - 2217) + chr(0b1000 + 0o147) + chr(0b110001) + chr(0b10101 + 0o37) + '\x32', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110 + 0o53) + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1226 - 1177) + chr(1735 - 1687) + '\062', 39466 - 39458), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + '\x36' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(1819 - 1771) + chr(0b1011001 + 0o26) + '\062' + chr(0b101101 + 0o3) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000100 + 0o53) + chr(0b1110 + 0o44) + chr(0b110111) + chr(2081 - 2028), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(10255 - 10144) + chr(0b110001) + chr(53) + chr(1684 - 1631), 22398 - 22390), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b101010 + 0o105) + chr(0b1111 + 0o43) + '\x35', 14091 - 14083)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(53) + '\060', 61509 - 61501)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x86'), '\144' + chr(2472 - 2371) + chr(0b1100011) + '\x6f' + '\x64' + chr(0b1100101))(chr(595 - 478) + '\x74' + '\146' + chr(0b101101) + chr(0b10111 + 0o41)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def fKt9OtHxl6gz(oVre8I6UXc3b, ShZmEKfTkAOZ, YGFU3oxACPcg):
return xafqLlk3kkUe(ShZmEKfTkAOZ.unstack().fillna(oVre8I6UXc3b.missing_value).reindex(columns=YGFU3oxACPcg, fill_value=oVre8I6UXc3b.missing_value), xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb\xba\xd1C\xb4\x82\x116\xa5\xb8\xb0c'), chr(7261 - 7161) + '\145' + chr(0b1100011) + chr(0b1011010 + 0o25) + chr(5365 - 5265) + chr(0b1011000 + 0o15))('\165' + chr(0b1100011 + 0o21) + chr(102) + '\x2d' + chr(56)))
|
quantopian/zipline
|
zipline/finance/position.py
|
Position.earn_stock_dividend
|
def earn_stock_dividend(self, stock_dividend):
"""
Register the number of shares we held at this dividend's ex date so
that we can pay out the correct amount on the dividend's pay date.
"""
return {
'payment_asset': stock_dividend.payment_asset,
'share_count': np.floor(
self.amount * float(stock_dividend.ratio)
)
}
|
python
|
def earn_stock_dividend(self, stock_dividend):
"""
Register the number of shares we held at this dividend's ex date so
that we can pay out the correct amount on the dividend's pay date.
"""
return {
'payment_asset': stock_dividend.payment_asset,
'share_count': np.floor(
self.amount * float(stock_dividend.ratio)
)
}
|
[
"def",
"earn_stock_dividend",
"(",
"self",
",",
"stock_dividend",
")",
":",
"return",
"{",
"'payment_asset'",
":",
"stock_dividend",
".",
"payment_asset",
",",
"'share_count'",
":",
"np",
".",
"floor",
"(",
"self",
".",
"amount",
"*",
"float",
"(",
"stock_dividend",
".",
"ratio",
")",
")",
"}"
] |
Register the number of shares we held at this dividend's ex date so
that we can pay out the correct amount on the dividend's pay date.
|
[
"Register",
"the",
"number",
"of",
"shares",
"we",
"held",
"at",
"this",
"dividend",
"s",
"ex",
"date",
"so",
"that",
"we",
"can",
"pay",
"out",
"the",
"correct",
"amount",
"on",
"the",
"dividend",
"s",
"pay",
"date",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/finance/position.py#L79-L89
|
train
|
Return the earned stock dividend.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OK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o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + chr(1498 - 1449) + chr(0b110011) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + chr(8805 - 8694) + chr(49) + chr(0b101000 + 0o13), 51520 - 51512), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\062' + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(53) + chr(0b101111 + 0o7), 9439 - 9431), ehT0Px3KOsy9(chr(1836 - 1788) + chr(0b1000110 + 0o51) + '\x32' + chr(49) + '\x32', 39760 - 39752), ehT0Px3KOsy9(chr(2217 - 2169) + '\157' + chr(2082 - 2033) + chr(1506 - 1451) + chr(54), 9568 - 9560), ehT0Px3KOsy9(chr(1630 - 1582) + chr(111) + chr(0b101111 + 0o3) + '\061' + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010100 + 0o33) + '\065', 60400 - 60392), ehT0Px3KOsy9(chr(669 - 621) + chr(10443 - 10332) + '\064' + chr(511 - 457), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + chr(49) + chr(0b110110) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(11955 - 11844) + '\x32' + '\064' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(0b110111) + chr(0b10011 + 0o41), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(2072 - 2022) + chr(54) + chr(0b111 + 0o56), 0o10), ehT0Px3KOsy9('\x30' + chr(9034 - 8923) + chr(0b111 + 0o56), 8), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(0b110001) + chr(0b110001 + 0o2), 6620 - 6612), ehT0Px3KOsy9('\x30' + chr(0b1001 + 0o146) + '\062' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1010101 + 0o32) + chr(50) + '\067' + chr(0b101010 + 0o15), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(0b101111 + 0o1) + chr(0b101000 + 0o15), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b111010 + 0o65) + '\062' + chr(50) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(89 - 41) + '\x6f' + chr(53), 8), ehT0Px3KOsy9(chr(48) + chr(4390 - 4279) + chr(0b110011) + chr(49) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(111) + chr(52) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010 + 0o145) + chr(0b110010) + chr(0b10 + 0o62) + '\x32', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(700 - 650) + '\061' + '\063', 0o10), ehT0Px3KOsy9(chr(48) + chr(983 - 872) + chr(0b110 + 0o55) + chr(52) + chr(54), 51778 - 51770), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\x6f' + chr(0b100110 + 0o17) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(2348 - 2237) + chr(49) + chr(48) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(1735 - 1687) + chr(6430 - 6319) + chr(2518 - 2467) + chr(2309 - 2258), 46102 - 46094), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(879 - 828) + chr(2655 - 2602), ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1001 + 0o146) + chr(0b110011) + '\060' + '\x37', 27272 - 27264), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(0b1001 + 0o56) + '\x34', 14468 - 14460), ehT0Px3KOsy9('\x30' + '\x6f' + chr(52) + '\061', 0o10), ehT0Px3KOsy9(chr(1030 - 982) + chr(8357 - 8246) + chr(2042 - 1991) + '\067' + chr(0b111 + 0o54), 48021 - 48013), ehT0Px3KOsy9('\x30' + chr(184 - 73) + '\062' + chr(0b100001 + 0o17) + chr(0b1010 + 0o46), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1111 - 1062) + chr(51) + chr(2174 - 2122), 0o10), ehT0Px3KOsy9(chr(1497 - 1449) + '\157' + '\x33' + '\062' + '\067', 0o10), ehT0Px3KOsy9('\060' + chr(2918 - 2807) + chr(0b11100 + 0o27) + '\063' + chr(0b11100 + 0o31), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100 + 0o60), 0b1000), ehT0Px3KOsy9(chr(2285 - 2237) + '\157' + '\065' + '\061', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(54) + '\067', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1903 - 1855) + chr(111) + chr(0b110101) + chr(0b110000), 14901 - 14893)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'u'), '\144' + chr(0b1100101) + chr(0b100 + 0o137) + chr(111) + chr(7818 - 7718) + chr(0b1100101))(chr(0b1010101 + 0o40) + chr(2100 - 1984) + '\146' + '\x2d' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ly__XrYSAl5P(oVre8I6UXc3b, sVJt7ktLCxGl):
return {xafqLlk3kkUe(SXOLrMavuUCe(b'+j-C\xef\x10\xfbZG\x07\xd0Y\xc1'), '\144' + '\x65' + '\143' + chr(12000 - 11889) + chr(0b1100100) + chr(0b1001001 + 0o34))('\x75' + chr(0b101011 + 0o111) + '\146' + '\x2d' + chr(0b101000 + 0o20)): xafqLlk3kkUe(sVJt7ktLCxGl, xafqLlk3kkUe(SXOLrMavuUCe(b'+j-C\xef\x10\xfbZG\x07\xd0Y\xc1'), '\144' + '\x65' + chr(99) + chr(0b11 + 0o154) + chr(0b11010 + 0o112) + chr(101))('\165' + chr(116) + chr(0b1100110) + chr(1838 - 1793) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'(c5\\\xef!\xecjS\x1a\xd7'), chr(100) + chr(0b1100101) + chr(6534 - 6435) + chr(111) + '\144' + chr(0b1001001 + 0o34))('\165' + chr(6440 - 6324) + chr(102) + '\x2d' + '\070'): xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'=g;A\xf8'), '\x64' + chr(0b1100101) + '\x63' + chr(9534 - 9423) + '\x64' + '\x65')('\165' + chr(116) + chr(102) + '\x2d' + '\070'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b':f;[\xe4\n'), '\144' + '\x65' + chr(0b1 + 0o142) + '\157' + chr(0b1100100) + '\x65')('\x75' + chr(0b1000000 + 0o64) + chr(0b1100110) + '\x2d' + chr(911 - 855))) * kkSX4ccExqw4(xafqLlk3kkUe(sVJt7ktLCxGl, xafqLlk3kkUe(SXOLrMavuUCe(b')j G\xe5'), chr(100) + '\x65' + chr(8645 - 8546) + chr(0b111101 + 0o62) + chr(0b1100100) + chr(0b1011101 + 0o10))(chr(117) + chr(2609 - 2493) + chr(0b1100110) + chr(0b101101) + chr(0b111000)))))}
|
quantopian/zipline
|
zipline/finance/position.py
|
Position.handle_split
|
def handle_split(self, asset, ratio):
"""
Update the position by the split ratio, and return the resulting
fractional share that will be converted into cash.
Returns the unused cash.
"""
if self.asset != asset:
raise Exception("updating split with the wrong asset!")
# adjust the # of shares by the ratio
# (if we had 100 shares, and the ratio is 3,
# we now have 33 shares)
# (old_share_count / ratio = new_share_count)
# (old_price * ratio = new_price)
# e.g., 33.333
raw_share_count = self.amount / float(ratio)
# e.g., 33
full_share_count = np.floor(raw_share_count)
# e.g., 0.333
fractional_share_count = raw_share_count - full_share_count
# adjust the cost basis to the nearest cent, e.g., 60.0
new_cost_basis = round(self.cost_basis * ratio, 2)
self.cost_basis = new_cost_basis
self.amount = full_share_count
return_cash = round(float(fractional_share_count * new_cost_basis), 2)
log.info("after split: " + str(self))
log.info("returning cash: " + str(return_cash))
# return the leftover cash, which will be converted into cash
# (rounded to the nearest cent)
return return_cash
|
python
|
def handle_split(self, asset, ratio):
"""
Update the position by the split ratio, and return the resulting
fractional share that will be converted into cash.
Returns the unused cash.
"""
if self.asset != asset:
raise Exception("updating split with the wrong asset!")
# adjust the # of shares by the ratio
# (if we had 100 shares, and the ratio is 3,
# we now have 33 shares)
# (old_share_count / ratio = new_share_count)
# (old_price * ratio = new_price)
# e.g., 33.333
raw_share_count = self.amount / float(ratio)
# e.g., 33
full_share_count = np.floor(raw_share_count)
# e.g., 0.333
fractional_share_count = raw_share_count - full_share_count
# adjust the cost basis to the nearest cent, e.g., 60.0
new_cost_basis = round(self.cost_basis * ratio, 2)
self.cost_basis = new_cost_basis
self.amount = full_share_count
return_cash = round(float(fractional_share_count * new_cost_basis), 2)
log.info("after split: " + str(self))
log.info("returning cash: " + str(return_cash))
# return the leftover cash, which will be converted into cash
# (rounded to the nearest cent)
return return_cash
|
[
"def",
"handle_split",
"(",
"self",
",",
"asset",
",",
"ratio",
")",
":",
"if",
"self",
".",
"asset",
"!=",
"asset",
":",
"raise",
"Exception",
"(",
"\"updating split with the wrong asset!\"",
")",
"# adjust the # of shares by the ratio",
"# (if we had 100 shares, and the ratio is 3,",
"# we now have 33 shares)",
"# (old_share_count / ratio = new_share_count)",
"# (old_price * ratio = new_price)",
"# e.g., 33.333",
"raw_share_count",
"=",
"self",
".",
"amount",
"/",
"float",
"(",
"ratio",
")",
"# e.g., 33",
"full_share_count",
"=",
"np",
".",
"floor",
"(",
"raw_share_count",
")",
"# e.g., 0.333",
"fractional_share_count",
"=",
"raw_share_count",
"-",
"full_share_count",
"# adjust the cost basis to the nearest cent, e.g., 60.0",
"new_cost_basis",
"=",
"round",
"(",
"self",
".",
"cost_basis",
"*",
"ratio",
",",
"2",
")",
"self",
".",
"cost_basis",
"=",
"new_cost_basis",
"self",
".",
"amount",
"=",
"full_share_count",
"return_cash",
"=",
"round",
"(",
"float",
"(",
"fractional_share_count",
"*",
"new_cost_basis",
")",
",",
"2",
")",
"log",
".",
"info",
"(",
"\"after split: \"",
"+",
"str",
"(",
"self",
")",
")",
"log",
".",
"info",
"(",
"\"returning cash: \"",
"+",
"str",
"(",
"return_cash",
")",
")",
"# return the leftover cash, which will be converted into cash",
"# (rounded to the nearest cent)",
"return",
"return_cash"
] |
Update the position by the split ratio, and return the resulting
fractional share that will be converted into cash.
Returns the unused cash.
|
[
"Update",
"the",
"position",
"by",
"the",
"split",
"ratio",
"and",
"return",
"the",
"resulting",
"fractional",
"share",
"that",
"will",
"be",
"converted",
"into",
"cash",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/finance/position.py#L91-L129
|
train
|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YzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(305 - 252) + chr(1686 - 1636), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000000 + 0o57) + '\061' + chr(0b110101) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(54) + '\x34', 48529 - 48521), ehT0Px3KOsy9('\060' + chr(1495 - 1384) + chr(901 - 850) + chr(0b100001 + 0o20) + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(2624 - 2572) + chr(0b110100), 61316 - 61308), ehT0Px3KOsy9(chr(48) + chr(7128 - 7017) + chr(51) + chr(0b11 + 0o61), 65375 - 65367), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1110 + 0o45) + '\x31' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(2556 - 2445) + chr(0b110011) + chr(0b110 + 0o60) + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(1362 - 1311) + '\x34', 0o10), ehT0Px3KOsy9(chr(1887 - 1839) + '\157' + chr(0b10011 + 0o40) + chr(1748 - 1700) + chr(1128 - 1074), 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(8680 - 8569) + chr(55) + '\x35', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\062' + '\x32', 0o10), ehT0Px3KOsy9(chr(115 - 67) + '\x6f' + chr(247 - 197) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(1556 - 1508) + chr(0b1011010 + 0o25) + '\x33' + chr(0b101001 + 0o12) + chr(2081 - 2029), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(55) + chr(2330 - 2279), 0b1000), ehT0Px3KOsy9(chr(152 - 104) + chr(11351 - 11240) + chr(49) + chr(0b110101) + '\x32', 41176 - 41168), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\x31' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(53) + chr(0b100110 + 0o17), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(616 - 563) + chr(0b110101), 8), ehT0Px3KOsy9(chr(55 - 7) + chr(111) + '\061' + chr(0b110010) + chr(0b100010 + 0o23), 36287 - 36279), ehT0Px3KOsy9(chr(1705 - 1657) + '\157' + chr(1785 - 1734) + chr(49) + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100 + 0o56) + '\066' + '\x37', 21156 - 21148), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + '\x37' + chr(0b110110), 10624 - 10616), ehT0Px3KOsy9('\x30' + chr(111) + '\066' + chr(55), 37263 - 37255), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2106 - 2055) + '\065' + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(50) + chr(1036 - 982), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + chr(1928 - 1874), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(53) + chr(789 - 737), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101111 + 0o4) + chr(0b10011 + 0o42) + chr(2509 - 2454), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + '\x36' + chr(1198 - 1150), 21511 - 21503), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(968 - 918) + chr(0b110010), 38156 - 38148), ehT0Px3KOsy9(chr(496 - 448) + '\x6f' + chr(0b10001 + 0o42) + chr(0b110101) + chr(1673 - 1624), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(2362 - 2309) + chr(2329 - 2277), 8), ehT0Px3KOsy9(chr(55 - 7) + chr(0b1101010 + 0o5) + chr(51) + chr(1583 - 1531) + chr(167 - 114), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(153 - 103) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + chr(10899 - 10788) + '\063' + chr(0b100100 + 0o14) + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b111111 + 0o60) + chr(0b110011) + chr(52) + '\062', 35236 - 35228), ehT0Px3KOsy9('\060' + chr(111) + chr(2009 - 1959) + '\x37', 44230 - 44222), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b101011 + 0o104) + '\061' + chr(682 - 631) + chr(629 - 579), 30133 - 30125)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(0b110101) + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x84'), chr(0b1100 + 0o130) + chr(0b11000 + 0o115) + '\x63' + chr(0b110001 + 0o76) + chr(0b1100100) + chr(7227 - 7126))('\165' + '\x74' + chr(8940 - 8838) + '\x2d' + chr(0b11010 + 0o36)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def fyrxk_EnoWpU(oVre8I6UXc3b, tKJAwKiE1Zya, pyiPBPsXZj35):
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcb\x1c\x07\xaf\xd0'), chr(100) + '\145' + chr(0b1100011) + chr(0b1101111) + '\144' + chr(0b1100101))('\x75' + chr(116) + chr(102) + chr(121 - 76) + chr(0b111000))) != tKJAwKiE1Zya:
raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf\x1f\x10\xab\xd0u\xa5\x93\xfc\xb5M~y\xa8\x1b\x1d\xe1\x99\x85u\xb8\xdf\x9b\x17\x98\xa4aB\x88\x903\x9a_\x80\xe7\xe4'), '\x64' + '\x65' + '\143' + chr(2148 - 2037) + '\144' + chr(0b1100101))(chr(0b1110101) + '\x74' + '\x66' + chr(45) + '\x38'))
J2pPBw5sONom = oVre8I6UXc3b.amount / kkSX4ccExqw4(pyiPBPsXZj35)
BuxqtNul6cMY = WqUC3KWvYVup.floor(J2pPBw5sONom)
G3zV57uEl24C = J2pPBw5sONom - BuxqtNul6cMY
e1n69Qn7J2me = jB_HdqgHmVpI(oVre8I6UXc3b.cost_basis * pyiPBPsXZj35, ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(10896 - 10785) + chr(0b1100 + 0o46), ord("\x08")))
oVre8I6UXc3b.LboONsTVykfG = e1n69Qn7J2me
oVre8I6UXc3b.V8Id9YsEjPSB = BuxqtNul6cMY
qYDhfT6JNoZx = jB_HdqgHmVpI(kkSX4ccExqw4(G3zV57uEl24C * e1n69Qn7J2me), ehT0Px3KOsy9(chr(1383 - 1335) + '\x6f' + chr(0b100000 + 0o22), 8))
xafqLlk3kkUe(WHAFymdp8Jcy, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9X<\xb2\xd1\x7f\xac\xc3\xb6\xaagy'), chr(0b1100100) + '\145' + chr(99) + chr(9957 - 9846) + chr(0b1100100) + '\x65')(chr(0b1101 + 0o150) + chr(7588 - 7472) + chr(10016 - 9914) + chr(45) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xcb\t\x00\xaf\xd6<\xb8\x84\xb0\xafI(0'), chr(0b1010 + 0o132) + chr(0b1100101) + chr(0b1011100 + 0o7) + chr(6896 - 6785) + '\144' + chr(0b1100101))(chr(117) + chr(116) + chr(273 - 171) + chr(0b101101) + chr(2202 - 2146)) + M8_cKLkHVB2V(oVre8I6UXc3b))
xafqLlk3kkUe(WHAFymdp8Jcy, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9X<\xb2\xd1\x7f\xac\xc3\xb6\xaagy'), chr(0b1100100) + '\145' + '\x63' + chr(111) + chr(9271 - 9171) + '\145')('\165' + chr(116) + chr(0b11000 + 0o116) + '\055' + chr(1153 - 1097)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\n\x00\xbf\xd6r\xa2\x9a\xbb\xe6^sc\xb4\x01J'), '\144' + chr(101) + chr(99) + chr(0b1101111) + '\144' + chr(0b1000 + 0o135))(chr(0b1110101) + chr(1954 - 1838) + chr(102) + '\055' + chr(0b111000)) + M8_cKLkHVB2V(qYDhfT6JNoZx))
return qYDhfT6JNoZx
|
quantopian/zipline
|
zipline/finance/position.py
|
Position.adjust_commission_cost_basis
|
def adjust_commission_cost_basis(self, asset, cost):
"""
A note about cost-basis in zipline: all positions are considered
to share a cost basis, even if they were executed in different
transactions with different commission costs, different prices, etc.
Due to limitations about how zipline handles positions, zipline will
currently spread an externally-delivered commission charge across
all shares in a position.
"""
if asset != self.asset:
raise Exception('Updating a commission for a different asset?')
if cost == 0.0:
return
# If we no longer hold this position, there is no cost basis to
# adjust.
if self.amount == 0:
return
# We treat cost basis as the share price where we have broken even.
# For longs, commissions cause a relatively straight forward increase
# in the cost basis.
#
# For shorts, you actually want to decrease the cost basis because you
# break even and earn a profit when the share price decreases.
#
# Shorts are represented as having a negative `amount`.
#
# The multiplication and division by `amount` cancel out leaving the
# cost_basis positive, while subtracting the commission.
prev_cost = self.cost_basis * self.amount
if isinstance(asset, Future):
cost_to_use = cost / asset.price_multiplier
else:
cost_to_use = cost
new_cost = prev_cost + cost_to_use
self.cost_basis = new_cost / self.amount
|
python
|
def adjust_commission_cost_basis(self, asset, cost):
"""
A note about cost-basis in zipline: all positions are considered
to share a cost basis, even if they were executed in different
transactions with different commission costs, different prices, etc.
Due to limitations about how zipline handles positions, zipline will
currently spread an externally-delivered commission charge across
all shares in a position.
"""
if asset != self.asset:
raise Exception('Updating a commission for a different asset?')
if cost == 0.0:
return
# If we no longer hold this position, there is no cost basis to
# adjust.
if self.amount == 0:
return
# We treat cost basis as the share price where we have broken even.
# For longs, commissions cause a relatively straight forward increase
# in the cost basis.
#
# For shorts, you actually want to decrease the cost basis because you
# break even and earn a profit when the share price decreases.
#
# Shorts are represented as having a negative `amount`.
#
# The multiplication and division by `amount` cancel out leaving the
# cost_basis positive, while subtracting the commission.
prev_cost = self.cost_basis * self.amount
if isinstance(asset, Future):
cost_to_use = cost / asset.price_multiplier
else:
cost_to_use = cost
new_cost = prev_cost + cost_to_use
self.cost_basis = new_cost / self.amount
|
[
"def",
"adjust_commission_cost_basis",
"(",
"self",
",",
"asset",
",",
"cost",
")",
":",
"if",
"asset",
"!=",
"self",
".",
"asset",
":",
"raise",
"Exception",
"(",
"'Updating a commission for a different asset?'",
")",
"if",
"cost",
"==",
"0.0",
":",
"return",
"# If we no longer hold this position, there is no cost basis to",
"# adjust.",
"if",
"self",
".",
"amount",
"==",
"0",
":",
"return",
"# We treat cost basis as the share price where we have broken even.",
"# For longs, commissions cause a relatively straight forward increase",
"# in the cost basis.",
"#",
"# For shorts, you actually want to decrease the cost basis because you",
"# break even and earn a profit when the share price decreases.",
"#",
"# Shorts are represented as having a negative `amount`.",
"#",
"# The multiplication and division by `amount` cancel out leaving the",
"# cost_basis positive, while subtracting the commission.",
"prev_cost",
"=",
"self",
".",
"cost_basis",
"*",
"self",
".",
"amount",
"if",
"isinstance",
"(",
"asset",
",",
"Future",
")",
":",
"cost_to_use",
"=",
"cost",
"/",
"asset",
".",
"price_multiplier",
"else",
":",
"cost_to_use",
"=",
"cost",
"new_cost",
"=",
"prev_cost",
"+",
"cost_to_use",
"self",
".",
"cost_basis",
"=",
"new_cost",
"/",
"self",
".",
"amount"
] |
A note about cost-basis in zipline: all positions are considered
to share a cost basis, even if they were executed in different
transactions with different commission costs, different prices, etc.
Due to limitations about how zipline handles positions, zipline will
currently spread an externally-delivered commission charge across
all shares in a position.
|
[
"A",
"note",
"about",
"cost",
"-",
"basis",
"in",
"zipline",
":",
"all",
"positions",
"are",
"considered",
"to",
"share",
"a",
"cost",
"basis",
"even",
"if",
"they",
"were",
"executed",
"in",
"different",
"transactions",
"with",
"different",
"commission",
"costs",
"different",
"prices",
"etc",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/finance/position.py#L164-L203
|
train
|
Adjust the commission cost basis for this asset.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zsEOh2,L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eWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1011100 + 0o23) + chr(0b110101) + chr(0b1111 + 0o41), 28522 - 28514), ehT0Px3KOsy9(chr(1894 - 1846) + '\x6f' + chr(0b110010) + '\x34' + chr(2447 - 2397), 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(892 - 842) + chr(0b1010 + 0o46) + chr(0b11010 + 0o32), 0b1000), ehT0Px3KOsy9(chr(371 - 323) + chr(0b1001010 + 0o45) + chr(0b110011) + chr(48) + chr(1964 - 1913), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b101011 + 0o104) + chr(0b11000 + 0o31) + chr(0b100110 + 0o14) + chr(1226 - 1178), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(12130 - 12019) + chr(0b110011) + chr(0b110011) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(2395 - 2342) + chr(52), 0o10), ehT0Px3KOsy9(chr(1268 - 1220) + '\157' + '\062' + chr(1080 - 1032), 0o10), ehT0Px3KOsy9(chr(1609 - 1561) + '\x6f' + '\063' + chr(936 - 886) + '\060', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + '\x33' + chr(0b10101 + 0o40), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + chr(0b1110 + 0o42) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + '\061' + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(6486 - 6375) + chr(0b110011) + chr(54) + chr(51), 0o10), ehT0Px3KOsy9(chr(2255 - 2207) + '\x6f' + '\x32' + chr(50) + chr(1531 - 1476), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(50) + '\067' + '\x36', 2694 - 2686), ehT0Px3KOsy9(chr(0b110000) + chr(2283 - 2172) + chr(49) + '\063' + chr(0b10011 + 0o36), 0o10), ehT0Px3KOsy9(chr(1776 - 1728) + chr(0b11111 + 0o120) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(124 - 75) + '\060' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(1392 - 1344) + chr(0b10110 + 0o131) + chr(0b11101 + 0o25) + chr(48) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(2306 - 2254), ord("\x08")), ehT0Px3KOsy9(chr(153 - 105) + chr(8774 - 8663) + chr(0b1 + 0o60) + chr(0b1110 + 0o43) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b111101 + 0o62) + chr(1653 - 1603) + '\066' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(2328 - 2278), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1880 - 1829) + chr(48) + '\x36', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(53) + chr(554 - 499), 33587 - 33579), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(0b100100 + 0o20) + '\062', 42393 - 42385), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b1 + 0o60) + '\067', 51805 - 51797), ehT0Px3KOsy9('\060' + '\x6f' + chr(1712 - 1659), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + '\x36' + chr(0b110000), 22062 - 22054), ehT0Px3KOsy9('\x30' + chr(0b1100001 + 0o16) + chr(1176 - 1122) + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + '\x30' + chr(2384 - 2333), 8), ehT0Px3KOsy9('\060' + chr(4266 - 4155) + chr(0b110001) + chr(0b110010 + 0o2) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(0b101 + 0o56) + '\063' + chr(2165 - 2113), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\062' + '\x30' + chr(1253 - 1204), 16814 - 16806), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1100100 + 0o13) + '\x33' + chr(50) + '\066', 55764 - 55756), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + chr(49) + chr(52) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(2236 - 2188) + '\x6f' + '\062' + '\063' + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(0b10110 + 0o131) + chr(0b101010 + 0o10) + '\065' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b101101 + 0o102) + chr(52) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(111) + chr(2075 - 2025) + chr(0b110000 + 0o2) + chr(1882 - 1827), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110101) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x06'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(3771 - 3671) + '\x65')(chr(5955 - 5838) + '\164' + chr(102) + '\055' + chr(0b10010 + 0o46)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def HMXie4RXhVg0(oVre8I6UXc3b, tKJAwKiE1Zya, DtzBTLITzDMA):
if tKJAwKiE1Zya != xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'I\xd1\xf7\xa6$'), chr(6926 - 6826) + chr(101) + '\x63' + chr(111) + chr(5418 - 5318) + chr(101))(chr(12272 - 12155) + chr(0b110101 + 0o77) + chr(0b10 + 0o144) + chr(0b1000 + 0o45) + '\070')):
raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'}\xd2\xe0\xa2$\xb6\x82w\xf0\xbc\xe0\xe8\x9c\xfa\xd30q6\xeak"\x93t\xa9]Bn%\xd4^\xa5\x02\xb9\xf3\xb3\r\xec\x8eG\xe4[\xc7\xf0\xfc'), chr(0b10011 + 0o121) + chr(0b1100101) + chr(0b101110 + 0o65) + chr(111) + chr(5457 - 5357) + chr(101))(chr(0b1110101) + chr(4964 - 4848) + chr(0b1000000 + 0o46) + chr(0b101101) + chr(738 - 682)))
if DtzBTLITzDMA == 0.0:
return
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'~\x9a\xcd\xa7i\x86\x9fU\xba\x8d\x93\xc9'), '\144' + '\x65' + '\x63' + chr(12103 - 11992) + chr(9757 - 9657) + chr(101))(chr(0b101101 + 0o110) + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(2921 - 2865))) == ehT0Px3KOsy9(chr(1267 - 1219) + chr(0b1101111) + chr(0b1 + 0o57), 0o10):
return
Q5eY99nSbHn2 = oVre8I6UXc3b.LboONsTVykfG * oVre8I6UXc3b.V8Id9YsEjPSB
if PlSM16l2KDPD(tKJAwKiE1Zya, ZByRRxCTsPWJ):
EJ3rCYOAb0so = DtzBTLITzDMA / tKJAwKiE1Zya.price_multiplier
else:
EJ3rCYOAb0so = DtzBTLITzDMA
LEuMGBlBPtqY = Q5eY99nSbHn2 + EJ3rCYOAb0so
oVre8I6UXc3b.LboONsTVykfG = LEuMGBlBPtqY / oVre8I6UXc3b.V8Id9YsEjPSB
|
quantopian/zipline
|
zipline/finance/position.py
|
Position.to_dict
|
def to_dict(self):
"""
Creates a dictionary representing the state of this position.
Returns a dict object of the form:
"""
return {
'sid': self.asset,
'amount': self.amount,
'cost_basis': self.cost_basis,
'last_sale_price': self.last_sale_price
}
|
python
|
def to_dict(self):
"""
Creates a dictionary representing the state of this position.
Returns a dict object of the form:
"""
return {
'sid': self.asset,
'amount': self.amount,
'cost_basis': self.cost_basis,
'last_sale_price': self.last_sale_price
}
|
[
"def",
"to_dict",
"(",
"self",
")",
":",
"return",
"{",
"'sid'",
":",
"self",
".",
"asset",
",",
"'amount'",
":",
"self",
".",
"amount",
",",
"'cost_basis'",
":",
"self",
".",
"cost_basis",
",",
"'last_sale_price'",
":",
"self",
".",
"last_sale_price",
"}"
] |
Creates a dictionary representing the state of this position.
Returns a dict object of the form:
|
[
"Creates",
"a",
"dictionary",
"representing",
"the",
"state",
"of",
"this",
"position",
".",
"Returns",
"a",
"dict",
"object",
"of",
"the",
"form",
":"
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/finance/position.py#L215-L225
|
train
|
Returns a dictionary representing the state of this position.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ix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D68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(1842 - 1793) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b111 + 0o57) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(5810 - 5699) + chr(0b100100 + 0o22), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(3439 - 3328) + '\061' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(5847 - 5736) + '\063' + chr(55) + chr(0b110000), 43119 - 43111), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1010 + 0o51) + '\x31' + '\x31', 28029 - 28021), ehT0Px3KOsy9(chr(48) + chr(0b1000011 + 0o54) + chr(0b1001 + 0o51) + chr(955 - 903) + chr(55), 48633 - 48625), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(48) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(1954 - 1903) + chr(2635 - 2581) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(0b100 + 0o60) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + chr(50) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(1632 - 1521) + '\x31' + '\x31' + chr(51), 48917 - 48909), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101111) + chr(51) + chr(0b110000) + chr(1475 - 1420), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101100 + 0o6) + chr(0b100011 + 0o15), 49321 - 49313), ehT0Px3KOsy9(chr(710 - 662) + chr(9493 - 9382) + '\061' + chr(0b110110) + chr(0b1 + 0o63), 0o10), ehT0Px3KOsy9('\x30' + chr(5662 - 5551) + '\x33' + '\x31', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b110001) + chr(2113 - 2064), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\065' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(3048 - 2937) + chr(0b110010) + chr(0b110110) + chr(0b110001), 49864 - 49856), ehT0Px3KOsy9(chr(48) + chr(0b101001 + 0o106) + '\x33' + chr(0b100011 + 0o15) + '\061', 38133 - 38125), ehT0Px3KOsy9(chr(1766 - 1718) + chr(0b1101111) + chr(0b100 + 0o56) + chr(2218 - 2166) + chr(55), 8), ehT0Px3KOsy9('\x30' + '\157' + '\x35' + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + chr(0b111001 + 0o66) + chr(582 - 531) + chr(487 - 438), 8), ehT0Px3KOsy9(chr(84 - 36) + chr(111) + chr(1102 - 1053) + chr(1203 - 1154) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\x37' + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(3580 - 3469) + '\x31' + '\061' + '\063', 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1332 - 1277), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(55) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(1779 - 1726) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(0b110000 + 0o5) + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(56 - 7) + '\x32' + chr(0b110100), 8), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + chr(0b110001) + chr(1147 - 1093) + chr(432 - 381), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100000 + 0o117) + '\065' + chr(0b11 + 0o61), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + '\064', 0b1000), ehT0Px3KOsy9('\x30' + chr(10844 - 10733) + chr(652 - 602) + chr(0b10101 + 0o36) + '\064', 0o10), ehT0Px3KOsy9(chr(290 - 242) + chr(8482 - 8371) + chr(51) + '\x31' + chr(49), 8), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1101111) + '\062' + chr(55) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + chr(0b110011) + chr(134 - 86), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\x6f' + '\x36' + chr(0b100111 + 0o12), 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + '\x32' + chr(0b110000), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110100 + 0o1) + chr(0b101111 + 0o1), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2'), chr(0b1100100) + '\x65' + '\143' + '\157' + chr(702 - 602) + chr(0b1100101))(chr(9551 - 9434) + chr(0b1110100) + chr(102) + chr(283 - 238) + chr(0b101010 + 0o16)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ANIlnSK1rtks(oVre8I6UXc3b):
return {xafqLlk3kkUe(SXOLrMavuUCe(b'\xff\x98b'), chr(9395 - 9295) + chr(101) + '\143' + chr(11359 - 11248) + '\144' + '\145')(chr(6640 - 6523) + '\164' + '\x66' + chr(772 - 727) + '\x38'): xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xed\x82uj\x8c'), '\x64' + chr(0b1100101) + '\143' + chr(0b1101111) + chr(100) + chr(5154 - 5053))(chr(10780 - 10663) + '\164' + chr(0b111101 + 0o51) + '\055' + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'\xed\x9ciz\x96\xbd'), '\x64' + chr(101) + chr(7610 - 7511) + chr(9614 - 9503) + chr(0b1100100) + chr(7637 - 7536))(chr(117) + '\x74' + chr(102) + chr(0b10011 + 0o32) + chr(56)): xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xda\xc9Ok\xc1\x90\xd4\x83\x9e\xb0\x07\t'), chr(7041 - 6941) + chr(0b1111 + 0o126) + '\x63' + chr(0b1000110 + 0o51) + '\144' + chr(101))('\165' + chr(116) + chr(0b11010 + 0o114) + chr(0b111 + 0o46) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\xef\x9eu{\xa7\xab\xc6\xb5\x9d\x93'), chr(100) + '\145' + chr(1481 - 1382) + '\x6f' + chr(0b1100100) + chr(0b1100101))('\x75' + '\x74' + chr(0b1100110) + chr(45) + chr(0b111000)): xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0\x93i@\xb6\xba\xf3\x90\x8d\x8b2\x0c'), chr(0b1100100) + chr(7670 - 7569) + chr(2845 - 2746) + '\157' + '\x64' + chr(101))(chr(0b1110101) + chr(116) + '\x66' + chr(0b0 + 0o55) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0\x90u{\xa7\xba\xc6\xaa\x91\xbf$9\xaes\x11'), chr(2305 - 2205) + '\x65' + chr(0b1100011) + chr(111) + chr(3301 - 3201) + chr(0b1100101))('\165' + chr(0b1110100) + chr(102) + '\x2d' + chr(2438 - 2382)): xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0\x90u{\xa7\xba\xc6\xaa\x91\xbf$9\xaes\x11'), chr(0b110001 + 0o63) + chr(0b1100101) + chr(659 - 560) + '\x6f' + chr(0b1100100) + '\145')('\165' + chr(7059 - 6943) + chr(0b1100110) + chr(0b101101) + '\070'))}
|
quantopian/zipline
|
zipline/data/bundles/core.py
|
_make_bundle_core
|
def _make_bundle_core():
"""Create a family of data bundle functions that read from the same
bundle mapping.
Returns
-------
bundles : mappingproxy
The mapping of bundles to bundle payloads.
register : callable
The function which registers new bundles in the ``bundles`` mapping.
unregister : callable
The function which deregisters bundles from the ``bundles`` mapping.
ingest : callable
The function which downloads and write data for a given data bundle.
load : callable
The function which loads the ingested bundles back into memory.
clean : callable
The function which cleans up data written with ``ingest``.
"""
_bundles = {} # the registered bundles
# Expose _bundles through a proxy so that users cannot mutate this
# accidentally. Users may go through `register` to update this which will
# warn when trampling another bundle.
bundles = mappingproxy(_bundles)
@curry
def register(name,
f,
calendar_name='NYSE',
start_session=None,
end_session=None,
minutes_per_day=390,
create_writers=True):
"""Register a data bundle ingest function.
Parameters
----------
name : str
The name of the bundle.
f : callable
The ingest function. This function will be passed:
environ : mapping
The environment this is being run with.
asset_db_writer : AssetDBWriter
The asset db writer to write into.
minute_bar_writer : BcolzMinuteBarWriter
The minute bar writer to write into.
daily_bar_writer : BcolzDailyBarWriter
The daily bar writer to write into.
adjustment_writer : SQLiteAdjustmentWriter
The adjustment db writer to write into.
calendar : trading_calendars.TradingCalendar
The trading calendar to ingest for.
start_session : pd.Timestamp
The first session of data to ingest.
end_session : pd.Timestamp
The last session of data to ingest.
cache : DataFrameCache
A mapping object to temporarily store dataframes.
This should be used to cache intermediates in case the load
fails. This will be automatically cleaned up after a
successful load.
show_progress : bool
Show the progress for the current load where possible.
calendar_name : str, optional
The name of a calendar used to align bundle data.
Default is 'NYSE'.
start_session : pd.Timestamp, optional
The first session for which we want data. If not provided,
or if the date lies outside the range supported by the
calendar, the first_session of the calendar is used.
end_session : pd.Timestamp, optional
The last session for which we want data. If not provided,
or if the date lies outside the range supported by the
calendar, the last_session of the calendar is used.
minutes_per_day : int, optional
The number of minutes in each normal trading day.
create_writers : bool, optional
Should the ingest machinery create the writers for the ingest
function. This can be disabled as an optimization for cases where
they are not needed, like the ``quantopian-quandl`` bundle.
Notes
-----
This function my be used as a decorator, for example:
.. code-block:: python
@register('quandl')
def quandl_ingest_function(...):
...
See Also
--------
zipline.data.bundles.bundles
"""
if name in bundles:
warnings.warn(
'Overwriting bundle with name %r' % name,
stacklevel=3,
)
# NOTE: We don't eagerly compute calendar values here because
# `register` is called at module scope in zipline, and creating a
# calendar currently takes between 0.5 and 1 seconds, which causes a
# noticeable delay on the zipline CLI.
_bundles[name] = RegisteredBundle(
calendar_name=calendar_name,
start_session=start_session,
end_session=end_session,
minutes_per_day=minutes_per_day,
ingest=f,
create_writers=create_writers,
)
return f
def unregister(name):
"""Unregister a bundle.
Parameters
----------
name : str
The name of the bundle to unregister.
Raises
------
UnknownBundle
Raised when no bundle has been registered with the given name.
See Also
--------
zipline.data.bundles.bundles
"""
try:
del _bundles[name]
except KeyError:
raise UnknownBundle(name)
def ingest(name,
environ=os.environ,
timestamp=None,
assets_versions=(),
show_progress=False):
"""Ingest data for a given bundle.
Parameters
----------
name : str
The name of the bundle.
environ : mapping, optional
The environment variables. By default this is os.environ.
timestamp : datetime, optional
The timestamp to use for the load.
By default this is the current time.
assets_versions : Iterable[int], optional
Versions of the assets db to which to downgrade.
show_progress : bool, optional
Tell the ingest function to display the progress where possible.
"""
try:
bundle = bundles[name]
except KeyError:
raise UnknownBundle(name)
calendar = get_calendar(bundle.calendar_name)
start_session = bundle.start_session
end_session = bundle.end_session
if start_session is None or start_session < calendar.first_session:
start_session = calendar.first_session
if end_session is None or end_session > calendar.last_session:
end_session = calendar.last_session
if timestamp is None:
timestamp = pd.Timestamp.utcnow()
timestamp = timestamp.tz_convert('utc').tz_localize(None)
timestr = to_bundle_ingest_dirname(timestamp)
cachepath = cache_path(name, environ=environ)
pth.ensure_directory(pth.data_path([name, timestr], environ=environ))
pth.ensure_directory(cachepath)
with dataframe_cache(cachepath, clean_on_failure=False) as cache, \
ExitStack() as stack:
# we use `cleanup_on_failure=False` so that we don't purge the
# cache directory if the load fails in the middle
if bundle.create_writers:
wd = stack.enter_context(working_dir(
pth.data_path([], environ=environ))
)
daily_bars_path = wd.ensure_dir(
*daily_equity_relative(
name, timestr, environ=environ,
)
)
daily_bar_writer = BcolzDailyBarWriter(
daily_bars_path,
calendar,
start_session,
end_session,
)
# Do an empty write to ensure that the daily ctables exist
# when we create the SQLiteAdjustmentWriter below. The
# SQLiteAdjustmentWriter needs to open the daily ctables so
# that it can compute the adjustment ratios for the dividends.
daily_bar_writer.write(())
minute_bar_writer = BcolzMinuteBarWriter(
wd.ensure_dir(*minute_equity_relative(
name, timestr, environ=environ)
),
calendar,
start_session,
end_session,
minutes_per_day=bundle.minutes_per_day,
)
assets_db_path = wd.getpath(*asset_db_relative(
name, timestr, environ=environ,
))
asset_db_writer = AssetDBWriter(assets_db_path)
adjustment_db_writer = stack.enter_context(
SQLiteAdjustmentWriter(
wd.getpath(*adjustment_db_relative(
name, timestr, environ=environ)),
BcolzDailyBarReader(daily_bars_path),
overwrite=True,
)
)
else:
daily_bar_writer = None
minute_bar_writer = None
asset_db_writer = None
adjustment_db_writer = None
if assets_versions:
raise ValueError('Need to ingest a bundle that creates '
'writers in order to downgrade the assets'
' db.')
bundle.ingest(
environ,
asset_db_writer,
minute_bar_writer,
daily_bar_writer,
adjustment_db_writer,
calendar,
start_session,
end_session,
cache,
show_progress,
pth.data_path([name, timestr], environ=environ),
)
for version in sorted(set(assets_versions), reverse=True):
version_path = wd.getpath(*asset_db_relative(
name, timestr, environ=environ, db_version=version,
))
with working_file(version_path) as wf:
shutil.copy2(assets_db_path, wf.path)
downgrade(wf.path, version)
def most_recent_data(bundle_name, timestamp, environ=None):
"""Get the path to the most recent data after ``date``for the
given bundle.
Parameters
----------
bundle_name : str
The name of the bundle to lookup.
timestamp : datetime
The timestamp to begin searching on or before.
environ : dict, optional
An environment dict to forward to zipline_root.
"""
if bundle_name not in bundles:
raise UnknownBundle(bundle_name)
try:
candidates = os.listdir(
pth.data_path([bundle_name], environ=environ),
)
return pth.data_path(
[bundle_name,
max(
filter(complement(pth.hidden), candidates),
key=from_bundle_ingest_dirname,
)],
environ=environ,
)
except (ValueError, OSError) as e:
if getattr(e, 'errno', errno.ENOENT) != errno.ENOENT:
raise
raise ValueError(
'no data for bundle {bundle!r} on or before {timestamp}\n'
'maybe you need to run: $ zipline ingest -b {bundle}'.format(
bundle=bundle_name,
timestamp=timestamp,
),
)
def load(name, environ=os.environ, timestamp=None):
"""Loads a previously ingested bundle.
Parameters
----------
name : str
The name of the bundle.
environ : mapping, optional
The environment variables. Defaults of os.environ.
timestamp : datetime, optional
The timestamp of the data to lookup.
Defaults to the current time.
Returns
-------
bundle_data : BundleData
The raw data readers for this bundle.
"""
if timestamp is None:
timestamp = pd.Timestamp.utcnow()
timestr = most_recent_data(name, timestamp, environ=environ)
return BundleData(
asset_finder=AssetFinder(
asset_db_path(name, timestr, environ=environ),
),
equity_minute_bar_reader=BcolzMinuteBarReader(
minute_equity_path(name, timestr, environ=environ),
),
equity_daily_bar_reader=BcolzDailyBarReader(
daily_equity_path(name, timestr, environ=environ),
),
adjustment_reader=SQLiteAdjustmentReader(
adjustment_db_path(name, timestr, environ=environ),
),
)
@preprocess(
before=optionally(ensure_timestamp),
after=optionally(ensure_timestamp),
)
def clean(name,
before=None,
after=None,
keep_last=None,
environ=os.environ):
"""Clean up data that was created with ``ingest`` or
``$ python -m zipline ingest``
Parameters
----------
name : str
The name of the bundle to remove data for.
before : datetime, optional
Remove data ingested before this date.
This argument is mutually exclusive with: keep_last
after : datetime, optional
Remove data ingested after this date.
This argument is mutually exclusive with: keep_last
keep_last : int, optional
Remove all but the last ``keep_last`` ingestions.
This argument is mutually exclusive with:
before
after
environ : mapping, optional
The environment variables. Defaults of os.environ.
Returns
-------
cleaned : set[str]
The names of the runs that were removed.
Raises
------
BadClean
Raised when ``before`` and or ``after`` are passed with
``keep_last``. This is a subclass of ``ValueError``.
"""
try:
all_runs = sorted(
filter(
complement(pth.hidden),
os.listdir(pth.data_path([name], environ=environ)),
),
key=from_bundle_ingest_dirname,
)
except OSError as e:
if e.errno != errno.ENOENT:
raise
raise UnknownBundle(name)
if ((before is not None or after is not None) and
keep_last is not None):
raise BadClean(before, after, keep_last)
if keep_last is None:
def should_clean(name):
dt = from_bundle_ingest_dirname(name)
return (
(before is not None and dt < before) or
(after is not None and dt > after)
)
elif keep_last >= 0:
last_n_dts = set(take(keep_last, reversed(all_runs)))
def should_clean(name):
return name not in last_n_dts
else:
raise BadClean(before, after, keep_last)
cleaned = set()
for run in all_runs:
if should_clean(run):
path = pth.data_path([name, run], environ=environ)
shutil.rmtree(path)
cleaned.add(path)
return cleaned
return BundleCore(bundles, register, unregister, ingest, load, clean)
|
python
|
def _make_bundle_core():
"""Create a family of data bundle functions that read from the same
bundle mapping.
Returns
-------
bundles : mappingproxy
The mapping of bundles to bundle payloads.
register : callable
The function which registers new bundles in the ``bundles`` mapping.
unregister : callable
The function which deregisters bundles from the ``bundles`` mapping.
ingest : callable
The function which downloads and write data for a given data bundle.
load : callable
The function which loads the ingested bundles back into memory.
clean : callable
The function which cleans up data written with ``ingest``.
"""
_bundles = {} # the registered bundles
# Expose _bundles through a proxy so that users cannot mutate this
# accidentally. Users may go through `register` to update this which will
# warn when trampling another bundle.
bundles = mappingproxy(_bundles)
@curry
def register(name,
f,
calendar_name='NYSE',
start_session=None,
end_session=None,
minutes_per_day=390,
create_writers=True):
"""Register a data bundle ingest function.
Parameters
----------
name : str
The name of the bundle.
f : callable
The ingest function. This function will be passed:
environ : mapping
The environment this is being run with.
asset_db_writer : AssetDBWriter
The asset db writer to write into.
minute_bar_writer : BcolzMinuteBarWriter
The minute bar writer to write into.
daily_bar_writer : BcolzDailyBarWriter
The daily bar writer to write into.
adjustment_writer : SQLiteAdjustmentWriter
The adjustment db writer to write into.
calendar : trading_calendars.TradingCalendar
The trading calendar to ingest for.
start_session : pd.Timestamp
The first session of data to ingest.
end_session : pd.Timestamp
The last session of data to ingest.
cache : DataFrameCache
A mapping object to temporarily store dataframes.
This should be used to cache intermediates in case the load
fails. This will be automatically cleaned up after a
successful load.
show_progress : bool
Show the progress for the current load where possible.
calendar_name : str, optional
The name of a calendar used to align bundle data.
Default is 'NYSE'.
start_session : pd.Timestamp, optional
The first session for which we want data. If not provided,
or if the date lies outside the range supported by the
calendar, the first_session of the calendar is used.
end_session : pd.Timestamp, optional
The last session for which we want data. If not provided,
or if the date lies outside the range supported by the
calendar, the last_session of the calendar is used.
minutes_per_day : int, optional
The number of minutes in each normal trading day.
create_writers : bool, optional
Should the ingest machinery create the writers for the ingest
function. This can be disabled as an optimization for cases where
they are not needed, like the ``quantopian-quandl`` bundle.
Notes
-----
This function my be used as a decorator, for example:
.. code-block:: python
@register('quandl')
def quandl_ingest_function(...):
...
See Also
--------
zipline.data.bundles.bundles
"""
if name in bundles:
warnings.warn(
'Overwriting bundle with name %r' % name,
stacklevel=3,
)
# NOTE: We don't eagerly compute calendar values here because
# `register` is called at module scope in zipline, and creating a
# calendar currently takes between 0.5 and 1 seconds, which causes a
# noticeable delay on the zipline CLI.
_bundles[name] = RegisteredBundle(
calendar_name=calendar_name,
start_session=start_session,
end_session=end_session,
minutes_per_day=minutes_per_day,
ingest=f,
create_writers=create_writers,
)
return f
def unregister(name):
"""Unregister a bundle.
Parameters
----------
name : str
The name of the bundle to unregister.
Raises
------
UnknownBundle
Raised when no bundle has been registered with the given name.
See Also
--------
zipline.data.bundles.bundles
"""
try:
del _bundles[name]
except KeyError:
raise UnknownBundle(name)
def ingest(name,
environ=os.environ,
timestamp=None,
assets_versions=(),
show_progress=False):
"""Ingest data for a given bundle.
Parameters
----------
name : str
The name of the bundle.
environ : mapping, optional
The environment variables. By default this is os.environ.
timestamp : datetime, optional
The timestamp to use for the load.
By default this is the current time.
assets_versions : Iterable[int], optional
Versions of the assets db to which to downgrade.
show_progress : bool, optional
Tell the ingest function to display the progress where possible.
"""
try:
bundle = bundles[name]
except KeyError:
raise UnknownBundle(name)
calendar = get_calendar(bundle.calendar_name)
start_session = bundle.start_session
end_session = bundle.end_session
if start_session is None or start_session < calendar.first_session:
start_session = calendar.first_session
if end_session is None or end_session > calendar.last_session:
end_session = calendar.last_session
if timestamp is None:
timestamp = pd.Timestamp.utcnow()
timestamp = timestamp.tz_convert('utc').tz_localize(None)
timestr = to_bundle_ingest_dirname(timestamp)
cachepath = cache_path(name, environ=environ)
pth.ensure_directory(pth.data_path([name, timestr], environ=environ))
pth.ensure_directory(cachepath)
with dataframe_cache(cachepath, clean_on_failure=False) as cache, \
ExitStack() as stack:
# we use `cleanup_on_failure=False` so that we don't purge the
# cache directory if the load fails in the middle
if bundle.create_writers:
wd = stack.enter_context(working_dir(
pth.data_path([], environ=environ))
)
daily_bars_path = wd.ensure_dir(
*daily_equity_relative(
name, timestr, environ=environ,
)
)
daily_bar_writer = BcolzDailyBarWriter(
daily_bars_path,
calendar,
start_session,
end_session,
)
# Do an empty write to ensure that the daily ctables exist
# when we create the SQLiteAdjustmentWriter below. The
# SQLiteAdjustmentWriter needs to open the daily ctables so
# that it can compute the adjustment ratios for the dividends.
daily_bar_writer.write(())
minute_bar_writer = BcolzMinuteBarWriter(
wd.ensure_dir(*minute_equity_relative(
name, timestr, environ=environ)
),
calendar,
start_session,
end_session,
minutes_per_day=bundle.minutes_per_day,
)
assets_db_path = wd.getpath(*asset_db_relative(
name, timestr, environ=environ,
))
asset_db_writer = AssetDBWriter(assets_db_path)
adjustment_db_writer = stack.enter_context(
SQLiteAdjustmentWriter(
wd.getpath(*adjustment_db_relative(
name, timestr, environ=environ)),
BcolzDailyBarReader(daily_bars_path),
overwrite=True,
)
)
else:
daily_bar_writer = None
minute_bar_writer = None
asset_db_writer = None
adjustment_db_writer = None
if assets_versions:
raise ValueError('Need to ingest a bundle that creates '
'writers in order to downgrade the assets'
' db.')
bundle.ingest(
environ,
asset_db_writer,
minute_bar_writer,
daily_bar_writer,
adjustment_db_writer,
calendar,
start_session,
end_session,
cache,
show_progress,
pth.data_path([name, timestr], environ=environ),
)
for version in sorted(set(assets_versions), reverse=True):
version_path = wd.getpath(*asset_db_relative(
name, timestr, environ=environ, db_version=version,
))
with working_file(version_path) as wf:
shutil.copy2(assets_db_path, wf.path)
downgrade(wf.path, version)
def most_recent_data(bundle_name, timestamp, environ=None):
"""Get the path to the most recent data after ``date``for the
given bundle.
Parameters
----------
bundle_name : str
The name of the bundle to lookup.
timestamp : datetime
The timestamp to begin searching on or before.
environ : dict, optional
An environment dict to forward to zipline_root.
"""
if bundle_name not in bundles:
raise UnknownBundle(bundle_name)
try:
candidates = os.listdir(
pth.data_path([bundle_name], environ=environ),
)
return pth.data_path(
[bundle_name,
max(
filter(complement(pth.hidden), candidates),
key=from_bundle_ingest_dirname,
)],
environ=environ,
)
except (ValueError, OSError) as e:
if getattr(e, 'errno', errno.ENOENT) != errno.ENOENT:
raise
raise ValueError(
'no data for bundle {bundle!r} on or before {timestamp}\n'
'maybe you need to run: $ zipline ingest -b {bundle}'.format(
bundle=bundle_name,
timestamp=timestamp,
),
)
def load(name, environ=os.environ, timestamp=None):
"""Loads a previously ingested bundle.
Parameters
----------
name : str
The name of the bundle.
environ : mapping, optional
The environment variables. Defaults of os.environ.
timestamp : datetime, optional
The timestamp of the data to lookup.
Defaults to the current time.
Returns
-------
bundle_data : BundleData
The raw data readers for this bundle.
"""
if timestamp is None:
timestamp = pd.Timestamp.utcnow()
timestr = most_recent_data(name, timestamp, environ=environ)
return BundleData(
asset_finder=AssetFinder(
asset_db_path(name, timestr, environ=environ),
),
equity_minute_bar_reader=BcolzMinuteBarReader(
minute_equity_path(name, timestr, environ=environ),
),
equity_daily_bar_reader=BcolzDailyBarReader(
daily_equity_path(name, timestr, environ=environ),
),
adjustment_reader=SQLiteAdjustmentReader(
adjustment_db_path(name, timestr, environ=environ),
),
)
@preprocess(
before=optionally(ensure_timestamp),
after=optionally(ensure_timestamp),
)
def clean(name,
before=None,
after=None,
keep_last=None,
environ=os.environ):
"""Clean up data that was created with ``ingest`` or
``$ python -m zipline ingest``
Parameters
----------
name : str
The name of the bundle to remove data for.
before : datetime, optional
Remove data ingested before this date.
This argument is mutually exclusive with: keep_last
after : datetime, optional
Remove data ingested after this date.
This argument is mutually exclusive with: keep_last
keep_last : int, optional
Remove all but the last ``keep_last`` ingestions.
This argument is mutually exclusive with:
before
after
environ : mapping, optional
The environment variables. Defaults of os.environ.
Returns
-------
cleaned : set[str]
The names of the runs that were removed.
Raises
------
BadClean
Raised when ``before`` and or ``after`` are passed with
``keep_last``. This is a subclass of ``ValueError``.
"""
try:
all_runs = sorted(
filter(
complement(pth.hidden),
os.listdir(pth.data_path([name], environ=environ)),
),
key=from_bundle_ingest_dirname,
)
except OSError as e:
if e.errno != errno.ENOENT:
raise
raise UnknownBundle(name)
if ((before is not None or after is not None) and
keep_last is not None):
raise BadClean(before, after, keep_last)
if keep_last is None:
def should_clean(name):
dt = from_bundle_ingest_dirname(name)
return (
(before is not None and dt < before) or
(after is not None and dt > after)
)
elif keep_last >= 0:
last_n_dts = set(take(keep_last, reversed(all_runs)))
def should_clean(name):
return name not in last_n_dts
else:
raise BadClean(before, after, keep_last)
cleaned = set()
for run in all_runs:
if should_clean(run):
path = pth.data_path([name, run], environ=environ)
shutil.rmtree(path)
cleaned.add(path)
return cleaned
return BundleCore(bundles, register, unregister, ingest, load, clean)
|
[
"def",
"_make_bundle_core",
"(",
")",
":",
"_bundles",
"=",
"{",
"}",
"# the registered bundles",
"# Expose _bundles through a proxy so that users cannot mutate this",
"# accidentally. Users may go through `register` to update this which will",
"# warn when trampling another bundle.",
"bundles",
"=",
"mappingproxy",
"(",
"_bundles",
")",
"@",
"curry",
"def",
"register",
"(",
"name",
",",
"f",
",",
"calendar_name",
"=",
"'NYSE'",
",",
"start_session",
"=",
"None",
",",
"end_session",
"=",
"None",
",",
"minutes_per_day",
"=",
"390",
",",
"create_writers",
"=",
"True",
")",
":",
"\"\"\"Register a data bundle ingest function.\n\n Parameters\n ----------\n name : str\n The name of the bundle.\n f : callable\n The ingest function. This function will be passed:\n\n environ : mapping\n The environment this is being run with.\n asset_db_writer : AssetDBWriter\n The asset db writer to write into.\n minute_bar_writer : BcolzMinuteBarWriter\n The minute bar writer to write into.\n daily_bar_writer : BcolzDailyBarWriter\n The daily bar writer to write into.\n adjustment_writer : SQLiteAdjustmentWriter\n The adjustment db writer to write into.\n calendar : trading_calendars.TradingCalendar\n The trading calendar to ingest for.\n start_session : pd.Timestamp\n The first session of data to ingest.\n end_session : pd.Timestamp\n The last session of data to ingest.\n cache : DataFrameCache\n A mapping object to temporarily store dataframes.\n This should be used to cache intermediates in case the load\n fails. This will be automatically cleaned up after a\n successful load.\n show_progress : bool\n Show the progress for the current load where possible.\n calendar_name : str, optional\n The name of a calendar used to align bundle data.\n Default is 'NYSE'.\n start_session : pd.Timestamp, optional\n The first session for which we want data. If not provided,\n or if the date lies outside the range supported by the\n calendar, the first_session of the calendar is used.\n end_session : pd.Timestamp, optional\n The last session for which we want data. If not provided,\n or if the date lies outside the range supported by the\n calendar, the last_session of the calendar is used.\n minutes_per_day : int, optional\n The number of minutes in each normal trading day.\n create_writers : bool, optional\n Should the ingest machinery create the writers for the ingest\n function. This can be disabled as an optimization for cases where\n they are not needed, like the ``quantopian-quandl`` bundle.\n\n Notes\n -----\n This function my be used as a decorator, for example:\n\n .. code-block:: python\n\n @register('quandl')\n def quandl_ingest_function(...):\n ...\n\n See Also\n --------\n zipline.data.bundles.bundles\n \"\"\"",
"if",
"name",
"in",
"bundles",
":",
"warnings",
".",
"warn",
"(",
"'Overwriting bundle with name %r'",
"%",
"name",
",",
"stacklevel",
"=",
"3",
",",
")",
"# NOTE: We don't eagerly compute calendar values here because",
"# `register` is called at module scope in zipline, and creating a",
"# calendar currently takes between 0.5 and 1 seconds, which causes a",
"# noticeable delay on the zipline CLI.",
"_bundles",
"[",
"name",
"]",
"=",
"RegisteredBundle",
"(",
"calendar_name",
"=",
"calendar_name",
",",
"start_session",
"=",
"start_session",
",",
"end_session",
"=",
"end_session",
",",
"minutes_per_day",
"=",
"minutes_per_day",
",",
"ingest",
"=",
"f",
",",
"create_writers",
"=",
"create_writers",
",",
")",
"return",
"f",
"def",
"unregister",
"(",
"name",
")",
":",
"\"\"\"Unregister a bundle.\n\n Parameters\n ----------\n name : str\n The name of the bundle to unregister.\n\n Raises\n ------\n UnknownBundle\n Raised when no bundle has been registered with the given name.\n\n See Also\n --------\n zipline.data.bundles.bundles\n \"\"\"",
"try",
":",
"del",
"_bundles",
"[",
"name",
"]",
"except",
"KeyError",
":",
"raise",
"UnknownBundle",
"(",
"name",
")",
"def",
"ingest",
"(",
"name",
",",
"environ",
"=",
"os",
".",
"environ",
",",
"timestamp",
"=",
"None",
",",
"assets_versions",
"=",
"(",
")",
",",
"show_progress",
"=",
"False",
")",
":",
"\"\"\"Ingest data for a given bundle.\n\n Parameters\n ----------\n name : str\n The name of the bundle.\n environ : mapping, optional\n The environment variables. By default this is os.environ.\n timestamp : datetime, optional\n The timestamp to use for the load.\n By default this is the current time.\n assets_versions : Iterable[int], optional\n Versions of the assets db to which to downgrade.\n show_progress : bool, optional\n Tell the ingest function to display the progress where possible.\n \"\"\"",
"try",
":",
"bundle",
"=",
"bundles",
"[",
"name",
"]",
"except",
"KeyError",
":",
"raise",
"UnknownBundle",
"(",
"name",
")",
"calendar",
"=",
"get_calendar",
"(",
"bundle",
".",
"calendar_name",
")",
"start_session",
"=",
"bundle",
".",
"start_session",
"end_session",
"=",
"bundle",
".",
"end_session",
"if",
"start_session",
"is",
"None",
"or",
"start_session",
"<",
"calendar",
".",
"first_session",
":",
"start_session",
"=",
"calendar",
".",
"first_session",
"if",
"end_session",
"is",
"None",
"or",
"end_session",
">",
"calendar",
".",
"last_session",
":",
"end_session",
"=",
"calendar",
".",
"last_session",
"if",
"timestamp",
"is",
"None",
":",
"timestamp",
"=",
"pd",
".",
"Timestamp",
".",
"utcnow",
"(",
")",
"timestamp",
"=",
"timestamp",
".",
"tz_convert",
"(",
"'utc'",
")",
".",
"tz_localize",
"(",
"None",
")",
"timestr",
"=",
"to_bundle_ingest_dirname",
"(",
"timestamp",
")",
"cachepath",
"=",
"cache_path",
"(",
"name",
",",
"environ",
"=",
"environ",
")",
"pth",
".",
"ensure_directory",
"(",
"pth",
".",
"data_path",
"(",
"[",
"name",
",",
"timestr",
"]",
",",
"environ",
"=",
"environ",
")",
")",
"pth",
".",
"ensure_directory",
"(",
"cachepath",
")",
"with",
"dataframe_cache",
"(",
"cachepath",
",",
"clean_on_failure",
"=",
"False",
")",
"as",
"cache",
",",
"ExitStack",
"(",
")",
"as",
"stack",
":",
"# we use `cleanup_on_failure=False` so that we don't purge the",
"# cache directory if the load fails in the middle",
"if",
"bundle",
".",
"create_writers",
":",
"wd",
"=",
"stack",
".",
"enter_context",
"(",
"working_dir",
"(",
"pth",
".",
"data_path",
"(",
"[",
"]",
",",
"environ",
"=",
"environ",
")",
")",
")",
"daily_bars_path",
"=",
"wd",
".",
"ensure_dir",
"(",
"*",
"daily_equity_relative",
"(",
"name",
",",
"timestr",
",",
"environ",
"=",
"environ",
",",
")",
")",
"daily_bar_writer",
"=",
"BcolzDailyBarWriter",
"(",
"daily_bars_path",
",",
"calendar",
",",
"start_session",
",",
"end_session",
",",
")",
"# Do an empty write to ensure that the daily ctables exist",
"# when we create the SQLiteAdjustmentWriter below. The",
"# SQLiteAdjustmentWriter needs to open the daily ctables so",
"# that it can compute the adjustment ratios for the dividends.",
"daily_bar_writer",
".",
"write",
"(",
"(",
")",
")",
"minute_bar_writer",
"=",
"BcolzMinuteBarWriter",
"(",
"wd",
".",
"ensure_dir",
"(",
"*",
"minute_equity_relative",
"(",
"name",
",",
"timestr",
",",
"environ",
"=",
"environ",
")",
")",
",",
"calendar",
",",
"start_session",
",",
"end_session",
",",
"minutes_per_day",
"=",
"bundle",
".",
"minutes_per_day",
",",
")",
"assets_db_path",
"=",
"wd",
".",
"getpath",
"(",
"*",
"asset_db_relative",
"(",
"name",
",",
"timestr",
",",
"environ",
"=",
"environ",
",",
")",
")",
"asset_db_writer",
"=",
"AssetDBWriter",
"(",
"assets_db_path",
")",
"adjustment_db_writer",
"=",
"stack",
".",
"enter_context",
"(",
"SQLiteAdjustmentWriter",
"(",
"wd",
".",
"getpath",
"(",
"*",
"adjustment_db_relative",
"(",
"name",
",",
"timestr",
",",
"environ",
"=",
"environ",
")",
")",
",",
"BcolzDailyBarReader",
"(",
"daily_bars_path",
")",
",",
"overwrite",
"=",
"True",
",",
")",
")",
"else",
":",
"daily_bar_writer",
"=",
"None",
"minute_bar_writer",
"=",
"None",
"asset_db_writer",
"=",
"None",
"adjustment_db_writer",
"=",
"None",
"if",
"assets_versions",
":",
"raise",
"ValueError",
"(",
"'Need to ingest a bundle that creates '",
"'writers in order to downgrade the assets'",
"' db.'",
")",
"bundle",
".",
"ingest",
"(",
"environ",
",",
"asset_db_writer",
",",
"minute_bar_writer",
",",
"daily_bar_writer",
",",
"adjustment_db_writer",
",",
"calendar",
",",
"start_session",
",",
"end_session",
",",
"cache",
",",
"show_progress",
",",
"pth",
".",
"data_path",
"(",
"[",
"name",
",",
"timestr",
"]",
",",
"environ",
"=",
"environ",
")",
",",
")",
"for",
"version",
"in",
"sorted",
"(",
"set",
"(",
"assets_versions",
")",
",",
"reverse",
"=",
"True",
")",
":",
"version_path",
"=",
"wd",
".",
"getpath",
"(",
"*",
"asset_db_relative",
"(",
"name",
",",
"timestr",
",",
"environ",
"=",
"environ",
",",
"db_version",
"=",
"version",
",",
")",
")",
"with",
"working_file",
"(",
"version_path",
")",
"as",
"wf",
":",
"shutil",
".",
"copy2",
"(",
"assets_db_path",
",",
"wf",
".",
"path",
")",
"downgrade",
"(",
"wf",
".",
"path",
",",
"version",
")",
"def",
"most_recent_data",
"(",
"bundle_name",
",",
"timestamp",
",",
"environ",
"=",
"None",
")",
":",
"\"\"\"Get the path to the most recent data after ``date``for the\n given bundle.\n\n Parameters\n ----------\n bundle_name : str\n The name of the bundle to lookup.\n timestamp : datetime\n The timestamp to begin searching on or before.\n environ : dict, optional\n An environment dict to forward to zipline_root.\n \"\"\"",
"if",
"bundle_name",
"not",
"in",
"bundles",
":",
"raise",
"UnknownBundle",
"(",
"bundle_name",
")",
"try",
":",
"candidates",
"=",
"os",
".",
"listdir",
"(",
"pth",
".",
"data_path",
"(",
"[",
"bundle_name",
"]",
",",
"environ",
"=",
"environ",
")",
",",
")",
"return",
"pth",
".",
"data_path",
"(",
"[",
"bundle_name",
",",
"max",
"(",
"filter",
"(",
"complement",
"(",
"pth",
".",
"hidden",
")",
",",
"candidates",
")",
",",
"key",
"=",
"from_bundle_ingest_dirname",
",",
")",
"]",
",",
"environ",
"=",
"environ",
",",
")",
"except",
"(",
"ValueError",
",",
"OSError",
")",
"as",
"e",
":",
"if",
"getattr",
"(",
"e",
",",
"'errno'",
",",
"errno",
".",
"ENOENT",
")",
"!=",
"errno",
".",
"ENOENT",
":",
"raise",
"raise",
"ValueError",
"(",
"'no data for bundle {bundle!r} on or before {timestamp}\\n'",
"'maybe you need to run: $ zipline ingest -b {bundle}'",
".",
"format",
"(",
"bundle",
"=",
"bundle_name",
",",
"timestamp",
"=",
"timestamp",
",",
")",
",",
")",
"def",
"load",
"(",
"name",
",",
"environ",
"=",
"os",
".",
"environ",
",",
"timestamp",
"=",
"None",
")",
":",
"\"\"\"Loads a previously ingested bundle.\n\n Parameters\n ----------\n name : str\n The name of the bundle.\n environ : mapping, optional\n The environment variables. Defaults of os.environ.\n timestamp : datetime, optional\n The timestamp of the data to lookup.\n Defaults to the current time.\n\n Returns\n -------\n bundle_data : BundleData\n The raw data readers for this bundle.\n \"\"\"",
"if",
"timestamp",
"is",
"None",
":",
"timestamp",
"=",
"pd",
".",
"Timestamp",
".",
"utcnow",
"(",
")",
"timestr",
"=",
"most_recent_data",
"(",
"name",
",",
"timestamp",
",",
"environ",
"=",
"environ",
")",
"return",
"BundleData",
"(",
"asset_finder",
"=",
"AssetFinder",
"(",
"asset_db_path",
"(",
"name",
",",
"timestr",
",",
"environ",
"=",
"environ",
")",
",",
")",
",",
"equity_minute_bar_reader",
"=",
"BcolzMinuteBarReader",
"(",
"minute_equity_path",
"(",
"name",
",",
"timestr",
",",
"environ",
"=",
"environ",
")",
",",
")",
",",
"equity_daily_bar_reader",
"=",
"BcolzDailyBarReader",
"(",
"daily_equity_path",
"(",
"name",
",",
"timestr",
",",
"environ",
"=",
"environ",
")",
",",
")",
",",
"adjustment_reader",
"=",
"SQLiteAdjustmentReader",
"(",
"adjustment_db_path",
"(",
"name",
",",
"timestr",
",",
"environ",
"=",
"environ",
")",
",",
")",
",",
")",
"@",
"preprocess",
"(",
"before",
"=",
"optionally",
"(",
"ensure_timestamp",
")",
",",
"after",
"=",
"optionally",
"(",
"ensure_timestamp",
")",
",",
")",
"def",
"clean",
"(",
"name",
",",
"before",
"=",
"None",
",",
"after",
"=",
"None",
",",
"keep_last",
"=",
"None",
",",
"environ",
"=",
"os",
".",
"environ",
")",
":",
"\"\"\"Clean up data that was created with ``ingest`` or\n ``$ python -m zipline ingest``\n\n Parameters\n ----------\n name : str\n The name of the bundle to remove data for.\n before : datetime, optional\n Remove data ingested before this date.\n This argument is mutually exclusive with: keep_last\n after : datetime, optional\n Remove data ingested after this date.\n This argument is mutually exclusive with: keep_last\n keep_last : int, optional\n Remove all but the last ``keep_last`` ingestions.\n This argument is mutually exclusive with:\n before\n after\n environ : mapping, optional\n The environment variables. Defaults of os.environ.\n\n Returns\n -------\n cleaned : set[str]\n The names of the runs that were removed.\n\n Raises\n ------\n BadClean\n Raised when ``before`` and or ``after`` are passed with\n ``keep_last``. This is a subclass of ``ValueError``.\n \"\"\"",
"try",
":",
"all_runs",
"=",
"sorted",
"(",
"filter",
"(",
"complement",
"(",
"pth",
".",
"hidden",
")",
",",
"os",
".",
"listdir",
"(",
"pth",
".",
"data_path",
"(",
"[",
"name",
"]",
",",
"environ",
"=",
"environ",
")",
")",
",",
")",
",",
"key",
"=",
"from_bundle_ingest_dirname",
",",
")",
"except",
"OSError",
"as",
"e",
":",
"if",
"e",
".",
"errno",
"!=",
"errno",
".",
"ENOENT",
":",
"raise",
"raise",
"UnknownBundle",
"(",
"name",
")",
"if",
"(",
"(",
"before",
"is",
"not",
"None",
"or",
"after",
"is",
"not",
"None",
")",
"and",
"keep_last",
"is",
"not",
"None",
")",
":",
"raise",
"BadClean",
"(",
"before",
",",
"after",
",",
"keep_last",
")",
"if",
"keep_last",
"is",
"None",
":",
"def",
"should_clean",
"(",
"name",
")",
":",
"dt",
"=",
"from_bundle_ingest_dirname",
"(",
"name",
")",
"return",
"(",
"(",
"before",
"is",
"not",
"None",
"and",
"dt",
"<",
"before",
")",
"or",
"(",
"after",
"is",
"not",
"None",
"and",
"dt",
">",
"after",
")",
")",
"elif",
"keep_last",
">=",
"0",
":",
"last_n_dts",
"=",
"set",
"(",
"take",
"(",
"keep_last",
",",
"reversed",
"(",
"all_runs",
")",
")",
")",
"def",
"should_clean",
"(",
"name",
")",
":",
"return",
"name",
"not",
"in",
"last_n_dts",
"else",
":",
"raise",
"BadClean",
"(",
"before",
",",
"after",
",",
"keep_last",
")",
"cleaned",
"=",
"set",
"(",
")",
"for",
"run",
"in",
"all_runs",
":",
"if",
"should_clean",
"(",
"run",
")",
":",
"path",
"=",
"pth",
".",
"data_path",
"(",
"[",
"name",
",",
"run",
"]",
",",
"environ",
"=",
"environ",
")",
"shutil",
".",
"rmtree",
"(",
"path",
")",
"cleaned",
".",
"add",
"(",
"path",
")",
"return",
"cleaned",
"return",
"BundleCore",
"(",
"bundles",
",",
"register",
",",
"unregister",
",",
"ingest",
",",
"load",
",",
"clean",
")"
] |
Create a family of data bundle functions that read from the same
bundle mapping.
Returns
-------
bundles : mappingproxy
The mapping of bundles to bundle payloads.
register : callable
The function which registers new bundles in the ``bundles`` mapping.
unregister : callable
The function which deregisters bundles from the ``bundles`` mapping.
ingest : callable
The function which downloads and write data for a given data bundle.
load : callable
The function which loads the ingested bundles back into memory.
clean : callable
The function which cleans up data written with ``ingest``.
|
[
"Create",
"a",
"family",
"of",
"data",
"bundle",
"functions",
"that",
"read",
"from",
"the",
"same",
"bundle",
"mapping",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/bundles/core.py#L195-L614
|
train
|
Create a family of data bundle functions that read from the same
bundle mapping.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0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AN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + '\x33' + chr(48), 8416 - 8408), ehT0Px3KOsy9('\x30' + chr(4276 - 4165) + '\x32' + '\x30' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11 + 0o56) + chr(0b110101) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + '\x33' + chr(0b10111 + 0o33), 0b1000), ehT0Px3KOsy9('\x30' + chr(9296 - 9185) + '\063' + chr(2224 - 2175) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(111) + chr(0b1110 + 0o43) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1404 - 1354) + chr(0b110100) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1011000 + 0o27) + '\063' + chr(0b110001) + chr(0b11101 + 0o23), 20366 - 20358), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + '\066' + chr(1168 - 1117), ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\x6f' + chr(0b11000 + 0o31) + chr(0b100111 + 0o12) + chr(1325 - 1277), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110100) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + chr(1595 - 1545) + chr(0b100100 + 0o16) + chr(1303 - 1253), 51758 - 51750), ehT0Px3KOsy9(chr(0b110000) + chr(7382 - 7271) + chr(0b11011 + 0o27) + chr(0b100110 + 0o17) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(684 - 636) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + '\061' + chr(2159 - 2107) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(874 - 823) + chr(0b100 + 0o55) + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b101010 + 0o15) + chr(199 - 150), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + '\x30' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + chr(0b10110 + 0o34) + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + '\067', 29914 - 29906), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1101111) + chr(52) + chr(51), 6361 - 6353), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000110 + 0o51) + '\x36' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(49) + chr(0b110101), 44997 - 44989), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\x6f' + '\063' + chr(970 - 920) + chr(0b100010 + 0o23), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(198 - 87) + chr(2404 - 2353) + '\064' + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b1110 + 0o50) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5710 - 5599) + chr(50) + '\063' + chr(961 - 913), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(10115 - 10004) + chr(51) + chr(51) + chr(1874 - 1825), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(53), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + '\x37' + chr(0b110001), 5748 - 5740), ehT0Px3KOsy9(chr(580 - 532) + chr(1540 - 1429) + chr(51) + chr(0b101000 + 0o14) + '\x30', 44073 - 44065), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(701 - 649) + chr(54), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110111) + chr(0b1101 + 0o46), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + '\x35' + chr(53), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\063' + '\063' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + '\063' + chr(0b11100 + 0o26) + '\060', 29096 - 29088), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + '\065' + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(0b110111) + chr(2143 - 2093), 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(11229 - 11118) + chr(0b100000 + 0o27) + chr(1320 - 1266), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1520 - 1472) + chr(0b1101111) + chr(0b110101) + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'v'), chr(0b1100100) + chr(0b111 + 0o136) + chr(99) + chr(1569 - 1458) + chr(9511 - 9411) + chr(101))('\165' + '\164' + '\x66' + '\x2d' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def jdrf_3XMUT9G():
ZytBRt4eT0zf = {}
e6TIGpvOn5Jf = SOvqgegxJ3Q_(ZytBRt4eT0zf)
@anPqnJSBPIS1
def WlGrEKpik_hR(AIvJRzLdDfgF, EGyt1xfPT1P6, ZCpaauzAbKTU=xafqLlk3kkUe(SXOLrMavuUCe(b'\x16\xdb?\x9f'), chr(8322 - 8222) + chr(101) + chr(0b1100011) + chr(4700 - 4589) + chr(100) + chr(3190 - 3089))(chr(0b11 + 0o162) + chr(0b1110100) + '\x66' + chr(45) + chr(893 - 837)), DXo3YHqyow5e=None, qRfpaQSMkwXK=None, n1cY8BMfwtZJ=ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\x6f' + chr(0b110110) + '\x30' + '\066', 0b1000), oSHMXRxf_yrp=ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11001 + 0o30), ord("\x08"))):
if AIvJRzLdDfgF in e6TIGpvOn5Jf:
xafqLlk3kkUe(fJoTPf8D_opC, xafqLlk3kkUe(SXOLrMavuUCe(b'6\xc6)\xb4\x82N\xc0\xaa5\x06l\xff'), chr(0b1100100) + chr(101) + chr(99) + '\x6f' + chr(100) + '\145')(chr(2832 - 2715) + '\164' + '\146' + chr(1582 - 1537) + chr(0b11011 + 0o35)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x17\xf4\t\xa8\xbb~\xc8\xbc\x1a&@\xb2\xca3\x08\xaaU\xe1w`JE\xe5\xf5\x89S\xf5\xbc5+\x8b'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\x6f' + chr(0b101011 + 0o71) + '\145')('\x75' + chr(0b1110100) + '\x66' + chr(0b1 + 0o54) + '\070') % AIvJRzLdDfgF, stacklevel=ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33', 0b1000))
ZytBRt4eT0zf[AIvJRzLdDfgF] = S0A37vZ0tIE5(calendar_name=ZCpaauzAbKTU, start_session=DXo3YHqyow5e, end_session=qRfpaQSMkwXK, minutes_per_day=n1cY8BMfwtZJ, ingest=EGyt1xfPT1P6, create_writers=oSHMXRxf_yrp)
return EGyt1xfPT1P6
def qptzFnt1v15O(AIvJRzLdDfgF):
try:
del ZytBRt4eT0zf[AIvJRzLdDfgF]
except RQ6CSRrFArYB:
raise HJreK_cvrwfO(AIvJRzLdDfgF)
def L7s2CXx4LJem(AIvJRzLdDfgF, rNK60KZ67nXB=xafqLlk3kkUe(oqhJDdMJfuwx, xafqLlk3kkUe(SXOLrMavuUCe(b"*\xcc'\xec\xfcG\xfb\xfeD&\x7f\xd0"), chr(6631 - 6531) + chr(3717 - 3616) + chr(0b1100011) + chr(8572 - 8461) + chr(9202 - 9102) + chr(0b1100101))('\165' + chr(116) + '\x66' + chr(579 - 534) + chr(1782 - 1726))), SgRbwnqVfFz7=None, JexFCSyhOrqO=(), _rgtfo4EPgcH=ehT0Px3KOsy9('\060' + chr(111) + '\x30', 0o10)):
try:
BdOvlW9oyNT1 = e6TIGpvOn5Jf[AIvJRzLdDfgF]
except RQ6CSRrFArYB:
raise HJreK_cvrwfO(AIvJRzLdDfgF)
poUKhjo0_BbB = qV4fO1AoRtpp(BdOvlW9oyNT1.calendar_name)
DXo3YHqyow5e = BdOvlW9oyNT1.start_session
qRfpaQSMkwXK = BdOvlW9oyNT1.end_session
if DXo3YHqyow5e is None or DXo3YHqyow5e < xafqLlk3kkUe(poUKhjo0_BbB, xafqLlk3kkUe(SXOLrMavuUCe(b'>\xeb\x1e\xa9\xb8S\xd2\xad\x00;N\xfd\xc6'), '\144' + chr(0b1100101) + '\x63' + '\x6f' + chr(0b110100 + 0o60) + chr(0b1100010 + 0o3))(chr(0b1100001 + 0o24) + chr(116) + chr(0b1010111 + 0o17) + '\x2d' + chr(56))):
DXo3YHqyow5e = poUKhjo0_BbB.first_session
if qRfpaQSMkwXK is None or qRfpaQSMkwXK > xafqLlk3kkUe(poUKhjo0_BbB, xafqLlk3kkUe(SXOLrMavuUCe(b'4\xe3\x1f\xae\x93\x7f\xc4\xbb\x00!H\xfc'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(111) + chr(0b11010 + 0o112) + '\145')(chr(0b1110101) + chr(7352 - 7236) + '\146' + chr(1265 - 1220) + chr(2206 - 2150))):
qRfpaQSMkwXK = poUKhjo0_BbB.last_session
if SgRbwnqVfFz7 is None:
SgRbwnqVfFz7 = dubtF9GfzOdC.Timestamp.utcnow()
SgRbwnqVfFz7 = SgRbwnqVfFz7.tz_convert(xafqLlk3kkUe(SXOLrMavuUCe(b'-\xf6\x0f'), '\x64' + '\x65' + chr(99) + chr(0b1101111) + chr(100) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(3300 - 3198) + chr(1292 - 1247) + chr(56))).tz_localize(None)
Y7nACqE1XA1a = SU73AXTf0q02(SgRbwnqVfFz7)
j6CAJHU_R9xK = WYuPioNR_sqI(AIvJRzLdDfgF, environ=rNK60KZ67nXB)
xafqLlk3kkUe(pcNidiB9q0YZ, xafqLlk3kkUe(SXOLrMavuUCe(b'=\xec\x1f\xaf\xbei\xfe\xac\x1a:B\xf1\xdc)\x14\xb7'), chr(0b1100100) + chr(101) + '\x63' + chr(111) + chr(0b1100100) + chr(4269 - 4168))(chr(0b1100011 + 0o22) + '\x74' + '\x66' + chr(0b101101) + chr(0b110010 + 0o6)))(xafqLlk3kkUe(pcNidiB9q0YZ, xafqLlk3kkUe(SXOLrMavuUCe(b'<\xe3\x18\xbb\x93|\xc0\xbc\x1b'), chr(1497 - 1397) + chr(101) + '\x63' + '\x6f' + chr(2422 - 2322) + chr(101))(chr(0b1000010 + 0o63) + chr(116) + chr(0b1100110) + chr(45) + chr(3125 - 3069)))([AIvJRzLdDfgF, Y7nACqE1XA1a], environ=rNK60KZ67nXB))
xafqLlk3kkUe(pcNidiB9q0YZ, xafqLlk3kkUe(SXOLrMavuUCe(b'=\xec\x1f\xaf\xbei\xfe\xac\x1a:B\xf1\xdc)\x14\xb7'), chr(100) + chr(0b1111 + 0o126) + chr(99) + '\x6f' + chr(0b1100100) + chr(6233 - 6132))(chr(117) + '\x74' + '\x66' + chr(0b101101) + chr(0b111000 + 0o0)))(j6CAJHU_R9xK)
with MYZLDoJ1u4g4(j6CAJHU_R9xK, clean_on_failure=ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1010111 + 0o30) + '\060', 8)) as j1lPDdxcDbRB, un5spL6lgqx6() as rFoCQMjVYqWa:
if xafqLlk3kkUe(BdOvlW9oyNT1, xafqLlk3kkUe(SXOLrMavuUCe(b';\xf0\t\xbb\xb8i\xfe\xbf\x01!S\xf7\xda5'), '\144' + chr(0b1100101) + chr(0b100110 + 0o75) + chr(0b1001001 + 0o46) + chr(0b1000011 + 0o41) + chr(0b1100101))(chr(117) + '\164' + chr(0b100000 + 0o106) + chr(45) + '\070')):
LTzJV4d64B_7 = rFoCQMjVYqWa.enter_context(c8GDiXW77Jn7(pcNidiB9q0YZ.data_path([], environ=rNK60KZ67nXB)))
rsK5RssYXmWc = LTzJV4d64B_7.ensure_dir(*AiFaTq5IPWA_(AIvJRzLdDfgF, Y7nACqE1XA1a, environ=rNK60KZ67nXB))
XgyKD3xf4XSp = TnDrWNrl2RCs(rsK5RssYXmWc, poUKhjo0_BbB, DXo3YHqyow5e, qRfpaQSMkwXK)
xafqLlk3kkUe(XgyKD3xf4XSp, xafqLlk3kkUe(SXOLrMavuUCe(b'/\xf0\x05\xae\xa9'), chr(100) + chr(4371 - 4270) + '\143' + '\157' + '\144' + chr(0b10010 + 0o123))('\165' + '\164' + '\x66' + chr(1269 - 1224) + chr(0b1 + 0o67)))(())
fiSHAQXMY_UA = m06khSrvkAab(LTzJV4d64B_7.ensure_dir(*mE63XG61ZbBf(AIvJRzLdDfgF, Y7nACqE1XA1a, environ=rNK60KZ67nXB)), poUKhjo0_BbB, DXo3YHqyow5e, qRfpaQSMkwXK, minutes_per_day=BdOvlW9oyNT1.minutes_per_day)
GqDs_5b5w9QW = LTzJV4d64B_7.getpath(*bGFO6yrqWAjZ(AIvJRzLdDfgF, Y7nACqE1XA1a, environ=rNK60KZ67nXB))
H2urTN8C8M5R = l6_Dfzc5uDAx(GqDs_5b5w9QW)
C2EGHdyI9m54 = rFoCQMjVYqWa.enter_context(XIb6Ue5_tYKC(LTzJV4d64B_7.getpath(*eKYvx1C_29jW(AIvJRzLdDfgF, Y7nACqE1XA1a, environ=rNK60KZ67nXB)), DyfTJiqA3Fn0(rsK5RssYXmWc), overwrite=ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(5724 - 5613) + '\x31', 8)))
else:
XgyKD3xf4XSp = None
fiSHAQXMY_UA = None
H2urTN8C8M5R = None
C2EGHdyI9m54 = None
if JexFCSyhOrqO:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x16\xe7\t\xbe\xecx\xce\xe8\x1a&@\xf7\xdb2F\xaf\x19\xe6"yG]\xe8\xf5\x93Z\xf9\xad5m\x8b\x85\x87O\x08\xab\xf0\x99\xc8W,\xe7\x1e\xa9\xece\xcf\xe8\x1c:C\xf7\xdaf\x12\xa1\x19\xe08`MV\xff\xb4\x83W\xb8\xad}k\xd9\x81\x95H\x08\xac\xa3\xce\xde\\v'), '\x64' + '\x65' + chr(99) + chr(111) + chr(9359 - 9259) + chr(0b1100101))(chr(117) + '\x74' + '\146' + chr(0b10100 + 0o31) + '\x38'))
xafqLlk3kkUe(BdOvlW9oyNT1, xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\xb5\x1f\xe8\x8fT\xd9\xfc?\x02B\xff'), '\x64' + '\x65' + chr(0b1100011) + chr(0b101 + 0o152) + chr(0b10111 + 0o115) + chr(0b10000 + 0o125))(chr(0b1110101) + '\x74' + '\x66' + chr(0b101101) + chr(2568 - 2512)))(rNK60KZ67nXB, H2urTN8C8M5R, fiSHAQXMY_UA, XgyKD3xf4XSp, C2EGHdyI9m54, poUKhjo0_BbB, DXo3YHqyow5e, qRfpaQSMkwXK, j1lPDdxcDbRB, _rgtfo4EPgcH, xafqLlk3kkUe(pcNidiB9q0YZ, xafqLlk3kkUe(SXOLrMavuUCe(b'<\xe3\x18\xbb\x93|\xc0\xbc\x1b'), chr(100) + '\145' + chr(6813 - 6714) + chr(111) + chr(100) + chr(101))(chr(0b111011 + 0o72) + chr(6717 - 6601) + chr(0b1100110) + chr(45) + chr(0b111000)))([AIvJRzLdDfgF, Y7nACqE1XA1a], environ=rNK60KZ67nXB))
for cpMfQ_4_Vb7C in vUlqIvNSaRMa(MVEN8G6CxlvR(JexFCSyhOrqO), reverse=ehT0Px3KOsy9(chr(48) + '\x6f' + '\061', 8)):
Nj3lFc9ucgIn = LTzJV4d64B_7.getpath(*bGFO6yrqWAjZ(AIvJRzLdDfgF, Y7nACqE1XA1a, environ=rNK60KZ67nXB, db_version=cpMfQ_4_Vb7C))
with LMn7AgOPOsjG(Nj3lFc9ucgIn) as Dv788TknRPpD:
xafqLlk3kkUe(DSLq_IS6e6IX, xafqLlk3kkUe(SXOLrMavuUCe(b';\xed\x1c\xa3\xfe'), chr(5171 - 5071) + chr(101) + chr(99) + '\157' + chr(0b1100100) + '\x65')(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(1591 - 1535)))(GqDs_5b5w9QW, xafqLlk3kkUe(Dv788TknRPpD, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1d\xe3/\xb0\xb5d\xfb\xb8\x07\x1bB\xe0'), chr(6965 - 6865) + chr(101) + chr(1794 - 1695) + chr(111) + chr(1376 - 1276) + chr(0b1100101))(chr(13640 - 13523) + '\164' + '\146' + chr(950 - 905) + chr(56))))
hfuvt6dMVhGA(xafqLlk3kkUe(Dv788TknRPpD, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1d\xe3/\xb0\xb5d\xfb\xb8\x07\x1bB\xe0'), '\144' + chr(101) + chr(0b111110 + 0o45) + chr(9400 - 9289) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(0b101101) + chr(0b111000))), cpMfQ_4_Vb7C)
def Ywa_Nys4hrtQ(DbKw7rUUOz3X, SgRbwnqVfFz7, rNK60KZ67nXB=None):
if DbKw7rUUOz3X not in e6TIGpvOn5Jf:
raise HJreK_cvrwfO(DbKw7rUUOz3X)
try:
rVMkTcEfqM4b = oqhJDdMJfuwx.listdir(pcNidiB9q0YZ.data_path([DbKw7rUUOz3X], environ=rNK60KZ67nXB))
return xafqLlk3kkUe(pcNidiB9q0YZ, xafqLlk3kkUe(SXOLrMavuUCe(b'<\xe3\x18\xbb\x93|\xc0\xbc\x1b'), chr(6444 - 6344) + chr(0b1100101) + '\x63' + chr(0b110011 + 0o74) + chr(0b1100100) + '\x65')(chr(5061 - 4944) + '\164' + chr(102) + chr(606 - 561) + chr(56)))([DbKw7rUUOz3X, tsdjvlgh9gDP(hi1V0ySZcNds(Q1FWXMQw5NsA(xafqLlk3kkUe(pcNidiB9q0YZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1b\xe9\x02\x8b\x82:\xd5\xad\x15}T\xf1'), chr(100) + chr(9177 - 9076) + chr(0b1100011) + '\157' + chr(1328 - 1228) + '\145')(chr(5909 - 5792) + '\164' + chr(102) + chr(0b101101) + '\x38'))), rVMkTcEfqM4b), key=EGCsvw2MzaQf)], environ=rNK60KZ67nXB)
except (q1QCh3W88sgk, KlPSljPzIJ_u) as GlnVAPeT6CUe:
if xafqLlk3kkUe(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'=\xf0\x1e\xb4\xa3'), chr(100) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(0b1011100 + 0o10) + chr(4086 - 3985))(chr(0b1011001 + 0o34) + chr(13052 - 12936) + chr(2113 - 2011) + chr(0b101000 + 0o5) + '\070'), xafqLlk3kkUe(lKz5VhncMjGe, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1d\xcc#\x9f\x82X'), chr(0b101001 + 0o73) + '\x65' + chr(0b10101 + 0o116) + chr(11938 - 11827) + '\144' + '\x65')('\x75' + chr(3961 - 3845) + chr(102) + chr(0b101101) + chr(830 - 774)))) != xafqLlk3kkUe(lKz5VhncMjGe, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1d\xcc#\x9f\x82X'), chr(0b1100100) + chr(101) + '\x63' + chr(2416 - 2305) + chr(100) + '\145')(chr(117) + '\164' + chr(102) + chr(0b101101) + chr(0b100110 + 0o22))):
raise
raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'6\xedL\xbe\xadx\xc0\xe8\x15\'U\xb2\xca3\x08\xaaU\xe1wlAD\xe3\xb1\x8bW\xb9\xabh.\x96\x8e\xc6T\x1f\xf8\xb2\x8b\xdcQ*\xe7L\xa1\xb8e\xcc\xad\x00<F\xff\xd8;l\xa3X\xfd5r\x03H\xe2\xa0\xc7\\\xfd\xbcq.\x8d\x8f\xc6I\x18\xb6\xea\xce\x9e\x1e"\xeb\x1c\xb6\xa5b\xc4\xe8\x1a&@\xf7\xdb2F\xe3[\xa4,uV_\xe9\xb9\x82O'), chr(0b1100100) + '\x65' + '\x63' + '\157' + chr(0b110110 + 0o56) + chr(0b1100101))(chr(0b1011000 + 0o35) + chr(4002 - 3886) + '\x66' + chr(45) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x0e\xb6\x1e\xb5\x84m\xf2\xfb#8B\xf8'), chr(0b1100100) + chr(101) + chr(99) + chr(0b1010101 + 0o32) + '\x64' + '\145')('\165' + chr(0b1110100) + chr(8916 - 8814) + chr(1544 - 1499) + chr(0b111000)))(bundle=DbKw7rUUOz3X, timestamp=SgRbwnqVfFz7))
def mxtdQMeiwJZJ(AIvJRzLdDfgF, rNK60KZ67nXB=xafqLlk3kkUe(oqhJDdMJfuwx, xafqLlk3kkUe(SXOLrMavuUCe(b"*\xcc'\xec\xfcG\xfb\xfeD&\x7f\xd0"), '\144' + '\145' + '\x63' + chr(12189 - 12078) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b1100011 + 0o21) + chr(0b1000000 + 0o46) + '\055' + chr(56))), SgRbwnqVfFz7=None):
if SgRbwnqVfFz7 is None:
SgRbwnqVfFz7 = dubtF9GfzOdC.Timestamp.utcnow()
Y7nACqE1XA1a = Ywa_Nys4hrtQ(AIvJRzLdDfgF, SgRbwnqVfFz7, environ=rNK60KZ67nXB)
return Hspto46dpR7_(asset_finder=JI50QkblXAVB(EzBBA1aFQiaV(AIvJRzLdDfgF, Y7nACqE1XA1a, environ=rNK60KZ67nXB)), equity_minute_bar_reader=WcLqGSelzcnX(kgOfARJwa_Iv(AIvJRzLdDfgF, Y7nACqE1XA1a, environ=rNK60KZ67nXB)), equity_daily_bar_reader=DyfTJiqA3Fn0(QBkYlC20adzg(AIvJRzLdDfgF, Y7nACqE1XA1a, environ=rNK60KZ67nXB)), adjustment_reader=a62DSxJrSE1B(IV9kxCcswxPr(AIvJRzLdDfgF, Y7nACqE1XA1a, environ=rNK60KZ67nXB)))
@n8IJXbSueTJV(before=BgYDnXoKIrEL(wI0UnXRwqYsX), after=BgYDnXoKIrEL(wI0UnXRwqYsX))
def pFP9VDRQF23q(AIvJRzLdDfgF, SYBWeRDQQk_b=None, yUiKpR0j07vX=None, H6zra5sLycUI=None, rNK60KZ67nXB=xafqLlk3kkUe(oqhJDdMJfuwx, xafqLlk3kkUe(SXOLrMavuUCe(b"*\xcc'\xec\xfcG\xfb\xfeD&\x7f\xd0"), chr(0b1100100) + '\145' + chr(5025 - 4926) + chr(111) + chr(100) + chr(101))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(45) + '\070'))):
try:
gEkbTylEvEqq = vUlqIvNSaRMa(hi1V0ySZcNds(Q1FWXMQw5NsA(pcNidiB9q0YZ.CknQN6tef5sc), oqhJDdMJfuwx.listdir(pcNidiB9q0YZ.data_path([AIvJRzLdDfgF], environ=rNK60KZ67nXB))), key=EGCsvw2MzaQf)
except KlPSljPzIJ_u as GlnVAPeT6CUe:
if xafqLlk3kkUe(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'4\xc9\x16\xef\x9ad\xcf\xab>"`\xf7'), chr(100) + '\x65' + chr(3833 - 3734) + chr(111) + chr(100) + chr(7747 - 7646))('\x75' + chr(0b1110100 + 0o0) + chr(102) + chr(0b101010 + 0o3) + chr(56))) != xafqLlk3kkUe(lKz5VhncMjGe, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1d\xcc#\x9f\x82X'), chr(0b1011011 + 0o11) + chr(2542 - 2441) + chr(99) + chr(111) + chr(100) + chr(101))(chr(0b10 + 0o163) + '\x74' + chr(4714 - 4612) + '\x2d' + chr(1430 - 1374))):
raise
raise HJreK_cvrwfO(AIvJRzLdDfgF)
if (SYBWeRDQQk_b is not None or yUiKpR0j07vX is not None) and H6zra5sLycUI is not None:
raise fDtnmJ8_N5Xe(SYBWeRDQQk_b, yUiKpR0j07vX, H6zra5sLycUI)
if H6zra5sLycUI is None:
def r21B1VATOext(AIvJRzLdDfgF):
OmU3Un949MWT = EGCsvw2MzaQf(AIvJRzLdDfgF)
return SYBWeRDQQk_b is not None and OmU3Un949MWT < SYBWeRDQQk_b or (yUiKpR0j07vX is not None and OmU3Un949MWT > yUiKpR0j07vX)
elif H6zra5sLycUI >= ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(3635 - 3524) + chr(337 - 289), 8):
fssEkg_ejmQv = MVEN8G6CxlvR(JbwkOiAWV1Kb(H6zra5sLycUI, RFiwrCZH9Ie6(gEkbTylEvEqq)))
def r21B1VATOext(AIvJRzLdDfgF):
return AIvJRzLdDfgF not in fssEkg_ejmQv
else:
raise fDtnmJ8_N5Xe(SYBWeRDQQk_b, yUiKpR0j07vX, H6zra5sLycUI)
UNHl4xThSMlN = MVEN8G6CxlvR()
for sgt5BU61bwZ2 in gEkbTylEvEqq:
if r21B1VATOext(sgt5BU61bwZ2):
EaCjyhZptSer = pcNidiB9q0YZ.data_path([AIvJRzLdDfgF, sgt5BU61bwZ2], environ=rNK60KZ67nXB)
xafqLlk3kkUe(DSLq_IS6e6IX, xafqLlk3kkUe(SXOLrMavuUCe(b'*\xef\x18\xa8\xa9i'), chr(0b1100100) + chr(0b111 + 0o136) + chr(5038 - 4939) + chr(0b100101 + 0o112) + chr(100) + chr(101))(chr(0b1110101) + '\164' + chr(5773 - 5671) + '\x2d' + '\x38'))(EaCjyhZptSer)
xafqLlk3kkUe(UNHl4xThSMlN, xafqLlk3kkUe(SXOLrMavuUCe(b'-\xc8\\\xab\xf5o\xe6\xfd)\x07u\xa1'), chr(0b10 + 0o142) + '\x65' + chr(0b101101 + 0o66) + chr(0b1101111) + chr(0b10011 + 0o121) + '\145')(chr(3384 - 3267) + '\164' + chr(5160 - 5058) + '\055' + chr(56)))(EaCjyhZptSer)
return UNHl4xThSMlN
return XdvlGEa03yEU(e6TIGpvOn5Jf, WlGrEKpik_hR, qptzFnt1v15O, L7s2CXx4LJem, mxtdQMeiwJZJ, pFP9VDRQF23q)
|
quantopian/zipline
|
zipline/utils/deprecate.py
|
deprecated
|
def deprecated(msg=None, stacklevel=2):
"""
Used to mark a function as deprecated.
Parameters
----------
msg : str
The message to display in the deprecation warning.
stacklevel : int
How far up the stack the warning needs to go, before
showing the relevant calling lines.
Examples
--------
@deprecated(msg='function_a is deprecated! Use function_b instead.')
def function_a(*args, **kwargs):
"""
def deprecated_dec(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
warnings.warn(
msg or "Function %s is deprecated." % fn.__name__,
category=DeprecationWarning,
stacklevel=stacklevel
)
return fn(*args, **kwargs)
return wrapper
return deprecated_dec
|
python
|
def deprecated(msg=None, stacklevel=2):
"""
Used to mark a function as deprecated.
Parameters
----------
msg : str
The message to display in the deprecation warning.
stacklevel : int
How far up the stack the warning needs to go, before
showing the relevant calling lines.
Examples
--------
@deprecated(msg='function_a is deprecated! Use function_b instead.')
def function_a(*args, **kwargs):
"""
def deprecated_dec(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
warnings.warn(
msg or "Function %s is deprecated." % fn.__name__,
category=DeprecationWarning,
stacklevel=stacklevel
)
return fn(*args, **kwargs)
return wrapper
return deprecated_dec
|
[
"def",
"deprecated",
"(",
"msg",
"=",
"None",
",",
"stacklevel",
"=",
"2",
")",
":",
"def",
"deprecated_dec",
"(",
"fn",
")",
":",
"@",
"wraps",
"(",
"fn",
")",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"warnings",
".",
"warn",
"(",
"msg",
"or",
"\"Function %s is deprecated.\"",
"%",
"fn",
".",
"__name__",
",",
"category",
"=",
"DeprecationWarning",
",",
"stacklevel",
"=",
"stacklevel",
")",
"return",
"fn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"wrapper",
"return",
"deprecated_dec"
] |
Used to mark a function as deprecated.
Parameters
----------
msg : str
The message to display in the deprecation warning.
stacklevel : int
How far up the stack the warning needs to go, before
showing the relevant calling lines.
Examples
--------
@deprecated(msg='function_a is deprecated! Use function_b instead.')
def function_a(*args, **kwargs):
|
[
"Used",
"to",
"mark",
"a",
"function",
"as",
"deprecated",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/utils/deprecate.py#L20-L47
|
train
|
A decorator that marks a function as deprecated.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6L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3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1084 - 1036) + '\157' + chr(51) + '\060' + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(2990 - 2879) + chr(2387 - 2336) + chr(0b100 + 0o60) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100010 + 0o20) + chr(50) + chr(49), 10583 - 10575), ehT0Px3KOsy9(chr(0b110000) + chr(0b100010 + 0o115) + '\061' + chr(49) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(2234 - 2181) + '\061', 25076 - 25068), ehT0Px3KOsy9(chr(363 - 315) + '\x6f' + chr(1357 - 1308) + chr(694 - 642) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + chr(2001 - 1952) + '\064' + chr(0b100110 + 0o21), 39142 - 39134), ehT0Px3KOsy9(chr(1544 - 1496) + '\157' + chr(0b110010) + chr(55) + chr(1930 - 1882), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b110110) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100101 + 0o16) + chr(53) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(0b110000) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\x6f' + '\063' + chr(0b100011 + 0o21) + '\063', 37016 - 37008), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(2019 - 1970) + '\062', 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110100) + '\065', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + '\x33' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001 + 0o2) + chr(54) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(5561 - 5450) + '\062' + '\060' + '\x35', 0b1000), ehT0Px3KOsy9(chr(1901 - 1853) + chr(11233 - 11122) + chr(0b110010 + 0o0) + chr(0b0 + 0o60) + '\066', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\062' + '\063' + '\061', 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(8496 - 8385) + chr(49) + chr(2219 - 2170) + chr(0b100110 + 0o17), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + '\064' + '\067', 8), ehT0Px3KOsy9(chr(683 - 635) + '\x6f' + chr(0b101000 + 0o12) + chr(55) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(111) + chr(0b10100 + 0o37) + chr(0b110111 + 0o0) + '\065', 46451 - 46443), ehT0Px3KOsy9('\x30' + chr(12039 - 11928) + '\061' + '\x35' + chr(0b10101 + 0o35), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + chr(0b11111 + 0o21) + chr(1430 - 1375), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(54) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(1916 - 1868) + chr(0b111011 + 0o64) + chr(0b110010 + 0o0) + chr(0b110001) + chr(52), 13251 - 13243), ehT0Px3KOsy9('\060' + '\x6f' + chr(537 - 486) + '\x37' + chr(940 - 885), 47288 - 47280), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(214 - 160) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b111001 + 0o66) + chr(51) + chr(0b110000) + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(2529 - 2418) + chr(50) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b11001 + 0o32) + chr(0b110111) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b11110 + 0o121) + chr(50) + '\063' + '\062', 3599 - 3591), ehT0Px3KOsy9('\x30' + chr(4042 - 3931) + chr(0b1010 + 0o50) + chr(0b110111) + chr(0b10011 + 0o41), 47204 - 47196), ehT0Px3KOsy9(chr(0b110000) + chr(0b11110 + 0o121) + '\x32' + chr(0b100010 + 0o22) + chr(0b1111 + 0o50), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(759 - 707), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b100000 + 0o21) + chr(0b1111 + 0o42) + chr(97 - 46), ord("\x08")), ehT0Px3KOsy9(chr(2061 - 2013) + chr(111) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + '\062' + chr(0b10101 + 0o42), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + chr(631 - 578) + chr(1573 - 1525), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xea'), chr(0b1100100) + chr(101) + '\143' + '\x6f' + chr(793 - 693) + chr(8408 - 8307))(chr(117) + chr(0b1101010 + 0o12) + chr(102) + chr(45) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def JJtteNts3BW0(jtbovtaIYjRB=None, Xv6_k0Ob5b9V=ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32', 38070 - 38062)):
def gB8hDGrge3Ra(wDsB9Ho570J9):
@cUOaMZfY2Ho1(wDsB9Ho570J9)
def WW5T3xxdlUaG(*kJDRfRhcZHjS, **M8EIoTs2GJXE):
xafqLlk3kkUe(fJoTPf8D_opC, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa\xa3\xd4$\xa7"\x06\xda7\xa5E/'), chr(0b1001001 + 0o33) + '\x65' + chr(0b1100011) + chr(0b11101 + 0o122) + '\144' + chr(0b100001 + 0o104))('\165' + '\x74' + '\146' + '\x2d' + chr(0b100001 + 0o27)))(jtbovtaIYjRB or xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x92\xff)\x9d\t\x08\xd6Q\xce}b\x8a9\x058\x90\xf5\xf4\xfc.\x86\xca\x98\x0e\xe9'), chr(0b1100100) + chr(0b111110 + 0o47) + chr(0b10 + 0o141) + '\157' + chr(0b1100100) + chr(101))(chr(0b1110101) + '\x74' + '\x66' + chr(1371 - 1326) + chr(211 - 155)) % xafqLlk3kkUe(wDsB9Ho570J9, xafqLlk3kkUe(SXOLrMavuUCe(b'\x83\x85\xf4 \xdd\x0f=\xc9:\xa7Ot'), chr(100) + chr(101) + chr(99) + '\x6f' + chr(821 - 721) + chr(0b1100101))(chr(7661 - 7544) + chr(11512 - 11396) + '\146' + chr(0b11011 + 0o22) + chr(0b110011 + 0o5))), category=ker4pIJmdvxf, stacklevel=Xv6_k0Ob5b9V)
return wDsB9Ho570J9(*kJDRfRhcZHjS, **M8EIoTs2GJXE)
return WW5T3xxdlUaG
return gB8hDGrge3Ra
|
quantopian/zipline
|
zipline/data/history_loader.py
|
HistoryCompatibleUSEquityAdjustmentReader.load_pricing_adjustments
|
def load_pricing_adjustments(self, columns, dts, assets):
"""
Returns
-------
adjustments : list[dict[int -> Adjustment]]
A list, where each element corresponds to the `columns`, of
mappings from index to adjustment objects to apply at that index.
"""
out = [None] * len(columns)
for i, column in enumerate(columns):
adjs = {}
for asset in assets:
adjs.update(self._get_adjustments_in_range(
asset, dts, column))
out[i] = adjs
return out
|
python
|
def load_pricing_adjustments(self, columns, dts, assets):
"""
Returns
-------
adjustments : list[dict[int -> Adjustment]]
A list, where each element corresponds to the `columns`, of
mappings from index to adjustment objects to apply at that index.
"""
out = [None] * len(columns)
for i, column in enumerate(columns):
adjs = {}
for asset in assets:
adjs.update(self._get_adjustments_in_range(
asset, dts, column))
out[i] = adjs
return out
|
[
"def",
"load_pricing_adjustments",
"(",
"self",
",",
"columns",
",",
"dts",
",",
"assets",
")",
":",
"out",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"columns",
")",
"for",
"i",
",",
"column",
"in",
"enumerate",
"(",
"columns",
")",
":",
"adjs",
"=",
"{",
"}",
"for",
"asset",
"in",
"assets",
":",
"adjs",
".",
"update",
"(",
"self",
".",
"_get_adjustments_in_range",
"(",
"asset",
",",
"dts",
",",
"column",
")",
")",
"out",
"[",
"i",
"]",
"=",
"adjs",
"return",
"out"
] |
Returns
-------
adjustments : list[dict[int -> Adjustment]]
A list, where each element corresponds to the `columns`, of
mappings from index to adjustment objects to apply at that index.
|
[
"Returns",
"-------",
"adjustments",
":",
"list",
"[",
"dict",
"[",
"int",
"-",
">",
"Adjustment",
"]]",
"A",
"list",
"where",
"each",
"element",
"corresponds",
"to",
"the",
"columns",
"of",
"mappings",
"from",
"index",
"to",
"adjustment",
"objects",
"to",
"apply",
"at",
"that",
"index",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/history_loader.py#L48-L63
|
train
|
Returns a list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jv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1000100 + 0o53) + '\x31' + '\064' + chr(0b111 + 0o54), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + '\067' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(2287 - 2239) + chr(5801 - 5690) + chr(0b110001) + chr(0b110110) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + '\062' + chr(0b100000 + 0o27), 45988 - 45980), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11000 + 0o35) + chr(0b1101 + 0o43), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(809 - 758) + '\067' + chr(665 - 611), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101001 + 0o12) + chr(0b110000) + chr(1721 - 1673), 23577 - 23569), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b10 + 0o65) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\157' + chr(0b110011) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b10110 + 0o37) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + '\x31' + '\065', 26568 - 26560), ehT0Px3KOsy9(chr(48) + chr(0b1001100 + 0o43) + chr(0b110010) + '\063' + chr(0b101000 + 0o12), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + '\061' + chr(0b100111 + 0o16) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b10100 + 0o133) + chr(50) + '\x37' + '\065', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1965 - 1915) + chr(0b101101 + 0o7) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\157' + chr(0b10001 + 0o41) + chr(0b11 + 0o61) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(7030 - 6919) + chr(1763 - 1710) + chr(2328 - 2278), ord("\x08")), ehT0Px3KOsy9(chr(1484 - 1436) + chr(5738 - 5627) + '\063' + chr(0b110011) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\157' + '\x31' + chr(51) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1 + 0o156) + chr(0b110010) + '\061', 0b1000), ehT0Px3KOsy9(chr(1321 - 1273) + chr(0b10011 + 0o134) + chr(1768 - 1717) + chr(0b110 + 0o52) + chr(0b110001), 26912 - 26904), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b1110 + 0o50) + chr(0b1001 + 0o47), 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + chr(0b10000 + 0o43) + chr(0b110010) + '\062', 0o10), ehT0Px3KOsy9('\x30' + chr(0b10111 + 0o130) + chr(0b100001 + 0o20) + chr(1772 - 1723) + chr(0b101101 + 0o3), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(0b110111) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + '\060' + chr(55), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(0b110110 + 0o1) + chr(0b101011 + 0o6), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(679 - 629) + chr(55) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\x6f' + '\062' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(2101 - 2053) + '\157' + '\063' + '\x33' + chr(1977 - 1925), 51592 - 51584), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\x6f' + '\063' + chr(0b100011 + 0o15) + chr(54), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(143 - 93) + '\064' + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(1733 - 1685) + chr(0b110001), 50860 - 50852), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b100011 + 0o17) + chr(0b110100) + chr(1533 - 1478), 8), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(7028 - 6917) + chr(51) + chr(532 - 477) + chr(356 - 306), 64725 - 64717), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + '\063', 8), ehT0Px3KOsy9(chr(1343 - 1295) + chr(0b100000 + 0o117) + chr(2098 - 2049) + '\x30' + chr(0b101001 + 0o7), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(54) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(2018 - 1970) + chr(0b1100011 + 0o14) + chr(0b110010) + chr(48) + chr(1259 - 1211), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + '\065' + chr(48), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'M'), '\x64' + '\145' + chr(0b1011100 + 0o7) + chr(0b1101111) + chr(100) + chr(2992 - 2891))('\x75' + '\x74' + chr(0b1100110) + chr(0b1111 + 0o36) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def gXSBPvddthZ7(oVre8I6UXc3b, qKlXBtn3PKy4, f5Ww7tOW_bKL, YGFU3oxACPcg):
UkrMp_I0RDmo = [None] * c2A0yzQpDQB3(qKlXBtn3PKy4)
for (WVxHKyX45z_L, Pl0JgJDv0QqN) in YlkZvXL8qwsX(qKlXBtn3PKy4):
mzFGmhQPS7zS = {}
for tKJAwKiE1Zya in YGFU3oxACPcg:
xafqLlk3kkUe(mzFGmhQPS7zS, xafqLlk3kkUe(SXOLrMavuUCe(b'9N0\x12A\xb0\x8a\x92e\xde\xe8\xaa'), chr(7594 - 7494) + '\x65' + '\143' + chr(0b1101111) + '\x64' + '\x65')('\165' + '\x74' + '\x66' + '\x2d' + chr(0b110 + 0o62)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'<]\x14#w\x9f\xa4\x96i\x99\xf9\xf7\x08\xd3\xd2\xd4u\xb21N\xb3Q\xbc/\xdc'), chr(0b1100100) + chr(101) + '\x63' + chr(0b110101 + 0o72) + chr(100) + chr(0b1100101))(chr(8075 - 7958) + '\x74' + chr(0b1100110) + chr(1910 - 1865) + chr(56)))(tKJAwKiE1Zya, f5Ww7tOW_bKL, Pl0JgJDv0QqN))
UkrMp_I0RDmo[WVxHKyX45z_L] = mzFGmhQPS7zS
return UkrMp_I0RDmo
|
quantopian/zipline
|
zipline/data/history_loader.py
|
HistoryCompatibleUSEquityAdjustmentReader._get_adjustments_in_range
|
def _get_adjustments_in_range(self, asset, dts, field):
"""
Get the Float64Multiply objects to pass to an AdjustedArrayWindow.
For the use of AdjustedArrayWindow in the loader, which looks back
from current simulation time back to a window of data the dictionary is
structured with:
- the key into the dictionary for adjustments is the location of the
day from which the window is being viewed.
- the start of all multiply objects is always 0 (in each window all
adjustments are overlapping)
- the end of the multiply object is the location before the calendar
location of the adjustment action, making all days before the event
adjusted.
Parameters
----------
asset : Asset
The assets for which to get adjustments.
dts : iterable of datetime64-like
The dts for which adjustment data is needed.
field : str
OHLCV field for which to get the adjustments.
Returns
-------
out : dict[loc -> Float64Multiply]
The adjustments as a dict of loc -> Float64Multiply
"""
sid = int(asset)
start = normalize_date(dts[0])
end = normalize_date(dts[-1])
adjs = {}
if field != 'volume':
mergers = self._adjustments_reader.get_adjustments_for_sid(
'mergers', sid)
for m in mergers:
dt = m[0]
if start < dt <= end:
end_loc = dts.searchsorted(dt)
adj_loc = end_loc
mult = Float64Multiply(0,
end_loc - 1,
0,
0,
m[1])
try:
adjs[adj_loc].append(mult)
except KeyError:
adjs[adj_loc] = [mult]
divs = self._adjustments_reader.get_adjustments_for_sid(
'dividends', sid)
for d in divs:
dt = d[0]
if start < dt <= end:
end_loc = dts.searchsorted(dt)
adj_loc = end_loc
mult = Float64Multiply(0,
end_loc - 1,
0,
0,
d[1])
try:
adjs[adj_loc].append(mult)
except KeyError:
adjs[adj_loc] = [mult]
splits = self._adjustments_reader.get_adjustments_for_sid(
'splits', sid)
for s in splits:
dt = s[0]
if start < dt <= end:
if field == 'volume':
ratio = 1.0 / s[1]
else:
ratio = s[1]
end_loc = dts.searchsorted(dt)
adj_loc = end_loc
mult = Float64Multiply(0,
end_loc - 1,
0,
0,
ratio)
try:
adjs[adj_loc].append(mult)
except KeyError:
adjs[adj_loc] = [mult]
return adjs
|
python
|
def _get_adjustments_in_range(self, asset, dts, field):
"""
Get the Float64Multiply objects to pass to an AdjustedArrayWindow.
For the use of AdjustedArrayWindow in the loader, which looks back
from current simulation time back to a window of data the dictionary is
structured with:
- the key into the dictionary for adjustments is the location of the
day from which the window is being viewed.
- the start of all multiply objects is always 0 (in each window all
adjustments are overlapping)
- the end of the multiply object is the location before the calendar
location of the adjustment action, making all days before the event
adjusted.
Parameters
----------
asset : Asset
The assets for which to get adjustments.
dts : iterable of datetime64-like
The dts for which adjustment data is needed.
field : str
OHLCV field for which to get the adjustments.
Returns
-------
out : dict[loc -> Float64Multiply]
The adjustments as a dict of loc -> Float64Multiply
"""
sid = int(asset)
start = normalize_date(dts[0])
end = normalize_date(dts[-1])
adjs = {}
if field != 'volume':
mergers = self._adjustments_reader.get_adjustments_for_sid(
'mergers', sid)
for m in mergers:
dt = m[0]
if start < dt <= end:
end_loc = dts.searchsorted(dt)
adj_loc = end_loc
mult = Float64Multiply(0,
end_loc - 1,
0,
0,
m[1])
try:
adjs[adj_loc].append(mult)
except KeyError:
adjs[adj_loc] = [mult]
divs = self._adjustments_reader.get_adjustments_for_sid(
'dividends', sid)
for d in divs:
dt = d[0]
if start < dt <= end:
end_loc = dts.searchsorted(dt)
adj_loc = end_loc
mult = Float64Multiply(0,
end_loc - 1,
0,
0,
d[1])
try:
adjs[adj_loc].append(mult)
except KeyError:
adjs[adj_loc] = [mult]
splits = self._adjustments_reader.get_adjustments_for_sid(
'splits', sid)
for s in splits:
dt = s[0]
if start < dt <= end:
if field == 'volume':
ratio = 1.0 / s[1]
else:
ratio = s[1]
end_loc = dts.searchsorted(dt)
adj_loc = end_loc
mult = Float64Multiply(0,
end_loc - 1,
0,
0,
ratio)
try:
adjs[adj_loc].append(mult)
except KeyError:
adjs[adj_loc] = [mult]
return adjs
|
[
"def",
"_get_adjustments_in_range",
"(",
"self",
",",
"asset",
",",
"dts",
",",
"field",
")",
":",
"sid",
"=",
"int",
"(",
"asset",
")",
"start",
"=",
"normalize_date",
"(",
"dts",
"[",
"0",
"]",
")",
"end",
"=",
"normalize_date",
"(",
"dts",
"[",
"-",
"1",
"]",
")",
"adjs",
"=",
"{",
"}",
"if",
"field",
"!=",
"'volume'",
":",
"mergers",
"=",
"self",
".",
"_adjustments_reader",
".",
"get_adjustments_for_sid",
"(",
"'mergers'",
",",
"sid",
")",
"for",
"m",
"in",
"mergers",
":",
"dt",
"=",
"m",
"[",
"0",
"]",
"if",
"start",
"<",
"dt",
"<=",
"end",
":",
"end_loc",
"=",
"dts",
".",
"searchsorted",
"(",
"dt",
")",
"adj_loc",
"=",
"end_loc",
"mult",
"=",
"Float64Multiply",
"(",
"0",
",",
"end_loc",
"-",
"1",
",",
"0",
",",
"0",
",",
"m",
"[",
"1",
"]",
")",
"try",
":",
"adjs",
"[",
"adj_loc",
"]",
".",
"append",
"(",
"mult",
")",
"except",
"KeyError",
":",
"adjs",
"[",
"adj_loc",
"]",
"=",
"[",
"mult",
"]",
"divs",
"=",
"self",
".",
"_adjustments_reader",
".",
"get_adjustments_for_sid",
"(",
"'dividends'",
",",
"sid",
")",
"for",
"d",
"in",
"divs",
":",
"dt",
"=",
"d",
"[",
"0",
"]",
"if",
"start",
"<",
"dt",
"<=",
"end",
":",
"end_loc",
"=",
"dts",
".",
"searchsorted",
"(",
"dt",
")",
"adj_loc",
"=",
"end_loc",
"mult",
"=",
"Float64Multiply",
"(",
"0",
",",
"end_loc",
"-",
"1",
",",
"0",
",",
"0",
",",
"d",
"[",
"1",
"]",
")",
"try",
":",
"adjs",
"[",
"adj_loc",
"]",
".",
"append",
"(",
"mult",
")",
"except",
"KeyError",
":",
"adjs",
"[",
"adj_loc",
"]",
"=",
"[",
"mult",
"]",
"splits",
"=",
"self",
".",
"_adjustments_reader",
".",
"get_adjustments_for_sid",
"(",
"'splits'",
",",
"sid",
")",
"for",
"s",
"in",
"splits",
":",
"dt",
"=",
"s",
"[",
"0",
"]",
"if",
"start",
"<",
"dt",
"<=",
"end",
":",
"if",
"field",
"==",
"'volume'",
":",
"ratio",
"=",
"1.0",
"/",
"s",
"[",
"1",
"]",
"else",
":",
"ratio",
"=",
"s",
"[",
"1",
"]",
"end_loc",
"=",
"dts",
".",
"searchsorted",
"(",
"dt",
")",
"adj_loc",
"=",
"end_loc",
"mult",
"=",
"Float64Multiply",
"(",
"0",
",",
"end_loc",
"-",
"1",
",",
"0",
",",
"0",
",",
"ratio",
")",
"try",
":",
"adjs",
"[",
"adj_loc",
"]",
".",
"append",
"(",
"mult",
")",
"except",
"KeyError",
":",
"adjs",
"[",
"adj_loc",
"]",
"=",
"[",
"mult",
"]",
"return",
"adjs"
] |
Get the Float64Multiply objects to pass to an AdjustedArrayWindow.
For the use of AdjustedArrayWindow in the loader, which looks back
from current simulation time back to a window of data the dictionary is
structured with:
- the key into the dictionary for adjustments is the location of the
day from which the window is being viewed.
- the start of all multiply objects is always 0 (in each window all
adjustments are overlapping)
- the end of the multiply object is the location before the calendar
location of the adjustment action, making all days before the event
adjusted.
Parameters
----------
asset : Asset
The assets for which to get adjustments.
dts : iterable of datetime64-like
The dts for which adjustment data is needed.
field : str
OHLCV field for which to get the adjustments.
Returns
-------
out : dict[loc -> Float64Multiply]
The adjustments as a dict of loc -> Float64Multiply
|
[
"Get",
"the",
"Float64Multiply",
"objects",
"to",
"pass",
"to",
"an",
"AdjustedArrayWindow",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/history_loader.py#L65-L151
|
train
|
Get the adjustments for the given asset and dts.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,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LkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(111) + chr(0b100000 + 0o21) + chr(0b10000 + 0o45) + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1001111 + 0o40) + chr(0b11111 + 0o22) + '\066' + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2078 - 2027) + '\x33' + '\064', 30833 - 30825), ehT0Px3KOsy9(chr(2229 - 2181) + chr(0b1101111) + '\x31' + chr(0b11000 + 0o34) + '\x30', 42815 - 42807), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x36' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(5648 - 5537) + chr(1512 - 1462) + '\x30' + chr(0b11 + 0o56), 28262 - 28254), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(0b11001 + 0o34) + chr(1535 - 1484), 64986 - 64978), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2063 - 2008), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6317 - 6206) + '\x31' + chr(0b100010 + 0o25), ord("\x08")), ehT0Px3KOsy9(chr(1065 - 1017) + chr(1227 - 1116) + chr(996 - 947) + '\065', 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + '\062' + chr(0b11001 + 0o33) + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(0b1010 + 0o53) + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1011111 + 0o20) + chr(0b110001) + '\x30' + chr(511 - 459), 13470 - 13462), ehT0Px3KOsy9('\x30' + chr(5604 - 5493) + chr(0b110011) + chr(2291 - 2243) + '\x37', 883 - 875), ehT0Px3KOsy9(chr(0b110000) + chr(10562 - 10451) + chr(0b10010 + 0o37) + chr(0b101101 + 0o7) + '\063', 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1011110 + 0o21) + chr(2449 - 2398) + '\063' + chr(0b100000 + 0o22), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1000000 + 0o57) + chr(50) + chr(553 - 505) + '\060', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(1496 - 1446) + chr(48) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100111 + 0o110) + chr(372 - 321) + chr(51) + '\066', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b100001 + 0o21) + '\063' + chr(0b11000 + 0o31), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(2248 - 2199) + chr(0b110111) + chr(705 - 653), 8853 - 8845), ehT0Px3KOsy9('\x30' + chr(0b1010 + 0o145) + chr(51) + chr(55) + '\x32', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + '\x30' + '\062', ord("\x08")), ehT0Px3KOsy9('\060' + chr(12186 - 12075) + '\061' + '\x37', 8), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(0b100101 + 0o15) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\x6f' + chr(0b110010) + '\x32' + chr(0b101110 + 0o5), 0b1000), ehT0Px3KOsy9(chr(48) + chr(7114 - 7003) + chr(49) + chr(51) + chr(1712 - 1663), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9362 - 9251) + chr(49) + chr(2080 - 2028) + '\x31', 40338 - 40330), ehT0Px3KOsy9('\x30' + chr(0b1011100 + 0o23) + chr(0b110110) + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + chr(49) + chr(51), 53546 - 53538), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + '\066' + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(7432 - 7321) + chr(49) + '\062' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110 + 0o151) + chr(0b110001) + '\062' + '\x36', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + '\062', 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1101111) + chr(0b110001) + chr(1880 - 1830) + '\x36', 8), ehT0Px3KOsy9(chr(179 - 131) + '\x6f' + '\063' + chr(320 - 272) + chr(2416 - 2364), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(52) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + '\061', 0o10), ehT0Px3KOsy9(chr(1879 - 1831) + chr(0b1001 + 0o146) + chr(0b110011) + chr(50) + chr(54), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101110 + 0o1) + chr(0b1001 + 0o51) + chr(0b10 + 0o65) + '\x31', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(0b11010 + 0o33) + chr(0b1001 + 0o47), 23273 - 23265)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'@'), chr(1351 - 1251) + chr(0b110000 + 0o65) + chr(0b11101 + 0o106) + '\x6f' + '\144' + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(0b100101 + 0o10) + chr(0b100 + 0o64)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def TZrsMRXvNLWT(oVre8I6UXc3b, tKJAwKiE1Zya, f5Ww7tOW_bKL, fEcfxx4smAdS):
Cli4Sf5HnGOS = ehT0Px3KOsy9(tKJAwKiE1Zya)
avRbFsnfJxQj = _F0ikw07R1Id(f5Ww7tOW_bKL[ehT0Px3KOsy9(chr(1540 - 1492) + '\157' + '\060', 0o10)])
whWDZq5_lP01 = _F0ikw07R1Id(f5Ww7tOW_bKL[-ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + chr(1929 - 1880), 0b1000)])
mzFGmhQPS7zS = {}
if fEcfxx4smAdS != xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\x18\xb0\x15[\xe4'), chr(5315 - 5215) + chr(0b1100101) + '\x63' + chr(170 - 59) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(8336 - 8220) + chr(0b1100110) + '\055' + chr(1025 - 969)):
iHLzVNPzXcKD = oVre8I6UXc3b._adjustments_reader.get_adjustments_for_sid(xafqLlk3kkUe(SXOLrMavuUCe(b'\x03\x12\xae\x07S\xf3\x98'), '\x64' + '\x65' + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(101))(chr(12552 - 12435) + chr(9855 - 9739) + '\146' + chr(0b1011 + 0o42) + chr(0b111000)), Cli4Sf5HnGOS)
for r8ufID9JCHnI in iHLzVNPzXcKD:
OmU3Un949MWT = r8ufID9JCHnI[ehT0Px3KOsy9(chr(48) + chr(0b1010011 + 0o34) + chr(1920 - 1872), 8)]
if avRbFsnfJxQj < OmU3Un949MWT <= whWDZq5_lP01:
INO6Ec2JRhip = f5Ww7tOW_bKL.searchsorted(OmU3Un949MWT)
o5kKD0odFUrp = INO6Ec2JRhip
TGBHkjFQA_aS = Nff6Sv7WnHos(ehT0Px3KOsy9(chr(188 - 140) + chr(2583 - 2472) + chr(0b110000), 8), INO6Ec2JRhip - ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31', 8), ehT0Px3KOsy9('\060' + chr(0b1011001 + 0o26) + '\060', 8), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(7333 - 7222) + '\060', 8), r8ufID9JCHnI[ehT0Px3KOsy9(chr(48) + chr(0b1000111 + 0o50) + chr(49), 8)])
try:
xafqLlk3kkUe(mzFGmhQPS7zS[o5kKD0odFUrp], xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f\x07\xac\x05X\xe5'), chr(7132 - 7032) + chr(4614 - 4513) + chr(4891 - 4792) + chr(0b101110 + 0o101) + chr(2272 - 2172) + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(102) + chr(0b1000 + 0o45) + chr(56)))(TGBHkjFQA_aS)
except RQ6CSRrFArYB:
mzFGmhQPS7zS[o5kKD0odFUrp] = [TGBHkjFQA_aS]
yjcOoUgL2pZV = oVre8I6UXc3b._adjustments_reader.get_adjustments_for_sid(xafqLlk3kkUe(SXOLrMavuUCe(b'\n\x1e\xaa\tR\xe4\x85c|'), chr(100) + chr(101) + '\x63' + chr(0b1101111) + chr(4256 - 4156) + chr(0b1100101))('\165' + chr(0b111000 + 0o74) + chr(102) + chr(0b101101) + chr(0b111000)), Cli4Sf5HnGOS)
for pd3lxn9vqWxp in yjcOoUgL2pZV:
OmU3Un949MWT = pd3lxn9vqWxp[ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(7776 - 7665) + '\x30', 8)]
if avRbFsnfJxQj < OmU3Un949MWT <= whWDZq5_lP01:
INO6Ec2JRhip = f5Ww7tOW_bKL.searchsorted(OmU3Un949MWT)
o5kKD0odFUrp = INO6Ec2JRhip
TGBHkjFQA_aS = Nff6Sv7WnHos(ehT0Px3KOsy9(chr(972 - 924) + chr(0b1101111) + '\060', 8), INO6Ec2JRhip - ehT0Px3KOsy9('\x30' + chr(0b1010111 + 0o30) + chr(49), 8), ehT0Px3KOsy9(chr(0b110000) + chr(11019 - 10908) + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\157' + chr(48), 8), pd3lxn9vqWxp[ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(111) + chr(49), 8)])
try:
xafqLlk3kkUe(mzFGmhQPS7zS[o5kKD0odFUrp], xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f\x07\xac\x05X\xe5'), '\x64' + '\145' + chr(99) + '\157' + '\144' + '\145')(chr(0b1110101) + chr(0b10111 + 0o135) + '\x66' + '\x2d' + chr(1364 - 1308)))(TGBHkjFQA_aS)
except RQ6CSRrFArYB:
mzFGmhQPS7zS[o5kKD0odFUrp] = [TGBHkjFQA_aS]
uSBCRSw0LUmo = oVre8I6UXc3b._adjustments_reader.get_adjustments_for_sid(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1d\x07\xb0\tB\xf2'), '\x64' + '\145' + chr(99) + chr(3834 - 3723) + chr(878 - 778) + '\145')(chr(0b110111 + 0o76) + '\164' + chr(102) + chr(0b1101 + 0o40) + '\070'), Cli4Sf5HnGOS)
for vGrByMSYMp9h in uSBCRSw0LUmo:
OmU3Un949MWT = vGrByMSYMp9h[ehT0Px3KOsy9('\x30' + '\157' + '\060', 8)]
if avRbFsnfJxQj < OmU3Un949MWT <= whWDZq5_lP01:
if fEcfxx4smAdS == xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\x18\xb0\x15[\xe4'), chr(0b1100100) + '\x65' + '\x63' + '\x6f' + chr(0b1100100) + '\145')(chr(0b1110101) + chr(116) + '\x66' + chr(0b101101) + chr(0b111000)):
pyiPBPsXZj35 = 1.0 / vGrByMSYMp9h[ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31', 8)]
else:
pyiPBPsXZj35 = vGrByMSYMp9h[ehT0Px3KOsy9(chr(1044 - 996) + chr(111) + chr(0b110001), 8)]
INO6Ec2JRhip = f5Ww7tOW_bKL.searchsorted(OmU3Un949MWT)
o5kKD0odFUrp = INO6Ec2JRhip
TGBHkjFQA_aS = Nff6Sv7WnHos(ehT0Px3KOsy9(chr(48) + chr(111) + chr(48), 8), INO6Ec2JRhip - ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001), 8), ehT0Px3KOsy9('\060' + '\x6f' + '\x30', 8), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b110 + 0o151) + chr(48), 8), pyiPBPsXZj35)
try:
xafqLlk3kkUe(mzFGmhQPS7zS[o5kKD0odFUrp], xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f\x07\xac\x05X\xe5'), chr(100) + '\x65' + '\143' + chr(111) + chr(100) + chr(0b1100101))(chr(117) + '\164' + chr(0b10101 + 0o121) + '\055' + chr(1932 - 1876)))(TGBHkjFQA_aS)
except RQ6CSRrFArYB:
mzFGmhQPS7zS[o5kKD0odFUrp] = [TGBHkjFQA_aS]
return mzFGmhQPS7zS
|
quantopian/zipline
|
zipline/data/history_loader.py
|
SlidingWindow.get
|
def get(self, end_ix):
"""
Returns
-------
out : A np.ndarray of the equity pricing up to end_ix after adjustments
and rounding have been applied.
"""
if self.most_recent_ix == end_ix:
return self.current
target = end_ix - self.cal_start - self.offset + 1
self.current = self.window.seek(target)
self.most_recent_ix = end_ix
return self.current
|
python
|
def get(self, end_ix):
"""
Returns
-------
out : A np.ndarray of the equity pricing up to end_ix after adjustments
and rounding have been applied.
"""
if self.most_recent_ix == end_ix:
return self.current
target = end_ix - self.cal_start - self.offset + 1
self.current = self.window.seek(target)
self.most_recent_ix = end_ix
return self.current
|
[
"def",
"get",
"(",
"self",
",",
"end_ix",
")",
":",
"if",
"self",
".",
"most_recent_ix",
"==",
"end_ix",
":",
"return",
"self",
".",
"current",
"target",
"=",
"end_ix",
"-",
"self",
".",
"cal_start",
"-",
"self",
".",
"offset",
"+",
"1",
"self",
".",
"current",
"=",
"self",
".",
"window",
".",
"seek",
"(",
"target",
")",
"self",
".",
"most_recent_ix",
"=",
"end_ix",
"return",
"self",
".",
"current"
] |
Returns
-------
out : A np.ndarray of the equity pricing up to end_ix after adjustments
and rounding have been applied.
|
[
"Returns",
"-------",
"out",
":",
"A",
"np",
".",
"ndarray",
"of",
"the",
"equity",
"pricing",
"up",
"to",
"end_ix",
"after",
"adjustments",
"and",
"rounding",
"have",
"been",
"applied",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/history_loader.py#L279-L293
|
train
|
Get the current set of equity entries up to end_ix.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOW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68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1472 - 1424) + chr(0b1101111) + chr(50) + chr(0b10010 + 0o41) + chr(0b110011), 15104 - 15096), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + chr(130 - 81) + chr(0b11110 + 0o27) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b11100 + 0o123) + chr(0b110010) + chr(0b11111 + 0o22) + chr(0b101001 + 0o11), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b1001 + 0o47) + '\x36', 55650 - 55642), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(51) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(0b100010 + 0o23) + chr(0b110100 + 0o1), 56797 - 56789), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(580 - 531) + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(0b110000) + chr(48), 6983 - 6975), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11100 + 0o27) + '\x36' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(687 - 639) + '\x6f' + chr(0b110010) + chr(0b110101) + chr(2626 - 2574), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1010001 + 0o36) + chr(49) + '\064' + chr(0b10100 + 0o36), 0o10), ehT0Px3KOsy9(chr(372 - 324) + '\157' + chr(49) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + '\060' + '\x36', 20510 - 20502), ehT0Px3KOsy9('\x30' + chr(9462 - 9351) + '\x35' + '\064', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1000110 + 0o51) + '\063' + '\067' + chr(1358 - 1306), 0b1000), ehT0Px3KOsy9(chr(894 - 846) + '\157' + '\x32' + '\062' + chr(52), 0b1000), ehT0Px3KOsy9(chr(2157 - 2109) + '\x6f' + chr(623 - 573) + chr(1891 - 1837) + chr(0b11000 + 0o33), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(597 - 486) + chr(52) + chr(0b1101 + 0o52), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(55) + chr(0b11011 + 0o32), 51246 - 51238), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1101111) + chr(53) + '\067', 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b1101111) + chr(0b110001) + '\x33' + '\061', 36992 - 36984), ehT0Px3KOsy9(chr(2290 - 2242) + '\x6f' + chr(50) + '\x31' + chr(1141 - 1087), 34355 - 34347), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(0b101001 + 0o15), 0o10), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + '\x32' + chr(0b101000 + 0o17) + chr(2286 - 2234), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(110 - 57) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11 + 0o57), 0o10), ehT0Px3KOsy9('\060' + chr(725 - 614) + chr(462 - 414), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100 + 0o143) + chr(0b110010), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(53) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(6987 - 6876) + '\061' + chr(0b10110 + 0o40) + chr(0b101111 + 0o4), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11100 + 0o26) + chr(50) + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(1958 - 1907) + '\x33' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(11007 - 10896) + chr(0b110011) + chr(0b110000) + '\x37', 11763 - 11755), ehT0Px3KOsy9(chr(220 - 172) + chr(3450 - 3339) + '\062' + chr(0b110010) + chr(51), 6471 - 6463), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b110110 + 0o71) + chr(1638 - 1588) + chr(0b110111) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011 + 0o0) + chr(51) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1001000 + 0o47) + chr(0b110101) + chr(1046 - 998), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101100 + 0o3) + chr(2448 - 2394) + chr(48), 19827 - 19819), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + chr(51) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(10825 - 10714) + chr(0b100 + 0o57) + '\x36' + '\061', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\157' + chr(547 - 494) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb5'), chr(1060 - 960) + chr(7539 - 7438) + chr(99) + chr(0b10100 + 0o133) + '\144' + '\x65')(chr(7964 - 7847) + '\x74' + chr(2536 - 2434) + chr(45) + chr(2542 - 2486)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Q8b5UytA0vqH(oVre8I6UXc3b, n8b4ZbtzwxpZ):
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf6\x04\xf9\xf2\x81\xdf\xe9#\x90\xc2\x16R/T'), chr(6612 - 6512) + '\145' + chr(0b11000 + 0o113) + '\x6f' + chr(0b1001011 + 0o31) + chr(0b1100101))('\x75' + chr(116) + chr(102) + chr(45) + chr(0b111000))) == n8b4ZbtzwxpZ:
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\x1e\xf8\xf4\xbb\xc3\xf8'), chr(0b1011001 + 0o13) + chr(101) + '\x63' + chr(1652 - 1541) + chr(0b1100100) + '\x65')('\x75' + chr(4865 - 4749) + chr(102) + chr(1180 - 1135) + chr(0b1001 + 0o57)))
GR1581dR5rDS = n8b4ZbtzwxpZ - oVre8I6UXc3b.cal_start - oVre8I6UXc3b.VRaYxwVeIO1g + ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1683 - 1634), 0o10)
oVre8I6UXc3b.xs6XOz6fvaCq = oVre8I6UXc3b.window.seek(GR1581dR5rDS)
oVre8I6UXc3b.dA0yynOiSMjg = n8b4ZbtzwxpZ
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe3\x18\xbc\xde\x91\xd7\xba&\x83\xcd!|'), chr(0b100001 + 0o103) + '\x65' + chr(99) + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1011111 + 0o26) + chr(11656 - 11540) + chr(0b1100110) + chr(0b100110 + 0o7) + '\070'))
|
quantopian/zipline
|
zipline/data/history_loader.py
|
HistoryLoader._ensure_sliding_windows
|
def _ensure_sliding_windows(self, assets, dts, field,
is_perspective_after):
"""
Ensure that there is a Float64Multiply window for each asset that can
provide data for the given parameters.
If the corresponding window for the (assets, len(dts), field) does not
exist, then create a new one.
If a corresponding window does exist for (assets, len(dts), field), but
can not provide data for the current dts range, then create a new
one and replace the expired window.
Parameters
----------
assets : iterable of Assets
The assets in the window
dts : iterable of datetime64-like
The datetimes for which to fetch data.
Makes an assumption that all dts are present and contiguous,
in the calendar.
field : str
The OHLCV field for which to retrieve data.
is_perspective_after : bool
see: `PricingHistoryLoader.history`
Returns
-------
out : list of Float64Window with sufficient data so that each asset's
window can provide `get` for the index corresponding with the last
value in `dts`
"""
end = dts[-1]
size = len(dts)
asset_windows = {}
needed_assets = []
cal = self._calendar
assets = self._asset_finder.retrieve_all(assets)
end_ix = find_in_sorted_index(cal, end)
for asset in assets:
try:
window = self._window_blocks[field].get(
(asset, size, is_perspective_after), end)
except KeyError:
needed_assets.append(asset)
else:
if end_ix < window.most_recent_ix:
# Window needs reset. Requested end index occurs before the
# end index from the previous history call for this window.
# Grab new window instead of rewinding adjustments.
needed_assets.append(asset)
else:
asset_windows[asset] = window
if needed_assets:
offset = 0
start_ix = find_in_sorted_index(cal, dts[0])
prefetch_end_ix = min(end_ix + self._prefetch_length, len(cal) - 1)
prefetch_end = cal[prefetch_end_ix]
prefetch_dts = cal[start_ix:prefetch_end_ix + 1]
if is_perspective_after:
adj_end_ix = min(prefetch_end_ix + 1, len(cal) - 1)
adj_dts = cal[start_ix:adj_end_ix + 1]
else:
adj_dts = prefetch_dts
prefetch_len = len(prefetch_dts)
array = self._array(prefetch_dts, needed_assets, field)
if field == 'sid':
window_type = Int64Window
else:
window_type = Float64Window
view_kwargs = {}
if field == 'volume':
array = array.astype(float64_dtype)
for i, asset in enumerate(needed_assets):
adj_reader = None
try:
adj_reader = self._adjustment_readers[type(asset)]
except KeyError:
adj_reader = None
if adj_reader is not None:
adjs = adj_reader.load_pricing_adjustments(
[field], adj_dts, [asset])[0]
else:
adjs = {}
window = window_type(
array[:, i].reshape(prefetch_len, 1),
view_kwargs,
adjs,
offset,
size,
int(is_perspective_after),
self._decimal_places_for_asset(asset, dts[-1]),
)
sliding_window = SlidingWindow(window, size, start_ix, offset)
asset_windows[asset] = sliding_window
self._window_blocks[field].set(
(asset, size, is_perspective_after),
sliding_window,
prefetch_end)
return [asset_windows[asset] for asset in assets]
|
python
|
def _ensure_sliding_windows(self, assets, dts, field,
is_perspective_after):
"""
Ensure that there is a Float64Multiply window for each asset that can
provide data for the given parameters.
If the corresponding window for the (assets, len(dts), field) does not
exist, then create a new one.
If a corresponding window does exist for (assets, len(dts), field), but
can not provide data for the current dts range, then create a new
one and replace the expired window.
Parameters
----------
assets : iterable of Assets
The assets in the window
dts : iterable of datetime64-like
The datetimes for which to fetch data.
Makes an assumption that all dts are present and contiguous,
in the calendar.
field : str
The OHLCV field for which to retrieve data.
is_perspective_after : bool
see: `PricingHistoryLoader.history`
Returns
-------
out : list of Float64Window with sufficient data so that each asset's
window can provide `get` for the index corresponding with the last
value in `dts`
"""
end = dts[-1]
size = len(dts)
asset_windows = {}
needed_assets = []
cal = self._calendar
assets = self._asset_finder.retrieve_all(assets)
end_ix = find_in_sorted_index(cal, end)
for asset in assets:
try:
window = self._window_blocks[field].get(
(asset, size, is_perspective_after), end)
except KeyError:
needed_assets.append(asset)
else:
if end_ix < window.most_recent_ix:
# Window needs reset. Requested end index occurs before the
# end index from the previous history call for this window.
# Grab new window instead of rewinding adjustments.
needed_assets.append(asset)
else:
asset_windows[asset] = window
if needed_assets:
offset = 0
start_ix = find_in_sorted_index(cal, dts[0])
prefetch_end_ix = min(end_ix + self._prefetch_length, len(cal) - 1)
prefetch_end = cal[prefetch_end_ix]
prefetch_dts = cal[start_ix:prefetch_end_ix + 1]
if is_perspective_after:
adj_end_ix = min(prefetch_end_ix + 1, len(cal) - 1)
adj_dts = cal[start_ix:adj_end_ix + 1]
else:
adj_dts = prefetch_dts
prefetch_len = len(prefetch_dts)
array = self._array(prefetch_dts, needed_assets, field)
if field == 'sid':
window_type = Int64Window
else:
window_type = Float64Window
view_kwargs = {}
if field == 'volume':
array = array.astype(float64_dtype)
for i, asset in enumerate(needed_assets):
adj_reader = None
try:
adj_reader = self._adjustment_readers[type(asset)]
except KeyError:
adj_reader = None
if adj_reader is not None:
adjs = adj_reader.load_pricing_adjustments(
[field], adj_dts, [asset])[0]
else:
adjs = {}
window = window_type(
array[:, i].reshape(prefetch_len, 1),
view_kwargs,
adjs,
offset,
size,
int(is_perspective_after),
self._decimal_places_for_asset(asset, dts[-1]),
)
sliding_window = SlidingWindow(window, size, start_ix, offset)
asset_windows[asset] = sliding_window
self._window_blocks[field].set(
(asset, size, is_perspective_after),
sliding_window,
prefetch_end)
return [asset_windows[asset] for asset in assets]
|
[
"def",
"_ensure_sliding_windows",
"(",
"self",
",",
"assets",
",",
"dts",
",",
"field",
",",
"is_perspective_after",
")",
":",
"end",
"=",
"dts",
"[",
"-",
"1",
"]",
"size",
"=",
"len",
"(",
"dts",
")",
"asset_windows",
"=",
"{",
"}",
"needed_assets",
"=",
"[",
"]",
"cal",
"=",
"self",
".",
"_calendar",
"assets",
"=",
"self",
".",
"_asset_finder",
".",
"retrieve_all",
"(",
"assets",
")",
"end_ix",
"=",
"find_in_sorted_index",
"(",
"cal",
",",
"end",
")",
"for",
"asset",
"in",
"assets",
":",
"try",
":",
"window",
"=",
"self",
".",
"_window_blocks",
"[",
"field",
"]",
".",
"get",
"(",
"(",
"asset",
",",
"size",
",",
"is_perspective_after",
")",
",",
"end",
")",
"except",
"KeyError",
":",
"needed_assets",
".",
"append",
"(",
"asset",
")",
"else",
":",
"if",
"end_ix",
"<",
"window",
".",
"most_recent_ix",
":",
"# Window needs reset. Requested end index occurs before the",
"# end index from the previous history call for this window.",
"# Grab new window instead of rewinding adjustments.",
"needed_assets",
".",
"append",
"(",
"asset",
")",
"else",
":",
"asset_windows",
"[",
"asset",
"]",
"=",
"window",
"if",
"needed_assets",
":",
"offset",
"=",
"0",
"start_ix",
"=",
"find_in_sorted_index",
"(",
"cal",
",",
"dts",
"[",
"0",
"]",
")",
"prefetch_end_ix",
"=",
"min",
"(",
"end_ix",
"+",
"self",
".",
"_prefetch_length",
",",
"len",
"(",
"cal",
")",
"-",
"1",
")",
"prefetch_end",
"=",
"cal",
"[",
"prefetch_end_ix",
"]",
"prefetch_dts",
"=",
"cal",
"[",
"start_ix",
":",
"prefetch_end_ix",
"+",
"1",
"]",
"if",
"is_perspective_after",
":",
"adj_end_ix",
"=",
"min",
"(",
"prefetch_end_ix",
"+",
"1",
",",
"len",
"(",
"cal",
")",
"-",
"1",
")",
"adj_dts",
"=",
"cal",
"[",
"start_ix",
":",
"adj_end_ix",
"+",
"1",
"]",
"else",
":",
"adj_dts",
"=",
"prefetch_dts",
"prefetch_len",
"=",
"len",
"(",
"prefetch_dts",
")",
"array",
"=",
"self",
".",
"_array",
"(",
"prefetch_dts",
",",
"needed_assets",
",",
"field",
")",
"if",
"field",
"==",
"'sid'",
":",
"window_type",
"=",
"Int64Window",
"else",
":",
"window_type",
"=",
"Float64Window",
"view_kwargs",
"=",
"{",
"}",
"if",
"field",
"==",
"'volume'",
":",
"array",
"=",
"array",
".",
"astype",
"(",
"float64_dtype",
")",
"for",
"i",
",",
"asset",
"in",
"enumerate",
"(",
"needed_assets",
")",
":",
"adj_reader",
"=",
"None",
"try",
":",
"adj_reader",
"=",
"self",
".",
"_adjustment_readers",
"[",
"type",
"(",
"asset",
")",
"]",
"except",
"KeyError",
":",
"adj_reader",
"=",
"None",
"if",
"adj_reader",
"is",
"not",
"None",
":",
"adjs",
"=",
"adj_reader",
".",
"load_pricing_adjustments",
"(",
"[",
"field",
"]",
",",
"adj_dts",
",",
"[",
"asset",
"]",
")",
"[",
"0",
"]",
"else",
":",
"adjs",
"=",
"{",
"}",
"window",
"=",
"window_type",
"(",
"array",
"[",
":",
",",
"i",
"]",
".",
"reshape",
"(",
"prefetch_len",
",",
"1",
")",
",",
"view_kwargs",
",",
"adjs",
",",
"offset",
",",
"size",
",",
"int",
"(",
"is_perspective_after",
")",
",",
"self",
".",
"_decimal_places_for_asset",
"(",
"asset",
",",
"dts",
"[",
"-",
"1",
"]",
")",
",",
")",
"sliding_window",
"=",
"SlidingWindow",
"(",
"window",
",",
"size",
",",
"start_ix",
",",
"offset",
")",
"asset_windows",
"[",
"asset",
"]",
"=",
"sliding_window",
"self",
".",
"_window_blocks",
"[",
"field",
"]",
".",
"set",
"(",
"(",
"asset",
",",
"size",
",",
"is_perspective_after",
")",
",",
"sliding_window",
",",
"prefetch_end",
")",
"return",
"[",
"asset_windows",
"[",
"asset",
"]",
"for",
"asset",
"in",
"assets",
"]"
] |
Ensure that there is a Float64Multiply window for each asset that can
provide data for the given parameters.
If the corresponding window for the (assets, len(dts), field) does not
exist, then create a new one.
If a corresponding window does exist for (assets, len(dts), field), but
can not provide data for the current dts range, then create a new
one and replace the expired window.
Parameters
----------
assets : iterable of Assets
The assets in the window
dts : iterable of datetime64-like
The datetimes for which to fetch data.
Makes an assumption that all dts are present and contiguous,
in the calendar.
field : str
The OHLCV field for which to retrieve data.
is_perspective_after : bool
see: `PricingHistoryLoader.history`
Returns
-------
out : list of Float64Window with sufficient data so that each asset's
window can provide `get` for the index corresponding with the last
value in `dts`
|
[
"Ensure",
"that",
"there",
"is",
"a",
"Float64Multiply",
"window",
"for",
"each",
"asset",
"that",
"can",
"provide",
"data",
"for",
"the",
"given",
"parameters",
".",
"If",
"the",
"corresponding",
"window",
"for",
"the",
"(",
"assets",
"len",
"(",
"dts",
")",
"field",
")",
"does",
"not",
"exist",
"then",
"create",
"a",
"new",
"one",
".",
"If",
"a",
"corresponding",
"window",
"does",
"exist",
"for",
"(",
"assets",
"len",
"(",
"dts",
")",
"field",
")",
"but",
"can",
"not",
"provide",
"data",
"for",
"the",
"current",
"dts",
"range",
"then",
"create",
"a",
"new",
"one",
"and",
"replace",
"the",
"expired",
"window",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/history_loader.py#L364-L469
|
train
|
Ensures that the window for each asset in assets and dts are not already in the same time range.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,F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XYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\157' + '\061' + '\065' + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + '\065' + chr(2489 - 2439), 20461 - 20453), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(111) + chr(51) + '\060' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + '\061' + chr(54) + chr(54), 0b1000), ehT0Px3KOsy9(chr(1157 - 1109) + '\x6f' + '\x32' + chr(0b100001 + 0o25) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110110) + '\x32', 55012 - 55004), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10111 + 0o32) + chr(0b110011) + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(296 - 247) + chr(1224 - 1171), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b101011 + 0o104) + chr(2007 - 1956) + '\065' + chr(53), 9065 - 9057), ehT0Px3KOsy9(chr(48) + chr(0b1000011 + 0o54) + chr(51) + chr(0b10010 + 0o43) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(272 - 224) + chr(0b111111 + 0o60) + chr(0b110001 + 0o1) + '\x33' + chr(725 - 670), 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1010000 + 0o37) + '\063' + chr(0b110100) + '\x36', 59834 - 59826), ehT0Px3KOsy9('\x30' + chr(0b101011 + 0o104) + '\063' + '\063' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(584 - 536) + chr(1377 - 1266) + '\x32' + chr(53) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(1350 - 1302) + chr(0b101000 + 0o107) + chr(0b110110) + chr(55), 5576 - 5568), ehT0Px3KOsy9(chr(510 - 462) + chr(0b1101111) + chr(749 - 700) + chr(0b101110 + 0o10) + '\x31', 17739 - 17731), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(11808 - 11697) + chr(0b101001 + 0o11) + '\x30' + chr(0b1011 + 0o50), 35878 - 35870), ehT0Px3KOsy9(chr(1123 - 1075) + chr(111) + chr(0b110011) + chr(0b110110) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(1320 - 1272) + '\x6f' + '\x31' + '\x35' + chr(1496 - 1441), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(10302 - 10191) + chr(50) + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1000100 + 0o53) + chr(2202 - 2151) + '\x30', 28847 - 28839), ehT0Px3KOsy9(chr(1157 - 1109) + '\157' + chr(0b11110 + 0o24) + chr(1341 - 1293) + chr(49), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110110) + chr(54), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b0 + 0o62) + '\062' + chr(0b101110 + 0o5), 0o10), ehT0Px3KOsy9('\x30' + chr(10772 - 10661) + chr(0b110001) + chr(0b1010 + 0o52) + chr(1823 - 1769), 48246 - 48238), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(53) + '\x35', 8), ehT0Px3KOsy9(chr(336 - 288) + '\157' + chr(49) + '\066' + chr(0b11100 + 0o30), 14273 - 14265), ehT0Px3KOsy9('\060' + '\x6f' + chr(272 - 222) + chr(1216 - 1163) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(890 - 839) + chr(2376 - 2321), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101010 + 0o5) + chr(610 - 559) + chr(169 - 121) + chr(0b11011 + 0o27), 20360 - 20352), ehT0Px3KOsy9('\x30' + chr(0b1100101 + 0o12) + chr(2848 - 2793) + '\066', 54398 - 54390), ehT0Px3KOsy9('\x30' + chr(111) + chr(1563 - 1512) + '\065' + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100000 + 0o23) + '\x35' + chr(1498 - 1445), 8), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + chr(51) + chr(0b100011 + 0o20) + chr(0b11 + 0o64), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(2654 - 2601) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1100010 + 0o15) + chr(977 - 926) + chr(0b101100 + 0o7) + '\062', 33935 - 33927), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(11670 - 11559) + '\063' + '\x33' + '\064', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b1 + 0o61) + chr(48) + chr(0b101000 + 0o13), 8), ehT0Px3KOsy9(chr(2143 - 2095) + chr(0b1010101 + 0o32) + chr(0b110101) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + chr(0b110010) + '\x33' + chr(51), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(132 - 21) + chr(0b110101) + chr(0b101110 + 0o2), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'G'), chr(0b1100100) + chr(0b1000000 + 0o45) + chr(6235 - 6136) + chr(2828 - 2717) + chr(0b1100100) + chr(9671 - 9570))(chr(0b101100 + 0o111) + chr(0b1010100 + 0o40) + chr(0b100011 + 0o103) + chr(0b100 + 0o51) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def nCNRUxDH1lPK(oVre8I6UXc3b, YGFU3oxACPcg, f5Ww7tOW_bKL, fEcfxx4smAdS, V3rNdMp7u1k7):
whWDZq5_lP01 = f5Ww7tOW_bKL[-ehT0Px3KOsy9('\060' + chr(111) + '\x31', 0o10)]
NLcc3BCJnQka = c2A0yzQpDQB3(f5Ww7tOW_bKL)
bJzzWUMkeLjg = {}
_MNTibGX8llk = []
G3McmHIvFwty = oVre8I6UXc3b._calendar
YGFU3oxACPcg = oVre8I6UXc3b._asset_finder.retrieve_all(YGFU3oxACPcg)
n8b4ZbtzwxpZ = sDv7l56Og5Ml(G3McmHIvFwty, whWDZq5_lP01)
for tKJAwKiE1Zya in YGFU3oxACPcg:
try:
VGVrxFMCQSmZ = oVre8I6UXc3b._window_blocks[fEcfxx4smAdS].get((tKJAwKiE1Zya, NLcc3BCJnQka, V3rNdMp7u1k7), whWDZq5_lP01)
except RQ6CSRrFArYB:
xafqLlk3kkUe(_MNTibGX8llk, xafqLlk3kkUe(SXOLrMavuUCe(b'\x08\xda\xb4\x13\xdeV'), chr(7067 - 6967) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(0b10010 + 0o122) + chr(101))(chr(10035 - 9918) + chr(0b1010101 + 0o37) + '\x66' + chr(0b1100 + 0o41) + chr(0b111000)))(tKJAwKiE1Zya)
else:
if n8b4ZbtzwxpZ < xafqLlk3kkUe(VGVrxFMCQSmZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\r\xeb\xf4\x0f\xc9\\\x11$\xbe\xa6\xf5\x81'), '\x64' + chr(0b10100 + 0o121) + chr(0b1100011) + chr(111) + '\x64' + chr(0b1001110 + 0o27))(chr(0b1011100 + 0o31) + '\x74' + chr(0b1100110) + chr(0b101101) + chr(56))):
xafqLlk3kkUe(_MNTibGX8llk, xafqLlk3kkUe(SXOLrMavuUCe(b'\x08\xda\xb4\x13\xdeV'), chr(0b1011001 + 0o13) + '\145' + '\x63' + chr(0b1101111) + chr(0b1011010 + 0o12) + '\145')('\165' + chr(116) + chr(0b1100110) + '\055' + chr(56)))(tKJAwKiE1Zya)
else:
bJzzWUMkeLjg[tKJAwKiE1Zya] = VGVrxFMCQSmZ
if _MNTibGX8llk:
VRaYxwVeIO1g = ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + chr(85 - 37), ord("\x08"))
MyWq51Oq33ym = sDv7l56Og5Ml(G3McmHIvFwty, f5Ww7tOW_bKL[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b111 + 0o51), 8)])
cXNUXKBoYSmP = Dx22bkKPdt5d(n8b4ZbtzwxpZ + oVre8I6UXc3b._prefetch_length, c2A0yzQpDQB3(G3McmHIvFwty) - ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1133 - 1084), 8))
kJRVdJGTlkfg = G3McmHIvFwty[cXNUXKBoYSmP]
cdHs2absw40X = G3McmHIvFwty[MyWq51Oq33ym:cXNUXKBoYSmP + ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49), 8)]
if V3rNdMp7u1k7:
tKH7KH0m3lRf = Dx22bkKPdt5d(cXNUXKBoYSmP + ehT0Px3KOsy9(chr(48) + '\157' + '\061', 8), c2A0yzQpDQB3(G3McmHIvFwty) - ehT0Px3KOsy9('\060' + chr(10121 - 10010) + '\x31', 8))
b5FyGyhL26q0 = G3McmHIvFwty[MyWq51Oq33ym:tKH7KH0m3lRf + ehT0Px3KOsy9('\x30' + '\157' + '\x31', 8)]
else:
b5FyGyhL26q0 = cdHs2absw40X
VWxzZSewHIrL = c2A0yzQpDQB3(cdHs2absw40X)
B0ePDhpqxN5n = oVre8I6UXc3b._array(cdHs2absw40X, _MNTibGX8llk, fEcfxx4smAdS)
if fEcfxx4smAdS == xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a\xc3\xa0'), '\144' + chr(101) + '\x63' + chr(0b1101111) + chr(100) + chr(0b1011010 + 0o13))(chr(117) + chr(0b1110100) + chr(102) + '\x2d' + chr(56)):
DSsEIfxD8vQ_ = w2ZzK5GK2hWs
else:
DSsEIfxD8vQ_ = wDHLwWBQSmSe
ZmUBPEiMJnmQ = {}
if fEcfxx4smAdS == xafqLlk3kkUe(SXOLrMavuUCe(b'\x1f\xc5\xa8\x03\xddW'), chr(0b1100100) + chr(101) + chr(0b110001 + 0o62) + chr(9824 - 9713) + chr(0b1011001 + 0o13) + chr(101))(chr(117) + chr(8614 - 8498) + '\146' + '\055' + chr(1162 - 1106)):
B0ePDhpqxN5n = B0ePDhpqxN5n.astype(rZ1BN3UDHnco)
for (WVxHKyX45z_L, tKJAwKiE1Zya) in YlkZvXL8qwsX(_MNTibGX8llk):
imgPxlqIUUCM = None
try:
imgPxlqIUUCM = oVre8I6UXc3b._adjustment_readers[wmQmyeWBmUpv(tKJAwKiE1Zya)]
except RQ6CSRrFArYB:
imgPxlqIUUCM = None
if imgPxlqIUUCM is not None:
mzFGmhQPS7zS = imgPxlqIUUCM.load_pricing_adjustments([fEcfxx4smAdS], b5FyGyhL26q0, [tKJAwKiE1Zya])[ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\x6f' + '\x30', 8)]
else:
mzFGmhQPS7zS = {}
VGVrxFMCQSmZ = DSsEIfxD8vQ_(B0ePDhpqxN5n[:, WVxHKyX45z_L].reshape(VWxzZSewHIrL, ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b11010 + 0o125) + chr(49), 8)), ZmUBPEiMJnmQ, mzFGmhQPS7zS, VRaYxwVeIO1g, NLcc3BCJnQka, ehT0Px3KOsy9(V3rNdMp7u1k7), oVre8I6UXc3b._decimal_places_for_asset(tKJAwKiE1Zya, f5Ww7tOW_bKL[-ehT0Px3KOsy9(chr(193 - 145) + chr(0b1101100 + 0o3) + chr(0b11010 + 0o27), 8)]))
hW_aAEg2x8wI = caCsJ8PF6Ft3(VGVrxFMCQSmZ, NLcc3BCJnQka, MyWq51Oq33ym, VRaYxwVeIO1g)
bJzzWUMkeLjg[tKJAwKiE1Zya] = hW_aAEg2x8wI
xafqLlk3kkUe(oVre8I6UXc3b._window_blocks[fEcfxx4smAdS], xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a\xcf\xb0'), '\x64' + chr(101) + '\143' + chr(111) + chr(5628 - 5528) + chr(101))(chr(9493 - 9376) + chr(0b1000001 + 0o63) + chr(0b1100110) + chr(0b101101) + chr(0b111000)))((tKJAwKiE1Zya, NLcc3BCJnQka, V3rNdMp7u1k7), hW_aAEg2x8wI, kJRVdJGTlkfg)
return [bJzzWUMkeLjg[tKJAwKiE1Zya] for tKJAwKiE1Zya in YGFU3oxACPcg]
|
quantopian/zipline
|
zipline/data/history_loader.py
|
HistoryLoader.history
|
def history(self, assets, dts, field, is_perspective_after):
"""
A window of pricing data with adjustments applied assuming that the
end of the window is the day before the current simulation time.
Parameters
----------
assets : iterable of Assets
The assets in the window.
dts : iterable of datetime64-like
The datetimes for which to fetch data.
Makes an assumption that all dts are present and contiguous,
in the calendar.
field : str
The OHLCV field for which to retrieve data.
is_perspective_after : bool
True, if the window is being viewed immediately after the last dt
in the sliding window.
False, if the window is viewed on the last dt.
This flag is used for handling the case where the last dt in the
requested window immediately precedes a corporate action, e.g.:
- is_perspective_after is True
When the viewpoint is after the last dt in the window, as when a
daily history window is accessed from a simulation that uses a
minute data frequency, the history call to this loader will not
include the current simulation dt. At that point in time, the raw
data for the last day in the window will require adjustment, so the
most recent adjustment with respect to the simulation time is
applied to the last dt in the requested window.
An example equity which has a 0.5 split ratio dated for 05-27,
with the dts for a history call of 5 bars with a '1d' frequency at
05-27 9:31. Simulation frequency is 'minute'.
(In this case this function is called with 4 daily dts, and the
calling function is responsible for stitching back on the
'current' dt)
| | | | | last dt | <-- viewer is here |
| | 05-23 | 05-24 | 05-25 | 05-26 | 05-27 9:31 |
| raw | 10.10 | 10.20 | 10.30 | 10.40 | |
| adj | 5.05 | 5.10 | 5.15 | 5.25 | |
The adjustment is applied to the last dt, 05-26, and all previous
dts.
- is_perspective_after is False, daily
When the viewpoint is the same point in time as the last dt in the
window, as when a daily history window is accessed from a
simulation that uses a daily data frequency, the history call will
include the current dt. At that point in time, the raw data for the
last day in the window will be post-adjustment, so no adjustment
is applied to the last dt.
An example equity which has a 0.5 split ratio dated for 05-27,
with the dts for a history call of 5 bars with a '1d' frequency at
05-27 0:00. Simulation frequency is 'daily'.
| | | | | | <-- viewer is here |
| | | | | | last dt |
| | 05-23 | 05-24 | 05-25 | 05-26 | 05-27 |
| raw | 10.10 | 10.20 | 10.30 | 10.40 | 5.25 |
| adj | 5.05 | 5.10 | 5.15 | 5.20 | 5.25 |
Adjustments are applied 05-23 through 05-26 but not to the last dt,
05-27
Returns
-------
out : np.ndarray with shape(len(days between start, end), len(assets))
"""
block = self._ensure_sliding_windows(assets,
dts,
field,
is_perspective_after)
end_ix = self._calendar.searchsorted(dts[-1])
return concatenate(
[window.get(end_ix) for window in block],
axis=1,
)
|
python
|
def history(self, assets, dts, field, is_perspective_after):
"""
A window of pricing data with adjustments applied assuming that the
end of the window is the day before the current simulation time.
Parameters
----------
assets : iterable of Assets
The assets in the window.
dts : iterable of datetime64-like
The datetimes for which to fetch data.
Makes an assumption that all dts are present and contiguous,
in the calendar.
field : str
The OHLCV field for which to retrieve data.
is_perspective_after : bool
True, if the window is being viewed immediately after the last dt
in the sliding window.
False, if the window is viewed on the last dt.
This flag is used for handling the case where the last dt in the
requested window immediately precedes a corporate action, e.g.:
- is_perspective_after is True
When the viewpoint is after the last dt in the window, as when a
daily history window is accessed from a simulation that uses a
minute data frequency, the history call to this loader will not
include the current simulation dt. At that point in time, the raw
data for the last day in the window will require adjustment, so the
most recent adjustment with respect to the simulation time is
applied to the last dt in the requested window.
An example equity which has a 0.5 split ratio dated for 05-27,
with the dts for a history call of 5 bars with a '1d' frequency at
05-27 9:31. Simulation frequency is 'minute'.
(In this case this function is called with 4 daily dts, and the
calling function is responsible for stitching back on the
'current' dt)
| | | | | last dt | <-- viewer is here |
| | 05-23 | 05-24 | 05-25 | 05-26 | 05-27 9:31 |
| raw | 10.10 | 10.20 | 10.30 | 10.40 | |
| adj | 5.05 | 5.10 | 5.15 | 5.25 | |
The adjustment is applied to the last dt, 05-26, and all previous
dts.
- is_perspective_after is False, daily
When the viewpoint is the same point in time as the last dt in the
window, as when a daily history window is accessed from a
simulation that uses a daily data frequency, the history call will
include the current dt. At that point in time, the raw data for the
last day in the window will be post-adjustment, so no adjustment
is applied to the last dt.
An example equity which has a 0.5 split ratio dated for 05-27,
with the dts for a history call of 5 bars with a '1d' frequency at
05-27 0:00. Simulation frequency is 'daily'.
| | | | | | <-- viewer is here |
| | | | | | last dt |
| | 05-23 | 05-24 | 05-25 | 05-26 | 05-27 |
| raw | 10.10 | 10.20 | 10.30 | 10.40 | 5.25 |
| adj | 5.05 | 5.10 | 5.15 | 5.20 | 5.25 |
Adjustments are applied 05-23 through 05-26 but not to the last dt,
05-27
Returns
-------
out : np.ndarray with shape(len(days between start, end), len(assets))
"""
block = self._ensure_sliding_windows(assets,
dts,
field,
is_perspective_after)
end_ix = self._calendar.searchsorted(dts[-1])
return concatenate(
[window.get(end_ix) for window in block],
axis=1,
)
|
[
"def",
"history",
"(",
"self",
",",
"assets",
",",
"dts",
",",
"field",
",",
"is_perspective_after",
")",
":",
"block",
"=",
"self",
".",
"_ensure_sliding_windows",
"(",
"assets",
",",
"dts",
",",
"field",
",",
"is_perspective_after",
")",
"end_ix",
"=",
"self",
".",
"_calendar",
".",
"searchsorted",
"(",
"dts",
"[",
"-",
"1",
"]",
")",
"return",
"concatenate",
"(",
"[",
"window",
".",
"get",
"(",
"end_ix",
")",
"for",
"window",
"in",
"block",
"]",
",",
"axis",
"=",
"1",
",",
")"
] |
A window of pricing data with adjustments applied assuming that the
end of the window is the day before the current simulation time.
Parameters
----------
assets : iterable of Assets
The assets in the window.
dts : iterable of datetime64-like
The datetimes for which to fetch data.
Makes an assumption that all dts are present and contiguous,
in the calendar.
field : str
The OHLCV field for which to retrieve data.
is_perspective_after : bool
True, if the window is being viewed immediately after the last dt
in the sliding window.
False, if the window is viewed on the last dt.
This flag is used for handling the case where the last dt in the
requested window immediately precedes a corporate action, e.g.:
- is_perspective_after is True
When the viewpoint is after the last dt in the window, as when a
daily history window is accessed from a simulation that uses a
minute data frequency, the history call to this loader will not
include the current simulation dt. At that point in time, the raw
data for the last day in the window will require adjustment, so the
most recent adjustment with respect to the simulation time is
applied to the last dt in the requested window.
An example equity which has a 0.5 split ratio dated for 05-27,
with the dts for a history call of 5 bars with a '1d' frequency at
05-27 9:31. Simulation frequency is 'minute'.
(In this case this function is called with 4 daily dts, and the
calling function is responsible for stitching back on the
'current' dt)
| | | | | last dt | <-- viewer is here |
| | 05-23 | 05-24 | 05-25 | 05-26 | 05-27 9:31 |
| raw | 10.10 | 10.20 | 10.30 | 10.40 | |
| adj | 5.05 | 5.10 | 5.15 | 5.25 | |
The adjustment is applied to the last dt, 05-26, and all previous
dts.
- is_perspective_after is False, daily
When the viewpoint is the same point in time as the last dt in the
window, as when a daily history window is accessed from a
simulation that uses a daily data frequency, the history call will
include the current dt. At that point in time, the raw data for the
last day in the window will be post-adjustment, so no adjustment
is applied to the last dt.
An example equity which has a 0.5 split ratio dated for 05-27,
with the dts for a history call of 5 bars with a '1d' frequency at
05-27 0:00. Simulation frequency is 'daily'.
| | | | | | <-- viewer is here |
| | | | | | last dt |
| | 05-23 | 05-24 | 05-25 | 05-26 | 05-27 |
| raw | 10.10 | 10.20 | 10.30 | 10.40 | 5.25 |
| adj | 5.05 | 5.10 | 5.15 | 5.20 | 5.25 |
Adjustments are applied 05-23 through 05-26 but not to the last dt,
05-27
Returns
-------
out : np.ndarray with shape(len(days between start, end), len(assets))
|
[
"A",
"window",
"of",
"pricing",
"data",
"with",
"adjustments",
"applied",
"assuming",
"that",
"the",
"end",
"of",
"the",
"window",
"is",
"the",
"day",
"before",
"the",
"current",
"simulation",
"time",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/history_loader.py#L471-L555
|
train
|
This function returns the history of the specified assets and dts.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,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IVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(6928 - 6817) + '\x33' + '\x30' + chr(0b100011 + 0o21), 0o10), ehT0Px3KOsy9('\x30' + chr(7676 - 7565) + chr(50) + '\061' + chr(1251 - 1197), 5559 - 5551), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011010 + 0o25) + '\x35' + chr(52), 0b1000), ehT0Px3KOsy9(chr(1720 - 1672) + chr(0b1101111) + chr(51) + chr(54), 63286 - 63278), ehT0Px3KOsy9('\x30' + chr(7328 - 7217) + '\063' + '\066' + chr(0b101110 + 0o10), 22909 - 22901), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + '\x31' + '\x34' + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b100101 + 0o112) + chr(0b1001 + 0o50) + '\062' + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + '\x37' + '\066', 10663 - 10655), ehT0Px3KOsy9(chr(48) + chr(7990 - 7879) + chr(0b100000 + 0o22) + chr(0b11100 + 0o27) + chr(2369 - 2319), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1001 + 0o146) + chr(0b110010) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1101111) + chr(50) + chr(0b110110) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(53), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101001 + 0o6) + chr(0b110011) + '\x30' + chr(730 - 676), ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(4979 - 4868) + chr(1378 - 1323) + chr(796 - 742), 7094 - 7086), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(49), 53111 - 53103), ehT0Px3KOsy9(chr(1806 - 1758) + chr(111) + '\x31' + chr(0b110100) + chr(55), 8), ehT0Px3KOsy9(chr(70 - 22) + chr(3531 - 3420) + chr(178 - 127) + chr(1741 - 1688) + chr(1975 - 1924), 37108 - 37100), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(2047 - 1936) + chr(796 - 747) + '\x37' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101101 + 0o2) + chr(0b100110 + 0o15) + chr(1581 - 1530) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100111 + 0o13) + chr(0b110000) + chr(374 - 326), 15915 - 15907), ehT0Px3KOsy9('\060' + chr(0b110011 + 0o74) + '\067' + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(11063 - 10952) + chr(0b10000 + 0o43) + '\063' + '\063', 49239 - 49231), ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(0b110010) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + chr(315 - 265) + '\064' + '\060', 26776 - 26768), ehT0Px3KOsy9(chr(1820 - 1772) + '\x6f' + chr(0b110010) + chr(2912 - 2858) + chr(0b110000 + 0o1), 59210 - 59202), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(54) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(1821 - 1773) + chr(0b11 + 0o154) + chr(0b1000 + 0o53) + '\x30' + chr(0b100110 + 0o20), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + '\066' + chr(55), 59935 - 59927), ehT0Px3KOsy9(chr(1671 - 1623) + chr(0b1010111 + 0o30) + chr(0b110010) + chr(0b100 + 0o60), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(0b11011 + 0o31) + chr(0b110110), 64005 - 63997), ehT0Px3KOsy9(chr(48) + chr(846 - 735) + chr(0b110010) + chr(53) + chr(1629 - 1577), 0o10), ehT0Px3KOsy9('\x30' + chr(6975 - 6864) + chr(52) + '\064', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(618 - 568) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(111) + chr(49) + chr(1373 - 1318) + chr(0b1000 + 0o55), 0o10), ehT0Px3KOsy9('\x30' + chr(0b111010 + 0o65) + '\063' + chr(0b110011) + '\063', 8), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1000101 + 0o52) + chr(49) + chr(1529 - 1474) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(1157 - 1109) + chr(111) + chr(1984 - 1933) + chr(0b110001 + 0o1) + chr(0b100111 + 0o17), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1263 - 1212) + chr(53) + chr(1706 - 1651), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6932 - 6821) + '\061' + chr(0b100 + 0o63) + chr(0b110001), 8), ehT0Px3KOsy9(chr(1154 - 1106) + '\x6f' + chr(50) + chr(2338 - 2286) + '\062', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(53) + chr(0b1111 + 0o41), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xea'), '\x64' + '\145' + chr(876 - 777) + '\x6f' + chr(0b101011 + 0o71) + '\x65')('\165' + chr(116) + '\x66' + '\x2d' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def sD1K7SLfPnDB(oVre8I6UXc3b, YGFU3oxACPcg, f5Ww7tOW_bKL, fEcfxx4smAdS, V3rNdMp7u1k7):
cid3MTmW5yAA = oVre8I6UXc3b._ensure_sliding_windows(YGFU3oxACPcg, f5Ww7tOW_bKL, fEcfxx4smAdS, V3rNdMp7u1k7)
n8b4ZbtzwxpZ = oVre8I6UXc3b._calendar.searchsorted(f5Ww7tOW_bKL[-ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(10892 - 10781) + chr(570 - 521), ord("\x08"))])
return Fk2B73DcleMI([xafqLlk3kkUe(VGVrxFMCQSmZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3\xebX'), chr(6309 - 6209) + chr(101) + chr(0b11 + 0o140) + chr(0b1101111) + chr(0b1100100) + chr(8196 - 8095))(chr(117) + chr(116) + chr(0b11001 + 0o115) + '\055' + chr(0b111000)))(n8b4ZbtzwxpZ) for VGVrxFMCQSmZ in cid3MTmW5yAA], axis=ehT0Px3KOsy9('\060' + chr(6781 - 6670) + chr(1658 - 1609), 8))
|
quantopian/zipline
|
zipline/sources/requests_csv.py
|
PandasCSV.parse_date_str_series
|
def parse_date_str_series(format_str, tz, date_str_series, data_frequency,
trading_day):
"""
Efficient parsing for a 1d Pandas/numpy object containing string
representations of dates.
Note: pd.to_datetime is significantly faster when no format string is
passed, and in pandas 0.12.0 the %p strptime directive is not correctly
handled if a format string is explicitly passed, but AM/PM is handled
properly if format=None.
Moreover, we were previously ignoring this parameter unintentionally
because we were incorrectly passing it as a positional. For all these
reasons, we ignore the format_str parameter when parsing datetimes.
"""
# Explicitly ignoring this parameter. See note above.
if format_str is not None:
logger.warn(
"The 'format_str' parameter to fetch_csv is deprecated. "
"Ignoring and defaulting to pandas default date parsing."
)
format_str = None
tz_str = str(tz)
if tz_str == pytz.utc.zone:
parsed = pd.to_datetime(
date_str_series.values,
format=format_str,
utc=True,
errors='coerce',
)
else:
parsed = pd.to_datetime(
date_str_series.values,
format=format_str,
errors='coerce',
).tz_localize(tz_str).tz_convert('UTC')
if data_frequency == 'daily':
parsed = roll_dts_to_midnight(parsed, trading_day)
return parsed
|
python
|
def parse_date_str_series(format_str, tz, date_str_series, data_frequency,
trading_day):
"""
Efficient parsing for a 1d Pandas/numpy object containing string
representations of dates.
Note: pd.to_datetime is significantly faster when no format string is
passed, and in pandas 0.12.0 the %p strptime directive is not correctly
handled if a format string is explicitly passed, but AM/PM is handled
properly if format=None.
Moreover, we were previously ignoring this parameter unintentionally
because we were incorrectly passing it as a positional. For all these
reasons, we ignore the format_str parameter when parsing datetimes.
"""
# Explicitly ignoring this parameter. See note above.
if format_str is not None:
logger.warn(
"The 'format_str' parameter to fetch_csv is deprecated. "
"Ignoring and defaulting to pandas default date parsing."
)
format_str = None
tz_str = str(tz)
if tz_str == pytz.utc.zone:
parsed = pd.to_datetime(
date_str_series.values,
format=format_str,
utc=True,
errors='coerce',
)
else:
parsed = pd.to_datetime(
date_str_series.values,
format=format_str,
errors='coerce',
).tz_localize(tz_str).tz_convert('UTC')
if data_frequency == 'daily':
parsed = roll_dts_to_midnight(parsed, trading_day)
return parsed
|
[
"def",
"parse_date_str_series",
"(",
"format_str",
",",
"tz",
",",
"date_str_series",
",",
"data_frequency",
",",
"trading_day",
")",
":",
"# Explicitly ignoring this parameter. See note above.",
"if",
"format_str",
"is",
"not",
"None",
":",
"logger",
".",
"warn",
"(",
"\"The 'format_str' parameter to fetch_csv is deprecated. \"",
"\"Ignoring and defaulting to pandas default date parsing.\"",
")",
"format_str",
"=",
"None",
"tz_str",
"=",
"str",
"(",
"tz",
")",
"if",
"tz_str",
"==",
"pytz",
".",
"utc",
".",
"zone",
":",
"parsed",
"=",
"pd",
".",
"to_datetime",
"(",
"date_str_series",
".",
"values",
",",
"format",
"=",
"format_str",
",",
"utc",
"=",
"True",
",",
"errors",
"=",
"'coerce'",
",",
")",
"else",
":",
"parsed",
"=",
"pd",
".",
"to_datetime",
"(",
"date_str_series",
".",
"values",
",",
"format",
"=",
"format_str",
",",
"errors",
"=",
"'coerce'",
",",
")",
".",
"tz_localize",
"(",
"tz_str",
")",
".",
"tz_convert",
"(",
"'UTC'",
")",
"if",
"data_frequency",
"==",
"'daily'",
":",
"parsed",
"=",
"roll_dts_to_midnight",
"(",
"parsed",
",",
"trading_day",
")",
"return",
"parsed"
] |
Efficient parsing for a 1d Pandas/numpy object containing string
representations of dates.
Note: pd.to_datetime is significantly faster when no format string is
passed, and in pandas 0.12.0 the %p strptime directive is not correctly
handled if a format string is explicitly passed, but AM/PM is handled
properly if format=None.
Moreover, we were previously ignoring this parameter unintentionally
because we were incorrectly passing it as a positional. For all these
reasons, we ignore the format_str parameter when parsing datetimes.
|
[
"Efficient",
"parsing",
"for",
"a",
"1d",
"Pandas",
"/",
"numpy",
"object",
"containing",
"string",
"representations",
"of",
"dates",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/sources/requests_csv.py#L201-L242
|
train
|
Parse a date string into a Pandas datetime object.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83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S,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1101111) + '\x33' + chr(0b110011) + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011110 + 0o21) + '\061' + chr(0b100000 + 0o21) + '\x35', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1011110 + 0o21) + chr(1796 - 1747) + chr(0b110110) + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2387 - 2337) + chr(0b110000) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\x6f' + chr(53) + '\063', 31401 - 31393), ehT0Px3KOsy9(chr(594 - 546) + chr(3464 - 3353) + chr(0b110010) + chr(52) + chr(53), 1255 - 1247), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000100 + 0o53) + chr(2214 - 2164) + chr(55) + chr(48), 0b1000), ehT0Px3KOsy9(chr(813 - 765) + '\x6f' + '\061' + chr(51) + chr(51), 16041 - 16033), ehT0Px3KOsy9('\x30' + '\157' + chr(55) + chr(138 - 87), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + '\x33' + '\x31', 18613 - 18605), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\067' + chr(0b110101), 48930 - 48922), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + chr(997 - 947) + '\x31' + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101010 + 0o7) + chr(1944 - 1895) + chr(0b110001), 41203 - 41195), ehT0Px3KOsy9('\x30' + chr(0b11111 + 0o120) + chr(0b1110 + 0o43) + chr(2293 - 2243) + '\x37', 0o10), ehT0Px3KOsy9(chr(1427 - 1379) + '\157' + '\062' + '\061' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1001 + 0o51) + '\x35' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(8037 - 7926) + '\061' + chr(0b11111 + 0o26) + '\x36', 7691 - 7683), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + '\063' + chr(2835 - 2781), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + '\060' + chr(54), 0b1000), ehT0Px3KOsy9(chr(1057 - 1009) + chr(0b1101111) + chr(0b10001 + 0o40) + chr(52) + '\067', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b0 + 0o62) + chr(0b110100), 50592 - 50584), ehT0Px3KOsy9(chr(287 - 239) + '\157' + chr(0b1001 + 0o50) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(0b110101 + 0o0) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9503 - 9392) + chr(50) + chr(0b110001) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(0b110011) + chr(1521 - 1471), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b100001 + 0o20) + chr(0b110011), 20860 - 20852), ehT0Px3KOsy9(chr(866 - 818) + chr(0b1101111) + '\x32' + '\064' + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(0b10001 + 0o42) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1752 - 1699) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011001 + 0o26) + chr(0b100010 + 0o20) + chr(140 - 91) + chr(0b110011), 8), ehT0Px3KOsy9(chr(48) + chr(0b1001111 + 0o40) + chr(0b110111) + '\060', 64692 - 64684), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b110100) + chr(0b11000 + 0o34), 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\157' + chr(0b110010) + '\062' + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + chr(8808 - 8697) + chr(0b110101) + chr(751 - 702), ord("\x08")), ehT0Px3KOsy9(chr(2112 - 2064) + '\157' + chr(0b10101 + 0o35) + '\065' + chr(54), 63347 - 63339), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1011 + 0o52), 0o10), ehT0Px3KOsy9(chr(282 - 234) + chr(111) + chr(49) + '\x34' + chr(908 - 860), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(2909 - 2798) + '\061' + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1000000 + 0o57) + chr(232 - 181) + '\061' + chr(50), 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1101111) + chr(51) + chr(586 - 537) + chr(0b110000), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1521 - 1473) + chr(7776 - 7665) + chr(0b101001 + 0o14) + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf4'), chr(0b1100100) + chr(4412 - 4311) + chr(0b1100011) + chr(727 - 616) + chr(0b1100100) + chr(101))(chr(0b1110101) + '\164' + '\x66' + chr(45) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Md4OBePAwRNO(PWMPjRnvCwSO, NnbsN0QovryF, prCwod1exfvX, bXS4MokNqKbm, JTPfmE2HkT2x):
if PWMPjRnvCwSO is not None:
xafqLlk3kkUe(hdK8qOUhR6Or, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb4\t6\xefe\xe7\xd99}\x176\xe6'), chr(0b100001 + 0o103) + chr(0b1100101) + chr(99) + chr(5450 - 5339) + chr(0b1001001 + 0o33) + chr(0b1100101))(chr(0b11100 + 0o131) + chr(116) + '\146' + '\055' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e%\x16\xa1\x0c\xc3\xd7)V8\t\xd4:#\xff\x8eN\xee\xa7\x15ue\x89\xfe\xbf9\x86\xafC\xab^\x01\xe0J\xc6Z\x03z\xbc\xe8\xb3>S\xe5N\xd5\xca>X8\t\xee-y\xad\xe0\t\xf0\xa9\x15}f\x8b\xaa\xbb%\xc2\xfbH\xee^\x05\xe1E\xdal\x0en\xea\xbc\xb5m\x03\xe0E\xc1\xd9(\x1b=\x18\xed("\xe1\xddN\xfa\xa7\x13q(\x9c\xeb\xa88\xcf\xb5K\xa5'), '\x64' + chr(101) + '\x63' + chr(0b1101111) + chr(9805 - 9705) + '\x65')(chr(0b1110101) + chr(716 - 600) + chr(102) + '\055' + chr(0b10001 + 0o47)))
PWMPjRnvCwSO = None
i7vbdNn9INgU = M8_cKLkHVB2V(NnbsN0QovryF)
if i7vbdNn9INgU == xafqLlk3kkUe(NaBq_K_RpLRU.utc, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0"\x1d\xe4'), chr(100) + chr(101) + chr(99) + chr(0b11100 + 0o123) + chr(100) + chr(101))(chr(0b1110101) + chr(0b10101 + 0o137) + chr(4075 - 3973) + chr(0b101101) + '\x38')):
QIe124s5EFAg = dubtF9GfzOdC.to_datetime(prCwod1exfvX.SPnCNu54H1db, format=PWMPjRnvCwSO, utc=ehT0Px3KOsy9('\060' + '\157' + chr(1896 - 1847), 23719 - 23711), errors=xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9"\x16\xf3H\xc0'), '\144' + chr(6054 - 5953) + chr(0b1011111 + 0o4) + chr(0b1101111) + chr(4500 - 4400) + chr(101))('\165' + chr(116) + chr(0b110 + 0o140) + '\x2d' + chr(0b1011 + 0o55)))
else:
QIe124s5EFAg = dubtF9GfzOdC.to_datetime(prCwod1exfvX.values, format=PWMPjRnvCwSO, errors=xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9"\x16\xf3H\xc0'), chr(0b1100100) + '\x65' + '\x63' + '\x6f' + chr(0b1100100) + '\x65')('\x75' + chr(116) + chr(0b1100110) + chr(1975 - 1930) + chr(926 - 870))).tz_localize(i7vbdNn9INgU).tz_convert(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8f\x190'), chr(100) + chr(0b1000010 + 0o43) + '\x63' + chr(0b1101111) + '\144' + '\x65')(chr(0b1110101) + chr(7705 - 7589) + '\x66' + chr(45) + chr(1744 - 1688)))
if bXS4MokNqKbm == xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe,\x1a\xedR'), chr(0b1100100) + chr(0b1100101) + chr(99) + '\157' + chr(100) + chr(0b1100101))(chr(117) + chr(1928 - 1812) + '\x66' + chr(0b1101 + 0o40) + chr(56)):
QIe124s5EFAg = VGh33jbZ4d6d(QIe124s5EFAg, JTPfmE2HkT2x)
return QIe124s5EFAg
|
quantopian/zipline
|
zipline/sources/requests_csv.py
|
PandasCSV._lookup_unconflicted_symbol
|
def _lookup_unconflicted_symbol(self, symbol):
"""
Attempt to find a unique asset whose symbol is the given string.
If multiple assets have held the given symbol, return a 0.
If no asset has held the given symbol, return a NaN.
"""
try:
uppered = symbol.upper()
except AttributeError:
# The mapping fails because symbol was a non-string
return numpy.nan
try:
return self.finder.lookup_symbol(
uppered,
as_of_date=None,
country_code=self.country_code,
)
except MultipleSymbolsFound:
# Fill conflicted entries with zeros to mark that they need to be
# resolved by date.
return 0
except SymbolNotFound:
# Fill not found entries with nans.
return numpy.nan
|
python
|
def _lookup_unconflicted_symbol(self, symbol):
"""
Attempt to find a unique asset whose symbol is the given string.
If multiple assets have held the given symbol, return a 0.
If no asset has held the given symbol, return a NaN.
"""
try:
uppered = symbol.upper()
except AttributeError:
# The mapping fails because symbol was a non-string
return numpy.nan
try:
return self.finder.lookup_symbol(
uppered,
as_of_date=None,
country_code=self.country_code,
)
except MultipleSymbolsFound:
# Fill conflicted entries with zeros to mark that they need to be
# resolved by date.
return 0
except SymbolNotFound:
# Fill not found entries with nans.
return numpy.nan
|
[
"def",
"_lookup_unconflicted_symbol",
"(",
"self",
",",
"symbol",
")",
":",
"try",
":",
"uppered",
"=",
"symbol",
".",
"upper",
"(",
")",
"except",
"AttributeError",
":",
"# The mapping fails because symbol was a non-string",
"return",
"numpy",
".",
"nan",
"try",
":",
"return",
"self",
".",
"finder",
".",
"lookup_symbol",
"(",
"uppered",
",",
"as_of_date",
"=",
"None",
",",
"country_code",
"=",
"self",
".",
"country_code",
",",
")",
"except",
"MultipleSymbolsFound",
":",
"# Fill conflicted entries with zeros to mark that they need to be",
"# resolved by date.",
"return",
"0",
"except",
"SymbolNotFound",
":",
"# Fill not found entries with nans.",
"return",
"numpy",
".",
"nan"
] |
Attempt to find a unique asset whose symbol is the given string.
If multiple assets have held the given symbol, return a 0.
If no asset has held the given symbol, return a NaN.
|
[
"Attempt",
"to",
"find",
"a",
"unique",
"asset",
"whose",
"symbol",
"is",
"the",
"given",
"string",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/sources/requests_csv.py#L262-L288
|
train
|
Attempts to find an unconflicted asset whose symbol is the given string. If multiple assets have held the given symbol return a 0. Otherwise return a NaN.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zsEOh2,LgE_IO_tHXvM,Kk1hd194VKEC,OZYzwAeSQh7N,jFW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O1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1374 - 1326) + chr(0b100100 + 0o113) + chr(0b110010) + chr(2050 - 1995) + chr(994 - 946), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6261 - 6150) + chr(1307 - 1258) + chr(533 - 483) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(12164 - 12053) + chr(0b110001) + chr(49) + chr(0b100011 + 0o22), 59124 - 59116), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(53) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(1501 - 1452) + chr(0b110110) + chr(0b11000 + 0o34), 0o10), ehT0Px3KOsy9(chr(48) + chr(9568 - 9457) + chr(0b110 + 0o54) + '\x34' + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(678 - 624) + chr(0b1111 + 0o42), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(51) + '\061', 2617 - 2609), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(49) + chr(702 - 652), 0b1000), ehT0Px3KOsy9(chr(759 - 711) + chr(0b101011 + 0o104) + '\x33' + chr(2250 - 2201) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + chr(3016 - 2961) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(1000 - 952) + '\x6f' + chr(2030 - 1981) + chr(0b101000 + 0o13) + '\062', 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(5738 - 5627) + chr(0b11111 + 0o23) + '\x35' + '\x37', 54175 - 54167), ehT0Px3KOsy9(chr(1860 - 1812) + '\x6f' + chr(0b10101 + 0o34) + chr(1343 - 1288) + chr(1820 - 1770), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(676 - 625) + chr(0b110111) + chr(0b1010 + 0o53), ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(1528 - 1477) + chr(0b110000) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(479 - 368) + '\066' + chr(49), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(2793 - 2682) + '\x32' + '\x31' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b11011 + 0o124) + chr(0b10011 + 0o40) + '\060' + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(7317 - 7206) + chr(1535 - 1486) + '\x34' + '\062', 0b1000), ehT0Px3KOsy9(chr(1073 - 1025) + chr(0b1010010 + 0o35) + chr(0b101010 + 0o11) + chr(0b11111 + 0o24), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\x35' + chr(1714 - 1665), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1184 - 1134) + chr(52) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2326 - 2276) + chr(0b110110) + '\064', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(1248 - 1194) + '\x30', 15562 - 15554), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(0b100 + 0o62) + chr(1480 - 1428), 8), ehT0Px3KOsy9(chr(1313 - 1265) + '\157' + '\x32' + '\061' + chr(51), 29509 - 29501), ehT0Px3KOsy9(chr(1432 - 1384) + chr(8900 - 8789) + chr(0b110110) + chr(0b100100 + 0o14), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(2203 - 2152) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(0b1010010 + 0o35) + '\066' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b110101) + chr(0b11101 + 0o23), 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + '\x33' + '\067' + chr(0b10101 + 0o34), 0b1000), ehT0Px3KOsy9(chr(1755 - 1707) + chr(0b100 + 0o153) + chr(49) + chr(0b110110) + '\x32', 0o10), ehT0Px3KOsy9(chr(1020 - 972) + chr(111) + chr(0b100110 + 0o13) + chr(52) + chr(0b110 + 0o54), 8), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + '\x32' + chr(0b1100 + 0o44) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b0 + 0o62) + chr(0b110011) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\157' + chr(50) + chr(1928 - 1879) + '\x35', 0b1000), ehT0Px3KOsy9(chr(824 - 776) + '\157' + chr(49) + chr(0b101101 + 0o4) + chr(0b110001), 57552 - 57544), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + '\060' + '\066', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + chr(51), 18349 - 18341)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(10928 - 10817) + chr(53) + '\x30', 12189 - 12181)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x96'), '\144' + '\x65' + chr(9588 - 9489) + chr(0b10010 + 0o135) + chr(0b1011101 + 0o7) + chr(2352 - 2251))('\165' + chr(0b1110100) + chr(7839 - 7737) + chr(1226 - 1181) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def oz0XRcKN7EOT(oVre8I6UXc3b, Usr5ykvL2UZF):
try:
u39hwr6AZS8o = Usr5ykvL2UZF.upper()
except sHOWSIAKtU58:
return xafqLlk3kkUe(n8mpNwkrxOdz, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd64#'), '\144' + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(7511 - 7394) + chr(116) + chr(0b1001110 + 0o30) + '\055' + chr(675 - 619)))
try:
return xafqLlk3kkUe(oVre8I6UXc3b.finder, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd4:"A\x01\xd6\xae\xea\xb3\xa1\\5\xc3'), '\144' + '\x65' + chr(3981 - 3882) + '\157' + chr(100) + chr(0b11001 + 0o114))(chr(12982 - 12865) + chr(0b1110 + 0o146) + chr(102) + '\055' + chr(0b101101 + 0o13)))(u39hwr6AZS8o, as_of_date=None, country_code=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb:8D\x00\xd4\x88\xc6\xa9\xa3Z?'), chr(8037 - 7937) + '\145' + '\x63' + '\x6f' + chr(0b1100100) + '\145')(chr(7764 - 7647) + chr(0b1001010 + 0o52) + chr(8227 - 8125) + chr(0b10001 + 0o34) + chr(0b10101 + 0o43))))
except UmiedeMeSCGH:
return ehT0Px3KOsy9(chr(48) + '\157' + chr(48), 0o10)
except sjzgtDFzIT9g:
return xafqLlk3kkUe(n8mpNwkrxOdz, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd64#'), chr(3132 - 3032) + '\x65' + chr(99) + chr(10498 - 10387) + '\x64' + '\145')('\165' + chr(0b1110100) + '\146' + chr(0b10111 + 0o26) + chr(0b111000)))
|
quantopian/zipline
|
zipline/gens/tradesimulation.py
|
AlgorithmSimulator.transform
|
def transform(self):
"""
Main generator work loop.
"""
algo = self.algo
metrics_tracker = algo.metrics_tracker
emission_rate = metrics_tracker.emission_rate
def every_bar(dt_to_use, current_data=self.current_data,
handle_data=algo.event_manager.handle_data):
for capital_change in calculate_minute_capital_changes(dt_to_use):
yield capital_change
self.simulation_dt = dt_to_use
# called every tick (minute or day).
algo.on_dt_changed(dt_to_use)
blotter = algo.blotter
# handle any transactions and commissions coming out new orders
# placed in the last bar
new_transactions, new_commissions, closed_orders = \
blotter.get_transactions(current_data)
blotter.prune_orders(closed_orders)
for transaction in new_transactions:
metrics_tracker.process_transaction(transaction)
# since this order was modified, record it
order = blotter.orders[transaction.order_id]
metrics_tracker.process_order(order)
for commission in new_commissions:
metrics_tracker.process_commission(commission)
handle_data(algo, current_data, dt_to_use)
# grab any new orders from the blotter, then clear the list.
# this includes cancelled orders.
new_orders = blotter.new_orders
blotter.new_orders = []
# if we have any new orders, record them so that we know
# in what perf period they were placed.
for new_order in new_orders:
metrics_tracker.process_order(new_order)
def once_a_day(midnight_dt, current_data=self.current_data,
data_portal=self.data_portal):
# process any capital changes that came overnight
for capital_change in algo.calculate_capital_changes(
midnight_dt, emission_rate=emission_rate,
is_interday=True):
yield capital_change
# set all the timestamps
self.simulation_dt = midnight_dt
algo.on_dt_changed(midnight_dt)
metrics_tracker.handle_market_open(
midnight_dt,
algo.data_portal,
)
# handle any splits that impact any positions or any open orders.
assets_we_care_about = (
viewkeys(metrics_tracker.positions) |
viewkeys(algo.blotter.open_orders)
)
if assets_we_care_about:
splits = data_portal.get_splits(assets_we_care_about,
midnight_dt)
if splits:
algo.blotter.process_splits(splits)
metrics_tracker.handle_splits(splits)
def on_exit():
# Remove references to algo, data portal, et al to break cycles
# and ensure deterministic cleanup of these objects when the
# simulation finishes.
self.algo = None
self.benchmark_source = self.current_data = self.data_portal = None
with ExitStack() as stack:
stack.callback(on_exit)
stack.enter_context(self.processor)
stack.enter_context(ZiplineAPI(self.algo))
if algo.data_frequency == 'minute':
def execute_order_cancellation_policy():
algo.blotter.execute_cancel_policy(SESSION_END)
def calculate_minute_capital_changes(dt):
# process any capital changes that came between the last
# and current minutes
return algo.calculate_capital_changes(
dt, emission_rate=emission_rate, is_interday=False)
else:
def execute_order_cancellation_policy():
pass
def calculate_minute_capital_changes(dt):
return []
for dt, action in self.clock:
if action == BAR:
for capital_change_packet in every_bar(dt):
yield capital_change_packet
elif action == SESSION_START:
for capital_change_packet in once_a_day(dt):
yield capital_change_packet
elif action == SESSION_END:
# End of the session.
positions = metrics_tracker.positions
position_assets = algo.asset_finder.retrieve_all(positions)
self._cleanup_expired_assets(dt, position_assets)
execute_order_cancellation_policy()
algo.validate_account_controls()
yield self._get_daily_message(dt, algo, metrics_tracker)
elif action == BEFORE_TRADING_START_BAR:
self.simulation_dt = dt
algo.on_dt_changed(dt)
algo.before_trading_start(self.current_data)
elif action == MINUTE_END:
minute_msg = self._get_minute_message(
dt,
algo,
metrics_tracker,
)
yield minute_msg
risk_message = metrics_tracker.handle_simulation_end(
self.data_portal,
)
yield risk_message
|
python
|
def transform(self):
"""
Main generator work loop.
"""
algo = self.algo
metrics_tracker = algo.metrics_tracker
emission_rate = metrics_tracker.emission_rate
def every_bar(dt_to_use, current_data=self.current_data,
handle_data=algo.event_manager.handle_data):
for capital_change in calculate_minute_capital_changes(dt_to_use):
yield capital_change
self.simulation_dt = dt_to_use
# called every tick (minute or day).
algo.on_dt_changed(dt_to_use)
blotter = algo.blotter
# handle any transactions and commissions coming out new orders
# placed in the last bar
new_transactions, new_commissions, closed_orders = \
blotter.get_transactions(current_data)
blotter.prune_orders(closed_orders)
for transaction in new_transactions:
metrics_tracker.process_transaction(transaction)
# since this order was modified, record it
order = blotter.orders[transaction.order_id]
metrics_tracker.process_order(order)
for commission in new_commissions:
metrics_tracker.process_commission(commission)
handle_data(algo, current_data, dt_to_use)
# grab any new orders from the blotter, then clear the list.
# this includes cancelled orders.
new_orders = blotter.new_orders
blotter.new_orders = []
# if we have any new orders, record them so that we know
# in what perf period they were placed.
for new_order in new_orders:
metrics_tracker.process_order(new_order)
def once_a_day(midnight_dt, current_data=self.current_data,
data_portal=self.data_portal):
# process any capital changes that came overnight
for capital_change in algo.calculate_capital_changes(
midnight_dt, emission_rate=emission_rate,
is_interday=True):
yield capital_change
# set all the timestamps
self.simulation_dt = midnight_dt
algo.on_dt_changed(midnight_dt)
metrics_tracker.handle_market_open(
midnight_dt,
algo.data_portal,
)
# handle any splits that impact any positions or any open orders.
assets_we_care_about = (
viewkeys(metrics_tracker.positions) |
viewkeys(algo.blotter.open_orders)
)
if assets_we_care_about:
splits = data_portal.get_splits(assets_we_care_about,
midnight_dt)
if splits:
algo.blotter.process_splits(splits)
metrics_tracker.handle_splits(splits)
def on_exit():
# Remove references to algo, data portal, et al to break cycles
# and ensure deterministic cleanup of these objects when the
# simulation finishes.
self.algo = None
self.benchmark_source = self.current_data = self.data_portal = None
with ExitStack() as stack:
stack.callback(on_exit)
stack.enter_context(self.processor)
stack.enter_context(ZiplineAPI(self.algo))
if algo.data_frequency == 'minute':
def execute_order_cancellation_policy():
algo.blotter.execute_cancel_policy(SESSION_END)
def calculate_minute_capital_changes(dt):
# process any capital changes that came between the last
# and current minutes
return algo.calculate_capital_changes(
dt, emission_rate=emission_rate, is_interday=False)
else:
def execute_order_cancellation_policy():
pass
def calculate_minute_capital_changes(dt):
return []
for dt, action in self.clock:
if action == BAR:
for capital_change_packet in every_bar(dt):
yield capital_change_packet
elif action == SESSION_START:
for capital_change_packet in once_a_day(dt):
yield capital_change_packet
elif action == SESSION_END:
# End of the session.
positions = metrics_tracker.positions
position_assets = algo.asset_finder.retrieve_all(positions)
self._cleanup_expired_assets(dt, position_assets)
execute_order_cancellation_policy()
algo.validate_account_controls()
yield self._get_daily_message(dt, algo, metrics_tracker)
elif action == BEFORE_TRADING_START_BAR:
self.simulation_dt = dt
algo.on_dt_changed(dt)
algo.before_trading_start(self.current_data)
elif action == MINUTE_END:
minute_msg = self._get_minute_message(
dt,
algo,
metrics_tracker,
)
yield minute_msg
risk_message = metrics_tracker.handle_simulation_end(
self.data_portal,
)
yield risk_message
|
[
"def",
"transform",
"(",
"self",
")",
":",
"algo",
"=",
"self",
".",
"algo",
"metrics_tracker",
"=",
"algo",
".",
"metrics_tracker",
"emission_rate",
"=",
"metrics_tracker",
".",
"emission_rate",
"def",
"every_bar",
"(",
"dt_to_use",
",",
"current_data",
"=",
"self",
".",
"current_data",
",",
"handle_data",
"=",
"algo",
".",
"event_manager",
".",
"handle_data",
")",
":",
"for",
"capital_change",
"in",
"calculate_minute_capital_changes",
"(",
"dt_to_use",
")",
":",
"yield",
"capital_change",
"self",
".",
"simulation_dt",
"=",
"dt_to_use",
"# called every tick (minute or day).",
"algo",
".",
"on_dt_changed",
"(",
"dt_to_use",
")",
"blotter",
"=",
"algo",
".",
"blotter",
"# handle any transactions and commissions coming out new orders",
"# placed in the last bar",
"new_transactions",
",",
"new_commissions",
",",
"closed_orders",
"=",
"blotter",
".",
"get_transactions",
"(",
"current_data",
")",
"blotter",
".",
"prune_orders",
"(",
"closed_orders",
")",
"for",
"transaction",
"in",
"new_transactions",
":",
"metrics_tracker",
".",
"process_transaction",
"(",
"transaction",
")",
"# since this order was modified, record it",
"order",
"=",
"blotter",
".",
"orders",
"[",
"transaction",
".",
"order_id",
"]",
"metrics_tracker",
".",
"process_order",
"(",
"order",
")",
"for",
"commission",
"in",
"new_commissions",
":",
"metrics_tracker",
".",
"process_commission",
"(",
"commission",
")",
"handle_data",
"(",
"algo",
",",
"current_data",
",",
"dt_to_use",
")",
"# grab any new orders from the blotter, then clear the list.",
"# this includes cancelled orders.",
"new_orders",
"=",
"blotter",
".",
"new_orders",
"blotter",
".",
"new_orders",
"=",
"[",
"]",
"# if we have any new orders, record them so that we know",
"# in what perf period they were placed.",
"for",
"new_order",
"in",
"new_orders",
":",
"metrics_tracker",
".",
"process_order",
"(",
"new_order",
")",
"def",
"once_a_day",
"(",
"midnight_dt",
",",
"current_data",
"=",
"self",
".",
"current_data",
",",
"data_portal",
"=",
"self",
".",
"data_portal",
")",
":",
"# process any capital changes that came overnight",
"for",
"capital_change",
"in",
"algo",
".",
"calculate_capital_changes",
"(",
"midnight_dt",
",",
"emission_rate",
"=",
"emission_rate",
",",
"is_interday",
"=",
"True",
")",
":",
"yield",
"capital_change",
"# set all the timestamps",
"self",
".",
"simulation_dt",
"=",
"midnight_dt",
"algo",
".",
"on_dt_changed",
"(",
"midnight_dt",
")",
"metrics_tracker",
".",
"handle_market_open",
"(",
"midnight_dt",
",",
"algo",
".",
"data_portal",
",",
")",
"# handle any splits that impact any positions or any open orders.",
"assets_we_care_about",
"=",
"(",
"viewkeys",
"(",
"metrics_tracker",
".",
"positions",
")",
"|",
"viewkeys",
"(",
"algo",
".",
"blotter",
".",
"open_orders",
")",
")",
"if",
"assets_we_care_about",
":",
"splits",
"=",
"data_portal",
".",
"get_splits",
"(",
"assets_we_care_about",
",",
"midnight_dt",
")",
"if",
"splits",
":",
"algo",
".",
"blotter",
".",
"process_splits",
"(",
"splits",
")",
"metrics_tracker",
".",
"handle_splits",
"(",
"splits",
")",
"def",
"on_exit",
"(",
")",
":",
"# Remove references to algo, data portal, et al to break cycles",
"# and ensure deterministic cleanup of these objects when the",
"# simulation finishes.",
"self",
".",
"algo",
"=",
"None",
"self",
".",
"benchmark_source",
"=",
"self",
".",
"current_data",
"=",
"self",
".",
"data_portal",
"=",
"None",
"with",
"ExitStack",
"(",
")",
"as",
"stack",
":",
"stack",
".",
"callback",
"(",
"on_exit",
")",
"stack",
".",
"enter_context",
"(",
"self",
".",
"processor",
")",
"stack",
".",
"enter_context",
"(",
"ZiplineAPI",
"(",
"self",
".",
"algo",
")",
")",
"if",
"algo",
".",
"data_frequency",
"==",
"'minute'",
":",
"def",
"execute_order_cancellation_policy",
"(",
")",
":",
"algo",
".",
"blotter",
".",
"execute_cancel_policy",
"(",
"SESSION_END",
")",
"def",
"calculate_minute_capital_changes",
"(",
"dt",
")",
":",
"# process any capital changes that came between the last",
"# and current minutes",
"return",
"algo",
".",
"calculate_capital_changes",
"(",
"dt",
",",
"emission_rate",
"=",
"emission_rate",
",",
"is_interday",
"=",
"False",
")",
"else",
":",
"def",
"execute_order_cancellation_policy",
"(",
")",
":",
"pass",
"def",
"calculate_minute_capital_changes",
"(",
"dt",
")",
":",
"return",
"[",
"]",
"for",
"dt",
",",
"action",
"in",
"self",
".",
"clock",
":",
"if",
"action",
"==",
"BAR",
":",
"for",
"capital_change_packet",
"in",
"every_bar",
"(",
"dt",
")",
":",
"yield",
"capital_change_packet",
"elif",
"action",
"==",
"SESSION_START",
":",
"for",
"capital_change_packet",
"in",
"once_a_day",
"(",
"dt",
")",
":",
"yield",
"capital_change_packet",
"elif",
"action",
"==",
"SESSION_END",
":",
"# End of the session.",
"positions",
"=",
"metrics_tracker",
".",
"positions",
"position_assets",
"=",
"algo",
".",
"asset_finder",
".",
"retrieve_all",
"(",
"positions",
")",
"self",
".",
"_cleanup_expired_assets",
"(",
"dt",
",",
"position_assets",
")",
"execute_order_cancellation_policy",
"(",
")",
"algo",
".",
"validate_account_controls",
"(",
")",
"yield",
"self",
".",
"_get_daily_message",
"(",
"dt",
",",
"algo",
",",
"metrics_tracker",
")",
"elif",
"action",
"==",
"BEFORE_TRADING_START_BAR",
":",
"self",
".",
"simulation_dt",
"=",
"dt",
"algo",
".",
"on_dt_changed",
"(",
"dt",
")",
"algo",
".",
"before_trading_start",
"(",
"self",
".",
"current_data",
")",
"elif",
"action",
"==",
"MINUTE_END",
":",
"minute_msg",
"=",
"self",
".",
"_get_minute_message",
"(",
"dt",
",",
"algo",
",",
"metrics_tracker",
",",
")",
"yield",
"minute_msg",
"risk_message",
"=",
"metrics_tracker",
".",
"handle_simulation_end",
"(",
"self",
".",
"data_portal",
",",
")",
"yield",
"risk_message"
] |
Main generator work loop.
|
[
"Main",
"generator",
"work",
"loop",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/gens/tradesimulation.py#L97-L236
|
train
|
This method is the main function that handles all of the events that are in the same state as the current state of the object.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0U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m,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(10992 - 10881) + chr(0b100110 + 0o20) + chr(55), 3454 - 3446), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2052 - 2001) + chr(0b110010) + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10011 + 0o36) + chr(49) + chr(0b111 + 0o52), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(4654 - 4543) + chr(0b11 + 0o57) + chr(48) + chr(53), 53239 - 53231), ehT0Px3KOsy9(chr(48) + chr(0b1011111 + 0o20) + '\x35', 24696 - 24688), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + '\061' + '\065', 0b1000), ehT0Px3KOsy9(chr(471 - 423) + chr(7545 - 7434) + chr(0b110010) + chr(1576 - 1524) + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(804 - 754) + chr(320 - 271) + chr(0b110001), 45759 - 45751), ehT0Px3KOsy9(chr(905 - 857) + chr(111) + chr(1583 - 1532) + '\065' + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(0b110111) + chr(0b110000 + 0o6), 0o10), ehT0Px3KOsy9(chr(2077 - 2029) + '\157' + chr(0b10 + 0o61) + chr(0b1110 + 0o47) + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + chr(10403 - 10292) + chr(49) + '\064' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(2058 - 2005) + chr(0b110011 + 0o2), 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\x6f' + chr(0b101101 + 0o12) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(2035 - 1987) + '\x6f' + chr(50) + '\x30', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1067 - 1017) + '\065' + '\x36', 34063 - 34055), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(52) + chr(51), 0b1000), ehT0Px3KOsy9(chr(739 - 691) + chr(0b1101111) + '\x32' + chr(0b110101) + chr(0b101101 + 0o11), 8), ehT0Px3KOsy9(chr(707 - 659) + chr(0b1101111 + 0o0) + chr(0b1001 + 0o56) + chr(48), 24025 - 24017), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(0b1000 + 0o50) + chr(0b11010 + 0o31), ord("\x08")), ehT0Px3KOsy9(chr(1308 - 1260) + '\157' + chr(0b110001) + chr(0b110000 + 0o1) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1101 + 0o44) + '\x35' + chr(0b101010 + 0o13), 0o10), ehT0Px3KOsy9('\060' + chr(3847 - 3736) + chr(1475 - 1424) + chr(53) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(1911 - 1863) + '\x6f' + '\x31' + chr(49) + chr(2004 - 1955), 8), ehT0Px3KOsy9(chr(48) + chr(0b1001101 + 0o42) + '\x31' + chr(0b110000 + 0o5) + chr(0b11110 + 0o26), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6255 - 6144) + chr(0b10 + 0o57) + chr(52) + '\060', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b110101) + chr(691 - 642), ord("\x08")), ehT0Px3KOsy9(chr(751 - 703) + chr(0b1101111) + chr(49) + chr(54), 1841 - 1833), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(78 - 27) + chr(0b11101 + 0o32) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(1415 - 1367) + chr(0b1101111) + chr(2256 - 2205) + chr(701 - 646) + chr(0b110000), 8), ehT0Px3KOsy9(chr(1326 - 1278) + chr(0b1100010 + 0o15) + '\061' + chr(0b110101) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101101 + 0o2) + chr(0b11001 + 0o32) + '\064' + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(52) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(0b110000) + '\x36', 46932 - 46924), ehT0Px3KOsy9(chr(352 - 304) + chr(0b1101111) + '\x33' + chr(55) + chr(0b100001 + 0o26), 4075 - 4067), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(223 - 170) + chr(0b110111), 51485 - 51477), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b101111 + 0o4) + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + '\x33' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b101001 + 0o106) + chr(49) + '\067' + chr(0b100111 + 0o14), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(0b100 + 0o63) + chr(0b1000 + 0o50), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b101110 + 0o101) + '\065' + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x19'), chr(0b1100100) + '\145' + '\x63' + chr(0b1101111) + chr(3108 - 3008) + chr(1018 - 917))(chr(117) + chr(12966 - 12850) + chr(1816 - 1714) + '\x2d' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ASNeIOBhze_M(oVre8I6UXc3b):
TtCVtsNOHTY6 = oVre8I6UXc3b.algo
QcGg0AmYV1Pj = TtCVtsNOHTY6.metrics_tracker
IwO2h7RrLS4_ = QcGg0AmYV1Pj.emission_rate
def oomkBmkmhpSX(kjpWj9qKt98H, p5JjsJjTdtuW=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'T\xa4;\xf7`\xe3\xd6\xd6\x8f\xdf\x9b\x01'), chr(100) + chr(101) + chr(99) + chr(0b1101111) + chr(0b1000101 + 0o37) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(56))), PlnZOTvWE7g0=xafqLlk3kkUe(TtCVtsNOHTY6.event_manager, xafqLlk3kkUe(SXOLrMavuUCe(b"_\xb0'\xe1i\xe8\xfd\xed\x8a\xca\x8e"), chr(100) + chr(0b1100101) + chr(0b11111 + 0o104) + chr(8046 - 7935) + chr(8127 - 8027) + '\x65')(chr(117) + chr(116) + chr(0b1011101 + 0o11) + '\055' + chr(0b101111 + 0o11)))):
for yK5BNckzI4VR in _erc6pLNjnC9(kjpWj9qKt98H):
yield yK5BNckzI4VR
oVre8I6UXc3b.lVhq9g2VevqJ = kjpWj9qKt98H
xafqLlk3kkUe(TtCVtsNOHTY6, xafqLlk3kkUe(SXOLrMavuUCe(b'X\xbf\x16\xe1q\xd2\xc1\xe1\x8a\xd0\x88\x05\xc9'), chr(100) + chr(4156 - 4055) + chr(0b1011 + 0o130) + chr(0b1101111) + chr(5031 - 4931) + '\145')('\x75' + chr(0b110 + 0o156) + chr(0b110111 + 0o57) + '\055' + '\070'))(kjpWj9qKt98H)
WcJlIx2C2pWn = TtCVtsNOHTY6.blotter
(As6UrjeBCuzp, Fpztla57mTbI, befaEaR0h3O0) = WcJlIx2C2pWn.get_transactions(p5JjsJjTdtuW)
xafqLlk3kkUe(WcJlIx2C2pWn, xafqLlk3kkUe(SXOLrMavuUCe(b'G\xa3<\xeb`\xd2\xcd\xfb\x8f\xdb\x9d\x13'), '\x64' + chr(0b11110 + 0o107) + '\x63' + chr(0b1101111) + '\144' + chr(3412 - 3311))('\x75' + chr(0b111111 + 0o65) + '\x66' + '\x2d' + chr(56)))(befaEaR0h3O0)
for CRwf0yognWEF in As6UrjeBCuzp:
xafqLlk3kkUe(QcGg0AmYV1Pj, xafqLlk3kkUe(SXOLrMavuUCe(b'G\xa3&\xe6`\xfe\xd1\xd6\x9f\xcc\x8e\x0e\xde_s\xda\xca\xc1V'), chr(0b1100100) + chr(101) + '\143' + chr(0b1000010 + 0o55) + chr(100) + '\145')(chr(0b1110101) + '\x74' + chr(102) + '\x2d' + chr(2107 - 2051)))(CRwf0yognWEF)
hO2LnONV9lny = WcJlIx2C2pWn.orders[CRwf0yognWEF.order_id]
xafqLlk3kkUe(QcGg0AmYV1Pj, xafqLlk3kkUe(SXOLrMavuUCe(b'G\xa3&\xe6`\xfe\xd1\xd6\x84\xcc\x8b\x05\xdf'), chr(100) + chr(0b1100011 + 0o2) + chr(6202 - 6103) + chr(10205 - 10094) + chr(0b1100100) + chr(8358 - 8257))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + '\070'))(hO2LnONV9lny)
for iBjGdq6ejAax in Fpztla57mTbI:
xafqLlk3kkUe(QcGg0AmYV1Pj, xafqLlk3kkUe(SXOLrMavuUCe(b'G\xa3&\xe6`\xfe\xd1\xd6\x88\xd1\x82\r\xc4Mc\xc7\xcc\xc0'), '\144' + chr(0b1100101) + chr(99) + chr(0b11001 + 0o126) + chr(100) + chr(0b1100101))(chr(0b1101001 + 0o14) + chr(0b1110001 + 0o3) + chr(7922 - 7820) + '\x2d' + '\x38'))(iBjGdq6ejAax)
PlnZOTvWE7g0(TtCVtsNOHTY6, p5JjsJjTdtuW, kjpWj9qKt98H)
ZV_ES7XOWkHZ = WcJlIx2C2pWn.new_orders
WcJlIx2C2pWn.ZV_ES7XOWkHZ = []
for aCkmNPI5Rock in ZV_ES7XOWkHZ:
xafqLlk3kkUe(QcGg0AmYV1Pj, xafqLlk3kkUe(SXOLrMavuUCe(b'G\xa3&\xe6`\xfe\xd1\xd6\x84\xcc\x8b\x05\xdf'), '\x64' + '\145' + '\143' + chr(111) + chr(7716 - 7616) + chr(0b1100101))(chr(117) + chr(116) + '\x66' + chr(0b101101) + chr(56)))(aCkmNPI5Rock)
def FvODMfT7QDoB(eSPQkccFF3eJ, p5JjsJjTdtuW=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'T\xa4;\xf7`\xe3\xd6\xd6\x8f\xdf\x9b\x01'), chr(9269 - 9169) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(9478 - 9378) + '\x65')('\165' + chr(0b11101 + 0o127) + chr(0b1100100 + 0o2) + chr(1803 - 1758) + '\070')), zp1vVg_LFx8b=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'S\xb0=\xe4Z\xfd\xcd\xfb\x9f\xdf\x83'), chr(7976 - 7876) + chr(101) + '\x63' + chr(0b110 + 0o151) + chr(0b111000 + 0o54) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b110011 + 0o63) + '\055' + '\x38'))):
for yK5BNckzI4VR in xafqLlk3kkUe(TtCVtsNOHTY6, xafqLlk3kkUe(SXOLrMavuUCe(b'T\xb0%\xe6p\xe1\xc3\xfd\x8e\xe1\x8c\x01\xddWd\xcf\xcf\xf1[\xeb*\x03\x8a,\x1f'), chr(4551 - 4451) + chr(0b1100101) + '\x63' + chr(111) + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(7570 - 7468) + chr(45) + '\x38'))(eSPQkccFF3eJ, emission_rate=IwO2h7RrLS4_, is_interday=ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1010011 + 0o34) + chr(0b1 + 0o60), 0b1000)):
yield yK5BNckzI4VR
oVre8I6UXc3b.lVhq9g2VevqJ = eSPQkccFF3eJ
xafqLlk3kkUe(TtCVtsNOHTY6, xafqLlk3kkUe(SXOLrMavuUCe(b'X\xbf\x16\xe1q\xd2\xc1\xe1\x8a\xd0\x88\x05\xc9'), chr(0b1011000 + 0o14) + chr(5391 - 5290) + chr(0b1100011) + chr(111) + chr(0b11 + 0o141) + '\x65')(chr(0b101000 + 0o115) + chr(116) + chr(0b1000111 + 0o37) + chr(0b100111 + 0o6) + chr(2275 - 2219)))(eSPQkccFF3eJ)
xafqLlk3kkUe(QcGg0AmYV1Pj, xafqLlk3kkUe(SXOLrMavuUCe(b"_\xb0'\xe1i\xe8\xfd\xe4\x8a\xcc\x84\x05\xd9a\x7f\xde\xc6\xc0"), chr(0b1001001 + 0o33) + chr(101) + chr(4357 - 4258) + '\157' + '\x64' + '\x65')('\x75' + chr(116) + '\x66' + chr(329 - 284) + chr(0b100100 + 0o24)))(eSPQkccFF3eJ, xafqLlk3kkUe(TtCVtsNOHTY6, xafqLlk3kkUe(SXOLrMavuUCe(b'S\xb0=\xe4Z\xfd\xcd\xfb\x9f\xdf\x83'), chr(0b1001110 + 0o26) + chr(1848 - 1747) + '\x63' + '\x6f' + chr(0b1100100) + '\145')(chr(117) + chr(5340 - 5224) + chr(0b1100110) + chr(45) + chr(0b110100 + 0o4))))
ZPP7Iq8rrvwy = ibVce80NjHnP(QcGg0AmYV1Pj.positions) | ibVce80NjHnP(TtCVtsNOHTY6.blotter.open_orders)
if ZPP7Iq8rrvwy:
uSBCRSw0LUmo = zp1vVg_LFx8b.get_splits(ZPP7Iq8rrvwy, eSPQkccFF3eJ)
if uSBCRSw0LUmo:
xafqLlk3kkUe(TtCVtsNOHTY6.blotter, xafqLlk3kkUe(SXOLrMavuUCe(b'G\xa3&\xe6`\xfe\xd1\xd6\x98\xce\x83\t\xd9M'), '\144' + '\145' + chr(0b1100011) + chr(111) + '\144' + chr(0b100001 + 0o104))('\165' + '\164' + chr(0b100010 + 0o104) + '\055' + '\070'))(uSBCRSw0LUmo)
xafqLlk3kkUe(QcGg0AmYV1Pj, xafqLlk3kkUe(SXOLrMavuUCe(b"_\xb0'\xe1i\xe8\xfd\xfa\x9b\xd2\x86\x14\xde"), chr(5717 - 5617) + chr(0b10 + 0o143) + chr(0b1100011) + chr(111) + '\144' + chr(2229 - 2128))('\x75' + '\x74' + chr(0b11111 + 0o107) + chr(0b10100 + 0o31) + chr(56)))(uSBCRSw0LUmo)
def ScFh_1M_HK8R():
oVre8I6UXc3b.TtCVtsNOHTY6 = None
oVre8I6UXc3b.baqKG_85iMMa = oVre8I6UXc3b.p5JjsJjTdtuW = oVre8I6UXc3b.zp1vVg_LFx8b = None
with un5spL6lgqx6() as rFoCQMjVYqWa:
xafqLlk3kkUe(rFoCQMjVYqWa, xafqLlk3kkUe(SXOLrMavuUCe(b'A\x81\x1f\xf3S\xf9\xfa\xbb\xd2\xf4\xb00'), chr(5681 - 5581) + chr(0b1101 + 0o130) + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(116) + '\146' + chr(607 - 562) + '\x38'))(ScFh_1M_HK8R)
xafqLlk3kkUe(rFoCQMjVYqWa, xafqLlk3kkUe(SXOLrMavuUCe(b'R\xbf=\xe0w\xd2\xc1\xe6\x85\xca\x8a\x18\xd9'), chr(0b100111 + 0o75) + chr(0b1011101 + 0o10) + '\143' + chr(111) + chr(0b1100100) + chr(101))(chr(0b1101011 + 0o12) + chr(0b1010001 + 0o43) + '\146' + '\x2d' + chr(56)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'f\xa7\x16\xebu\xfc\xc5\xdb\xa9\xfc\xd8Q'), chr(0b1100100) + '\x65' + chr(0b101001 + 0o72) + '\x6f' + chr(3326 - 3226) + '\x65')(chr(2415 - 2298) + chr(7524 - 7408) + chr(0b10010 + 0o124) + chr(0b10111 + 0o26) + chr(0b110001 + 0o7))))
xafqLlk3kkUe(rFoCQMjVYqWa, xafqLlk3kkUe(SXOLrMavuUCe(b'R\xbf=\xe0w\xd2\xc1\xe6\x85\xca\x8a\x18\xd9'), chr(1614 - 1514) + chr(0b1 + 0o144) + chr(110 - 11) + chr(11168 - 11057) + chr(775 - 675) + chr(101))(chr(5995 - 5878) + chr(0b11100 + 0o130) + chr(3906 - 3804) + chr(1021 - 976) + chr(0b111000)))(iPqH6rwZLRJq(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'c\xa5\n\xd3q\xfe\xec\xc6\xa3\xea\xb6V'), chr(0b1100100) + chr(0b1000100 + 0o41) + '\143' + '\x6f' + chr(0b1001110 + 0o26) + '\x65')(chr(117) + chr(0b1110100) + chr(0b101001 + 0o75) + '\055' + chr(0b111000)))))
if xafqLlk3kkUe(TtCVtsNOHTY6, xafqLlk3kkUe(SXOLrMavuUCe(b'S\xb0=\xe4Z\xeb\xd0\xec\x9a\xcb\x8a\x0e\xceG'), chr(8167 - 8067) + chr(101) + chr(0b100110 + 0o75) + chr(6725 - 6614) + '\x64' + chr(101))(chr(0b1010100 + 0o41) + chr(0b111010 + 0o72) + chr(102) + chr(1707 - 1662) + chr(56))) == xafqLlk3kkUe(SXOLrMavuUCe(b"Z\xb8'\xf0q\xe8"), chr(5860 - 5760) + chr(101) + chr(0b10101 + 0o116) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101 + 0o0))(chr(0b1110101) + '\164' + chr(0b1010101 + 0o21) + chr(0b101101) + chr(0b111000)):
def gFt_hMjUdWYd():
xafqLlk3kkUe(TtCVtsNOHTY6.blotter, xafqLlk3kkUe(SXOLrMavuUCe(b'R\xa9,\xe6p\xf9\xc7\xd6\x88\xdf\x81\x03\xc8RO\xde\xcc\xc2Q\xe02'), chr(100) + chr(101) + chr(0b1100011 + 0o0) + chr(0b1101111) + '\x64' + chr(0b1100101))('\165' + '\164' + chr(102) + chr(0b101101) + chr(56)))(aUQSoy6KgcTT)
def _erc6pLNjnC9(OmU3Un949MWT):
return xafqLlk3kkUe(TtCVtsNOHTY6, xafqLlk3kkUe(SXOLrMavuUCe(b'T\xb0%\xe6p\xe1\xc3\xfd\x8e\xe1\x8c\x01\xddWd\xcf\xcf\xf1[\xeb*\x03\x8a,\x1f'), chr(2772 - 2672) + chr(0b1100101) + '\143' + '\157' + '\144' + chr(5664 - 5563))(chr(8401 - 8284) + chr(116) + '\x66' + chr(0b101101) + chr(1982 - 1926)))(OmU3Un949MWT, emission_rate=IwO2h7RrLS4_, is_interday=ehT0Px3KOsy9('\x30' + '\157' + chr(0b11 + 0o55), 0o10))
else:
def gFt_hMjUdWYd():
pass
def _erc6pLNjnC9(OmU3Un949MWT):
return []
for (OmU3Un949MWT, vyskHDXig6uT) in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'T\xbd&\xe6n'), chr(5619 - 5519) + chr(0b0 + 0o145) + chr(0b1011000 + 0o13) + '\x6f' + '\144' + chr(0b1100101))(chr(117) + '\164' + '\x66' + chr(45) + '\x38')):
if vyskHDXig6uT == qH_trx8GVeN7:
for gXvupIeUlCmP in oomkBmkmhpSX(OmU3Un949MWT):
yield gXvupIeUlCmP
elif vyskHDXig6uT == ZpubSV8kgLzA:
for gXvupIeUlCmP in FvODMfT7QDoB(OmU3Un949MWT):
yield gXvupIeUlCmP
elif vyskHDXig6uT == aUQSoy6KgcTT:
JVHDlleapywT = QcGg0AmYV1Pj.positions
ytyBpJHe7Vii = TtCVtsNOHTY6.asset_finder.retrieve_all(JVHDlleapywT)
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'h\xb2%\xe0d\xe3\xd7\xf9\xb4\xdb\x97\x10\xc4Lu\xca\xfc\xcfK\xf0.\x19\x9e'), '\x64' + chr(0b1100101) + chr(2209 - 2110) + chr(0b1101111) + '\x64' + chr(101))(chr(117) + chr(116) + chr(0b1001000 + 0o36) + chr(0b101101) + chr(56)))(OmU3Un949MWT, ytyBpJHe7Vii)
gFt_hMjUdWYd()
xafqLlk3kkUe(TtCVtsNOHTY6, xafqLlk3kkUe(SXOLrMavuUCe(b'A\xb0%\xeca\xec\xd6\xec\xb4\xdf\x8c\x03\xc2K~\xda\xfc\xcdW\xed?\x1f\x82%\x1f'), chr(0b1100100) + '\145' + chr(9179 - 9080) + '\157' + chr(6076 - 5976) + chr(0b1100101))(chr(117) + '\164' + chr(0b1100110) + chr(45) + '\070'))()
yield xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'h\xb6,\xf1Z\xe9\xc3\xe0\x87\xc7\xb0\r\xc8Mc\xcf\xc4\xcb'), chr(356 - 256) + chr(0b1100101) + '\x63' + chr(111) + chr(1173 - 1073) + chr(4315 - 4214))(chr(2741 - 2624) + '\164' + chr(0b100001 + 0o105) + chr(0b1111 + 0o36) + '\x38'))(OmU3Un949MWT, TtCVtsNOHTY6, QcGg0AmYV1Pj)
elif vyskHDXig6uT == nwGCpMrh4vbG:
oVre8I6UXc3b.lVhq9g2VevqJ = OmU3Un949MWT
xafqLlk3kkUe(TtCVtsNOHTY6, xafqLlk3kkUe(SXOLrMavuUCe(b'X\xbf\x16\xe1q\xd2\xc1\xe1\x8a\xd0\x88\x05\xc9'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\157' + '\x64' + chr(0b1100101))('\x75' + '\x74' + chr(1056 - 954) + chr(0b11110 + 0o17) + '\x38'))(OmU3Un949MWT)
xafqLlk3kkUe(TtCVtsNOHTY6, xafqLlk3kkUe(SXOLrMavuUCe(b'U\xb4/\xeaw\xe8\xfd\xfd\x99\xdf\x8b\t\xc3YO\xdd\xd7\xcfJ\xf7'), chr(0b1100010 + 0o2) + chr(0b1100101) + chr(6265 - 6166) + chr(0b11010 + 0o125) + chr(0b1000 + 0o134) + chr(2109 - 2008))('\165' + chr(8010 - 7894) + chr(0b10101 + 0o121) + '\x2d' + chr(0b111000)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'G\xe4\x03\xefv\xc7\xc8\xdd\x8f\xca\x9a7'), '\144' + chr(0b11010 + 0o113) + chr(0b1100011) + chr(0b1100100 + 0o13) + chr(0b1100100) + chr(0b1100101))(chr(0b1100110 + 0o17) + '\164' + chr(4598 - 4496) + chr(1233 - 1188) + '\x38')))
elif vyskHDXig6uT == oxZSV67MXgOu:
ePQLUjVxOM5H = oVre8I6UXc3b._get_minute_message(OmU3Un949MWT, TtCVtsNOHTY6, QcGg0AmYV1Pj)
yield ePQLUjVxOM5H
eTW8AtfFcq4n = QcGg0AmYV1Pj.handle_simulation_end(oVre8I6UXc3b.zp1vVg_LFx8b)
yield eTW8AtfFcq4n
|
quantopian/zipline
|
zipline/gens/tradesimulation.py
|
AlgorithmSimulator._cleanup_expired_assets
|
def _cleanup_expired_assets(self, dt, position_assets):
"""
Clear out any assets that have expired before starting a new sim day.
Performs two functions:
1. Finds all assets for which we have open orders and clears any
orders whose assets are on or after their auto_close_date.
2. Finds all assets for which we have positions and generates
close_position events for any assets that have reached their
auto_close_date.
"""
algo = self.algo
def past_auto_close_date(asset):
acd = asset.auto_close_date
return acd is not None and acd <= dt
# Remove positions in any sids that have reached their auto_close date.
assets_to_clear = \
[asset for asset in position_assets if past_auto_close_date(asset)]
metrics_tracker = algo.metrics_tracker
data_portal = self.data_portal
for asset in assets_to_clear:
metrics_tracker.process_close_position(asset, dt, data_portal)
# Remove open orders for any sids that have reached their auto close
# date. These orders get processed immediately because otherwise they
# would not be processed until the first bar of the next day.
blotter = algo.blotter
assets_to_cancel = [
asset for asset in blotter.open_orders
if past_auto_close_date(asset)
]
for asset in assets_to_cancel:
blotter.cancel_all_orders_for_asset(asset)
# Make a copy here so that we are not modifying the list that is being
# iterated over.
for order in copy(blotter.new_orders):
if order.status == ORDER_STATUS.CANCELLED:
metrics_tracker.process_order(order)
blotter.new_orders.remove(order)
|
python
|
def _cleanup_expired_assets(self, dt, position_assets):
"""
Clear out any assets that have expired before starting a new sim day.
Performs two functions:
1. Finds all assets for which we have open orders and clears any
orders whose assets are on or after their auto_close_date.
2. Finds all assets for which we have positions and generates
close_position events for any assets that have reached their
auto_close_date.
"""
algo = self.algo
def past_auto_close_date(asset):
acd = asset.auto_close_date
return acd is not None and acd <= dt
# Remove positions in any sids that have reached their auto_close date.
assets_to_clear = \
[asset for asset in position_assets if past_auto_close_date(asset)]
metrics_tracker = algo.metrics_tracker
data_portal = self.data_portal
for asset in assets_to_clear:
metrics_tracker.process_close_position(asset, dt, data_portal)
# Remove open orders for any sids that have reached their auto close
# date. These orders get processed immediately because otherwise they
# would not be processed until the first bar of the next day.
blotter = algo.blotter
assets_to_cancel = [
asset for asset in blotter.open_orders
if past_auto_close_date(asset)
]
for asset in assets_to_cancel:
blotter.cancel_all_orders_for_asset(asset)
# Make a copy here so that we are not modifying the list that is being
# iterated over.
for order in copy(blotter.new_orders):
if order.status == ORDER_STATUS.CANCELLED:
metrics_tracker.process_order(order)
blotter.new_orders.remove(order)
|
[
"def",
"_cleanup_expired_assets",
"(",
"self",
",",
"dt",
",",
"position_assets",
")",
":",
"algo",
"=",
"self",
".",
"algo",
"def",
"past_auto_close_date",
"(",
"asset",
")",
":",
"acd",
"=",
"asset",
".",
"auto_close_date",
"return",
"acd",
"is",
"not",
"None",
"and",
"acd",
"<=",
"dt",
"# Remove positions in any sids that have reached their auto_close date.",
"assets_to_clear",
"=",
"[",
"asset",
"for",
"asset",
"in",
"position_assets",
"if",
"past_auto_close_date",
"(",
"asset",
")",
"]",
"metrics_tracker",
"=",
"algo",
".",
"metrics_tracker",
"data_portal",
"=",
"self",
".",
"data_portal",
"for",
"asset",
"in",
"assets_to_clear",
":",
"metrics_tracker",
".",
"process_close_position",
"(",
"asset",
",",
"dt",
",",
"data_portal",
")",
"# Remove open orders for any sids that have reached their auto close",
"# date. These orders get processed immediately because otherwise they",
"# would not be processed until the first bar of the next day.",
"blotter",
"=",
"algo",
".",
"blotter",
"assets_to_cancel",
"=",
"[",
"asset",
"for",
"asset",
"in",
"blotter",
".",
"open_orders",
"if",
"past_auto_close_date",
"(",
"asset",
")",
"]",
"for",
"asset",
"in",
"assets_to_cancel",
":",
"blotter",
".",
"cancel_all_orders_for_asset",
"(",
"asset",
")",
"# Make a copy here so that we are not modifying the list that is being",
"# iterated over.",
"for",
"order",
"in",
"copy",
"(",
"blotter",
".",
"new_orders",
")",
":",
"if",
"order",
".",
"status",
"==",
"ORDER_STATUS",
".",
"CANCELLED",
":",
"metrics_tracker",
".",
"process_order",
"(",
"order",
")",
"blotter",
".",
"new_orders",
".",
"remove",
"(",
"order",
")"
] |
Clear out any assets that have expired before starting a new sim day.
Performs two functions:
1. Finds all assets for which we have open orders and clears any
orders whose assets are on or after their auto_close_date.
2. Finds all assets for which we have positions and generates
close_position events for any assets that have reached their
auto_close_date.
|
[
"Clear",
"out",
"any",
"assets",
"that",
"have",
"expired",
"before",
"starting",
"a",
"new",
"sim",
"day",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/gens/tradesimulation.py#L238-L281
|
train
|
Clean up any assets that have expired before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33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1001111 + 0o40) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(1219 - 1171) + '\x6f' + chr(50) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(111) + chr(0b110011) + '\063' + '\067', 0b1000), ehT0Px3KOsy9(chr(1631 - 1583) + chr(111) + '\x33' + '\062' + '\065', 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(0b110001) + '\x34' + chr(0b10101 + 0o36), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(0b1111 + 0o44) + chr(0b10001 + 0o40), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(0b11011 + 0o31) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(12147 - 12036) + '\061' + '\062' + '\x37', 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + chr(51) + chr(0b10010 + 0o37) + chr(0b100 + 0o56), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3386 - 3275) + chr(2047 - 1998) + chr(0b100010 + 0o24) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1110 + 0o45) + chr(963 - 910) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(1846 - 1798) + chr(0b1101111) + chr(49) + chr(0b110100) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1741 - 1692) + chr(1058 - 1010), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1001 + 0o146) + chr(49) + chr(48) + chr(380 - 330), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\061' + '\x32' + chr(2095 - 2045), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1000111 + 0o50) + chr(235 - 186) + chr(1573 - 1525) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + '\065' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + chr(0b101101 + 0o5) + '\067' + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8742 - 8631) + '\061' + chr(0b110011) + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1 + 0o62) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(0b111100 + 0o63) + chr(1537 - 1486) + '\x36' + chr(53), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + '\x37' + chr(0b100110 + 0o13), 10179 - 10171), ehT0Px3KOsy9(chr(514 - 466) + chr(111) + chr(0b10 + 0o57) + '\x34' + chr(0b11100 + 0o27), 8), ehT0Px3KOsy9(chr(1647 - 1599) + '\157' + chr(0b110001) + chr(0b110011 + 0o2), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(957 - 905) + chr(0b1100 + 0o51), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\063' + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(0b10111 + 0o130) + '\061' + chr(862 - 811) + chr(1542 - 1489), 21099 - 21091), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + '\061' + '\067' + chr(0b110000 + 0o1), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1355 - 1305) + chr(0b0 + 0o61) + chr(0b101100 + 0o7), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11100 + 0o27) + chr(53) + '\x32', 8), ehT0Px3KOsy9(chr(48) + chr(8742 - 8631) + chr(0b101111 + 0o4) + chr(929 - 877) + '\x32', 0o10), ehT0Px3KOsy9(chr(1274 - 1226) + chr(0b11101 + 0o122) + chr(0b110001) + chr(900 - 845) + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b11010 + 0o31) + chr(877 - 822) + '\x35', 40061 - 40053), ehT0Px3KOsy9('\060' + chr(4186 - 4075) + chr(49) + chr(0b110001 + 0o3) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(0b110001) + chr(0b110110), 13382 - 13374), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100111 + 0o13) + chr(51) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(5547 - 5436) + chr(0b1011 + 0o46) + chr(0b110101) + chr(0b1010 + 0o51), 0o10), ehT0Px3KOsy9(chr(1895 - 1847) + '\157' + '\065' + chr(0b100011 + 0o22), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + '\x35' + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b','), chr(100) + '\145' + chr(0b1100011) + chr(0b100000 + 0o117) + chr(0b10111 + 0o115) + '\145')(chr(0b100010 + 0o123) + '\164' + '\x66' + chr(45) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def E3_K1az4wclA(oVre8I6UXc3b, OmU3Un949MWT, ytyBpJHe7Vii):
TtCVtsNOHTY6 = oVre8I6UXc3b.TtCVtsNOHTY6
def ZZRVYbuW04GF(tKJAwKiE1Zya):
fe0joCNmOceR = tKJAwKiE1Zya.auto_close_date
return fe0joCNmOceR is not None and fe0joCNmOceR <= OmU3Un949MWT
UwDBXszXjP0h = [tKJAwKiE1Zya for tKJAwKiE1Zya in ytyBpJHe7Vii if ZZRVYbuW04GF(tKJAwKiE1Zya)]
QcGg0AmYV1Pj = TtCVtsNOHTY6.metrics_tracker
zp1vVg_LFx8b = oVre8I6UXc3b.zp1vVg_LFx8b
for tKJAwKiE1Zya in UwDBXszXjP0h:
xafqLlk3kkUe(QcGg0AmYV1Pj, xafqLlk3kkUe(SXOLrMavuUCe(b'rg\xb0\xb6\x06\xaa\xd6\x08\xa9\x1b\x85\x15m\x1d".\x9c\xd3.u\x9ah'), '\144' + '\145' + chr(0b101001 + 0o72) + chr(5883 - 5772) + chr(0b101000 + 0o74) + chr(0b1010011 + 0o22))(chr(117) + chr(116) + chr(0b1100110) + '\055' + chr(0b111000)))(tKJAwKiE1Zya, OmU3Un949MWT, zp1vVg_LFx8b)
WcJlIx2C2pWn = TtCVtsNOHTY6.blotter
fNYivOTfHuzd = [tKJAwKiE1Zya for tKJAwKiE1Zya in WcJlIx2C2pWn.open_orders if ZZRVYbuW04GF(tKJAwKiE1Zya)]
for tKJAwKiE1Zya in fNYivOTfHuzd:
xafqLlk3kkUe(WcJlIx2C2pWn, xafqLlk3kkUe(SXOLrMavuUCe(b'at\xb1\xb6\x06\xb5\xfa6\xa6\x1b\xb5\tz&73\x9c\xe5<s\x87Y\x18\x10~\x00\xac'), chr(100) + chr(0b1011101 + 0o10) + chr(0b1110 + 0o125) + chr(0b1101111) + '\144' + '\x65')(chr(0b1110101) + chr(0b111011 + 0o71) + chr(0b1100110) + chr(0b101101) + chr(0b111000)))(tKJAwKiE1Zya)
for hO2LnONV9lny in igThHS4jwVsa(xafqLlk3kkUe(WcJlIx2C2pWn, xafqLlk3kkUe(SXOLrMavuUCe(b'XC\x80\x900\xee\xfd\x18\x9d\x1c\xa2<'), chr(0b1111 + 0o125) + chr(101) + chr(0b1010000 + 0o23) + chr(0b1101111) + '\x64' + chr(7702 - 7601))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b11000 + 0o25) + chr(0b111000)))):
if xafqLlk3kkUe(hO2LnONV9lny, xafqLlk3kkUe(SXOLrMavuUCe(b'tW\xac\x984\x91\x910\x8b2\x8c\x1f'), chr(100) + chr(5071 - 4970) + '\x63' + '\157' + chr(2055 - 1955) + '\x65')('\x75' + chr(847 - 731) + '\x66' + chr(0b101101) + chr(606 - 550))) == xafqLlk3kkUe(F2skiDo0cSMK, xafqLlk3kkUe(SXOLrMavuUCe(b'AT\x91\x96&\x95\xe9\x12\x8e'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1100001 + 0o16) + chr(0b111 + 0o135) + '\x65')(chr(117) + '\x74' + '\x66' + '\x2d' + '\070')):
xafqLlk3kkUe(QcGg0AmYV1Pj, xafqLlk3kkUe(SXOLrMavuUCe(b'rg\xb0\xb6\x06\xaa\xd6\x08\xa5\x05\x8e\x03z'), '\144' + chr(8897 - 8796) + chr(9592 - 9493) + '\x6f' + chr(0b1010100 + 0o20) + chr(0b1100101))(chr(0b1011110 + 0o27) + '\x74' + '\x66' + chr(1487 - 1442) + '\070'))(hO2LnONV9lny)
xafqLlk3kkUe(WcJlIx2C2pWn.new_orders, xafqLlk3kkUe(SXOLrMavuUCe(b'pp\xb2\xba\x15\xbc'), chr(0b111110 + 0o46) + chr(101) + '\x63' + chr(0b1101111) + chr(0b1011000 + 0o14) + chr(0b1100101))('\165' + chr(10415 - 10299) + '\146' + chr(0b101101) + chr(3123 - 3067)))(hO2LnONV9lny)
|
quantopian/zipline
|
zipline/gens/tradesimulation.py
|
AlgorithmSimulator._get_daily_message
|
def _get_daily_message(self, dt, algo, metrics_tracker):
"""
Get a perf message for the given datetime.
"""
perf_message = metrics_tracker.handle_market_close(
dt,
self.data_portal,
)
perf_message['daily_perf']['recorded_vars'] = algo.recorded_vars
return perf_message
|
python
|
def _get_daily_message(self, dt, algo, metrics_tracker):
"""
Get a perf message for the given datetime.
"""
perf_message = metrics_tracker.handle_market_close(
dt,
self.data_portal,
)
perf_message['daily_perf']['recorded_vars'] = algo.recorded_vars
return perf_message
|
[
"def",
"_get_daily_message",
"(",
"self",
",",
"dt",
",",
"algo",
",",
"metrics_tracker",
")",
":",
"perf_message",
"=",
"metrics_tracker",
".",
"handle_market_close",
"(",
"dt",
",",
"self",
".",
"data_portal",
",",
")",
"perf_message",
"[",
"'daily_perf'",
"]",
"[",
"'recorded_vars'",
"]",
"=",
"algo",
".",
"recorded_vars",
"return",
"perf_message"
] |
Get a perf message for the given datetime.
|
[
"Get",
"a",
"perf",
"message",
"for",
"the",
"given",
"datetime",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/gens/tradesimulation.py#L283-L292
|
train
|
Get a daily perf message for the given datetime.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyE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pI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2851 - 2796) + '\x37', 40182 - 40174), ehT0Px3KOsy9('\x30' + chr(0b1001101 + 0o42) + chr(0b110011) + chr(55) + chr(706 - 651), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(0b100111 + 0o17) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(7984 - 7873) + chr(515 - 464) + chr(1168 - 1120) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(1729 - 1681) + chr(2578 - 2467) + '\x33' + chr(0b110111) + chr(53), 42550 - 42542), ehT0Px3KOsy9('\060' + '\x6f' + chr(161 - 110) + chr(54) + '\061', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(1729 - 1681) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(936 - 886) + chr(0b11110 + 0o25) + chr(0b110101 + 0o0), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(2089 - 1978) + '\x31' + chr(2580 - 2529) + chr(1350 - 1302), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(595 - 545) + chr(0b11000 + 0o32), ord("\x08")), ehT0Px3KOsy9(chr(1912 - 1864) + chr(0b1101111) + chr(51) + '\x31' + chr(0b1001 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101110 + 0o5) + chr(0b110100) + chr(1779 - 1730), 17333 - 17325), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(0b101101 + 0o10), 57259 - 57251), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + '\x34' + chr(0b110010), 40829 - 40821), ehT0Px3KOsy9(chr(1098 - 1050) + chr(0b1010111 + 0o30) + '\x31' + '\x31' + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\065' + chr(0b110111), 62194 - 62186), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(230 - 178) + '\062', 56425 - 56417), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(1503 - 1450) + chr(592 - 542), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100001 + 0o16) + chr(2203 - 2154) + '\x32' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x36' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + chr(50) + chr(539 - 489) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + '\x36' + chr(0b101011 + 0o13), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010 + 0o0) + chr(51) + '\x35', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + chr(0b1000 + 0o57) + chr(0b110010), 10698 - 10690), ehT0Px3KOsy9(chr(48) + chr(0b11010 + 0o125) + '\x31' + chr(1536 - 1484) + chr(49), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11 + 0o60) + chr(0b11011 + 0o33) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + '\061' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(526 - 477) + chr(0b110000) + chr(0b100100 + 0o22), 0o10), ehT0Px3KOsy9(chr(324 - 276) + chr(2799 - 2688) + '\063' + chr(48) + chr(1705 - 1655), 8), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101111) + chr(0b10111 + 0o33) + chr(0b110000) + chr(974 - 926), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b101001 + 0o106) + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101010 + 0o105) + chr(0b1010 + 0o50) + chr(50) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\067' + '\x32', 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b10101 + 0o132) + chr(50) + '\x32' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(1946 - 1898) + chr(0b1010111 + 0o30) + chr(0b1110 + 0o51) + chr(2042 - 1994), 0b1000), ehT0Px3KOsy9('\060' + chr(3245 - 3134) + '\063' + '\x32' + '\x32', 1675 - 1667), ehT0Px3KOsy9(chr(1498 - 1450) + chr(0b1011011 + 0o24) + chr(0b110001) + chr(51) + chr(275 - 222), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110110) + chr(51), 51462 - 51454), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11000 + 0o31) + '\061' + chr(1814 - 1765), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(3622 - 3511) + '\x35' + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x11'), chr(0b1100100) + chr(6769 - 6668) + chr(4006 - 3907) + chr(111) + chr(0b110110 + 0o56) + chr(0b1100101))(chr(117) + '\164' + '\x66' + '\055' + chr(1569 - 1513)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def sf6EOiqY3sNC(oVre8I6UXc3b, OmU3Un949MWT, TtCVtsNOHTY6, QcGg0AmYV1Pj):
AZkyR9RbH_jI = QcGg0AmYV1Pj.handle_market_close(OmU3Un949MWT, oVre8I6UXc3b.zp1vVg_LFx8b)
AZkyR9RbH_jI[xafqLlk3kkUe(SXOLrMavuUCe(b'[\x9e\x1a\xad\x84\xae\xb2\xf8*\xf4'), chr(985 - 885) + '\145' + chr(0b1100011) + '\x6f' + chr(100) + chr(101))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(0b111 + 0o46) + chr(0b1010 + 0o56))][xafqLlk3kkUe(SXOLrMavuUCe(b'M\x9a\x10\xae\x8f\x95\xa7\xf9\x07\xe4\xaa\x93~'), chr(0b110101 + 0o57) + chr(101) + '\143' + chr(111) + chr(100) + '\145')(chr(117) + chr(0b1101011 + 0o11) + '\x66' + chr(0b11000 + 0o25) + chr(56))] = TtCVtsNOHTY6.recorded_vars
return AZkyR9RbH_jI
|
quantopian/zipline
|
zipline/gens/tradesimulation.py
|
AlgorithmSimulator._get_minute_message
|
def _get_minute_message(self, dt, algo, metrics_tracker):
"""
Get a perf message for the given datetime.
"""
rvars = algo.recorded_vars
minute_message = metrics_tracker.handle_minute_close(
dt,
self.data_portal,
)
minute_message['minute_perf']['recorded_vars'] = rvars
return minute_message
|
python
|
def _get_minute_message(self, dt, algo, metrics_tracker):
"""
Get a perf message for the given datetime.
"""
rvars = algo.recorded_vars
minute_message = metrics_tracker.handle_minute_close(
dt,
self.data_portal,
)
minute_message['minute_perf']['recorded_vars'] = rvars
return minute_message
|
[
"def",
"_get_minute_message",
"(",
"self",
",",
"dt",
",",
"algo",
",",
"metrics_tracker",
")",
":",
"rvars",
"=",
"algo",
".",
"recorded_vars",
"minute_message",
"=",
"metrics_tracker",
".",
"handle_minute_close",
"(",
"dt",
",",
"self",
".",
"data_portal",
",",
")",
"minute_message",
"[",
"'minute_perf'",
"]",
"[",
"'recorded_vars'",
"]",
"=",
"rvars",
"return",
"minute_message"
] |
Get a perf message for the given datetime.
|
[
"Get",
"a",
"perf",
"message",
"for",
"the",
"given",
"datetime",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63f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Ee,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1010 + 0o145) + chr(2103 - 2051) + chr(55), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10010 + 0o37) + chr(50) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + '\065' + chr(2664 - 2609), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(0b11 + 0o62) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + chr(11486 - 11375) + '\063' + '\x31' + chr(0b110010 + 0o5), 36790 - 36782), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1010 + 0o50) + '\067' + chr(148 - 93), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(0b110011) + chr(372 - 320), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1129 - 1079) + chr(49) + '\x31', 44633 - 44625), ehT0Px3KOsy9(chr(0b110000) + chr(0b10011 + 0o134) + '\063' + '\x37' + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101011 + 0o6) + chr(0b101111 + 0o6) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(8736 - 8625) + chr(0b110101) + chr(1022 - 973), 0o10), ehT0Px3KOsy9('\x30' + chr(0b110 + 0o151) + chr(50) + chr(0b11110 + 0o25) + chr(51), 18246 - 18238), ehT0Px3KOsy9(chr(0b110000) + chr(0b111010 + 0o65) + chr(50) + '\062' + chr(472 - 424), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b11001 + 0o126) + chr(0b110010) + chr(550 - 499) + '\x37', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(0b110011) + chr(48), 0b1000), ehT0Px3KOsy9('\060' + chr(5594 - 5483) + '\x32' + chr(1750 - 1700) + chr(1783 - 1730), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b110001) + chr(1281 - 1227), 12728 - 12720), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(0b110 + 0o55) + chr(0b110111), 61056 - 61048), ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(0b110100) + '\x32', 0b1000), ehT0Px3KOsy9(chr(1532 - 1484) + '\x6f' + '\063' + chr(0b100111 + 0o14), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b111010 + 0o65) + '\063' + '\064' + chr(0b0 + 0o62), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(52) + chr(823 - 770), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110000 + 0o77) + chr(2470 - 2415) + chr(1038 - 990), 58850 - 58842), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(2567 - 2512) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + chr(0b1100 + 0o47) + chr(196 - 146) + chr(2337 - 2282), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\x35' + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + chr(8352 - 8241) + '\062' + chr(0b110000) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(0b110000 + 0o3) + chr(0b100111 + 0o15), 29482 - 29474), ehT0Px3KOsy9('\x30' + '\x6f' + '\066', 538 - 530), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + '\x30' + '\x34', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(52) + chr(0b100001 + 0o20), 0b1000), ehT0Px3KOsy9(chr(1144 - 1096) + chr(111) + chr(0b110010) + chr(0b101100 + 0o11) + chr(55), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(408 - 358) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1571 - 1516) + chr(1756 - 1708), 8), ehT0Px3KOsy9('\x30' + '\157' + '\066' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(51) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(234 - 180), 12242 - 12234), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + '\x34' + chr(76 - 21), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + '\066' + chr(0b1011 + 0o51), 58567 - 58559), ehT0Px3KOsy9(chr(48) + chr(0b101000 + 0o107) + '\062' + chr(0b110111) + '\062', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(53) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\t'), chr(0b101010 + 0o72) + chr(0b10111 + 0o116) + chr(7685 - 7586) + chr(5224 - 5113) + '\144' + '\145')(chr(1293 - 1176) + '\164' + chr(251 - 149) + chr(962 - 917) + chr(0b100111 + 0o21)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def qDYstvsNHV0l(oVre8I6UXc3b, OmU3Un949MWT, TtCVtsNOHTY6, QcGg0AmYV1Pj):
QsrqkJTI8jX0 = TtCVtsNOHTY6.recorded_vars
Zza9gptUV_ga = QcGg0AmYV1Pj.handle_minute_close(OmU3Un949MWT, oVre8I6UXc3b.zp1vVg_LFx8b)
Zza9gptUV_ga[xafqLlk3kkUe(SXOLrMavuUCe(b'J>\xc1\x99\xbb\xda\xc3\xf9\x9f\x19O'), '\x64' + '\145' + chr(0b100100 + 0o77) + chr(0b110110 + 0o71) + chr(0b1100100) + '\x65')(chr(5964 - 5847) + chr(13251 - 13135) + chr(0b1011110 + 0o10) + chr(0b101101) + chr(0b10111 + 0o41))][xafqLlk3kkUe(SXOLrMavuUCe(b'U2\xcc\x83\xbd\xdb\xf9\xed\xa5\x1dH\xe9\xe3'), chr(0b111001 + 0o53) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(6012 - 5912) + chr(101))(chr(0b1110101) + chr(0b11111 + 0o125) + chr(0b1100110) + chr(0b101101) + '\x38')] = QsrqkJTI8jX0
return Zza9gptUV_ga
|
quantopian/zipline
|
zipline/data/adjustments.py
|
SQLiteAdjustmentReader.load_adjustments
|
def load_adjustments(self,
dates,
assets,
should_include_splits,
should_include_mergers,
should_include_dividends,
adjustment_type):
"""
Load collection of Adjustment objects from underlying adjustments db.
Parameters
----------
dates : pd.DatetimeIndex
Dates for which adjustments are needed.
assets : pd.Int64Index
Assets for which adjustments are needed.
should_include_splits : bool
Whether split adjustments should be included.
should_include_mergers : bool
Whether merger adjustments should be included.
should_include_dividends : bool
Whether dividend adjustments should be included.
adjustment_type : str
Whether price adjustments, volume adjustments, or both, should be
included in the output.
Returns
-------
adjustments : dict[str -> dict[int -> Adjustment]]
A dictionary containing price and/or volume adjustment mappings
from index to adjustment objects to apply at that index.
"""
return load_adjustments_from_sqlite(
self.conn,
dates,
assets,
should_include_splits,
should_include_mergers,
should_include_dividends,
adjustment_type,
)
|
python
|
def load_adjustments(self,
dates,
assets,
should_include_splits,
should_include_mergers,
should_include_dividends,
adjustment_type):
"""
Load collection of Adjustment objects from underlying adjustments db.
Parameters
----------
dates : pd.DatetimeIndex
Dates for which adjustments are needed.
assets : pd.Int64Index
Assets for which adjustments are needed.
should_include_splits : bool
Whether split adjustments should be included.
should_include_mergers : bool
Whether merger adjustments should be included.
should_include_dividends : bool
Whether dividend adjustments should be included.
adjustment_type : str
Whether price adjustments, volume adjustments, or both, should be
included in the output.
Returns
-------
adjustments : dict[str -> dict[int -> Adjustment]]
A dictionary containing price and/or volume adjustment mappings
from index to adjustment objects to apply at that index.
"""
return load_adjustments_from_sqlite(
self.conn,
dates,
assets,
should_include_splits,
should_include_mergers,
should_include_dividends,
adjustment_type,
)
|
[
"def",
"load_adjustments",
"(",
"self",
",",
"dates",
",",
"assets",
",",
"should_include_splits",
",",
"should_include_mergers",
",",
"should_include_dividends",
",",
"adjustment_type",
")",
":",
"return",
"load_adjustments_from_sqlite",
"(",
"self",
".",
"conn",
",",
"dates",
",",
"assets",
",",
"should_include_splits",
",",
"should_include_mergers",
",",
"should_include_dividends",
",",
"adjustment_type",
",",
")"
] |
Load collection of Adjustment objects from underlying adjustments db.
Parameters
----------
dates : pd.DatetimeIndex
Dates for which adjustments are needed.
assets : pd.Int64Index
Assets for which adjustments are needed.
should_include_splits : bool
Whether split adjustments should be included.
should_include_mergers : bool
Whether merger adjustments should be included.
should_include_dividends : bool
Whether dividend adjustments should be included.
adjustment_type : str
Whether price adjustments, volume adjustments, or both, should be
included in the output.
Returns
-------
adjustments : dict[str -> dict[int -> Adjustment]]
A dictionary containing price and/or volume adjustment mappings
from index to adjustment objects to apply at that index.
|
[
"Load",
"collection",
"of",
"Adjustment",
"objects",
"from",
"underlying",
"adjustments",
"db",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/adjustments.py#L142-L182
|
train
|
Loads a collection of Adjustment objects from the underlying adjustments db.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994q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4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(249 - 201) + '\157' + '\061' + chr(0b110001) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(10733 - 10622) + '\x33' + chr(0b110001), 34490 - 34482), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(0b110011) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(736 - 688) + chr(2300 - 2189) + chr(1769 - 1718) + chr(0b110111) + chr(0b101001 + 0o12), 0b1000), ehT0Px3KOsy9(chr(1637 - 1589) + '\x6f' + chr(0b110001) + chr(50) + '\065', 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(0b0 + 0o63) + chr(0b101001 + 0o12) + chr(2011 - 1960), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10001 + 0o40) + chr(0b110001) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + '\x30' + '\x32', 9947 - 9939), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + '\065' + chr(1929 - 1878), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(111) + chr(0b110011) + chr(0b10010 + 0o36) + '\061', 6284 - 6276), ehT0Px3KOsy9(chr(2228 - 2180) + '\157' + '\063' + chr(54) + '\064', 0b1000), ehT0Px3KOsy9('\060' + chr(4979 - 4868) + chr(50) + chr(0b110000) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(0b110010 + 0o75) + '\061' + chr(52) + chr(439 - 387), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110100) + chr(77 - 22), 0b1000), ehT0Px3KOsy9('\060' + chr(0b10000 + 0o137) + chr(0b1 + 0o61) + '\x31' + chr(52), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b100000 + 0o23) + '\x31' + chr(53), 21889 - 21881), ehT0Px3KOsy9('\060' + chr(4270 - 4159) + '\061' + '\060' + '\x32', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1000 + 0o57) + '\062', 5866 - 5858), ehT0Px3KOsy9(chr(48) + chr(1766 - 1655) + '\x37' + '\x34', 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + chr(0b100000 + 0o22) + chr(55) + chr(2560 - 2508), 0o10), ehT0Px3KOsy9(chr(1781 - 1733) + chr(4137 - 4026) + chr(49) + '\063' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b100011 + 0o114) + '\062' + chr(2015 - 1966) + '\065', 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1001100 + 0o43) + chr(49) + chr(0b101 + 0o53) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(0b11100 + 0o25) + '\x30' + chr(0b110010), 8), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\157' + chr(0b11011 + 0o27) + chr(0b110100) + chr(0b1100 + 0o52), 0b1000), ehT0Px3KOsy9(chr(578 - 530) + chr(0b1101111) + chr(0b1 + 0o62) + '\x37' + '\x30', 34700 - 34692), ehT0Px3KOsy9(chr(995 - 947) + chr(111) + chr(1511 - 1462) + chr(0b11 + 0o62) + chr(1771 - 1717), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(1474 - 1424) + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(50) + chr(0b100 + 0o56), 63359 - 63351), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1001111 + 0o40) + '\063' + chr(505 - 456) + chr(269 - 218), 0o10), ehT0Px3KOsy9('\060' + chr(5389 - 5278) + chr(0b1100 + 0o46) + chr(0b110011) + chr(855 - 805), 21454 - 21446), ehT0Px3KOsy9(chr(229 - 181) + '\x6f' + '\x32' + chr(54) + chr(1254 - 1206), ord("\x08")), ehT0Px3KOsy9(chr(315 - 267) + '\157' + chr(0b110011 + 0o0) + chr(0b10110 + 0o40) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(0b110101) + chr(2288 - 2237), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(2410 - 2358) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11011 + 0o34) + chr(0b1111 + 0o44), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101111) + '\063' + '\x35' + chr(2235 - 2181), ord("\x08")), ehT0Px3KOsy9(chr(2078 - 2030) + '\157' + chr(51) + chr(0b110010) + '\061', 27771 - 27763), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\157' + chr(51) + chr(0b110110), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + '\065' + chr(0b110000), 52986 - 52978)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'f'), chr(0b11 + 0o141) + '\x65' + chr(9791 - 9692) + chr(7197 - 7086) + chr(0b100100 + 0o100) + '\145')('\x75' + '\164' + chr(3175 - 3073) + chr(0b101101) + chr(0b11100 + 0o34)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def HZcOeMSQoV7h(oVre8I6UXc3b, SLiSZu5nk7Kn, YGFU3oxACPcg, FyaDiSaSp1cV, zKHlK8fOY1gv, TgnYWNvp5_3h, GcTWFS8i9ame):
return s0S0ih3xBaZZ(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'+tw6'), chr(0b101000 + 0o74) + chr(101) + chr(0b1100011) + '\157' + chr(100) + '\x65')(chr(0b101010 + 0o113) + chr(116) + '\146' + chr(0b10101 + 0o30) + chr(0b110000 + 0o10))), SLiSZu5nk7Kn, YGFU3oxACPcg, FyaDiSaSp1cV, zKHlK8fOY1gv, TgnYWNvp5_3h, GcTWFS8i9ame)
|
quantopian/zipline
|
zipline/data/adjustments.py
|
SQLiteAdjustmentReader.unpack_db_to_component_dfs
|
def unpack_db_to_component_dfs(self, convert_dates=False):
"""Returns the set of known tables in the adjustments file in DataFrame
form.
Parameters
----------
convert_dates : bool, optional
By default, dates are returned in seconds since EPOCH. If
convert_dates is True, all ints in date columns will be converted
to datetimes.
Returns
-------
dfs : dict{str->DataFrame}
Dictionary which maps table name to the corresponding DataFrame
version of the table, where all date columns have been coerced back
from int to datetime.
"""
return {
t_name: self.get_df_from_table(t_name, convert_dates)
for t_name in self._datetime_int_cols
}
|
python
|
def unpack_db_to_component_dfs(self, convert_dates=False):
"""Returns the set of known tables in the adjustments file in DataFrame
form.
Parameters
----------
convert_dates : bool, optional
By default, dates are returned in seconds since EPOCH. If
convert_dates is True, all ints in date columns will be converted
to datetimes.
Returns
-------
dfs : dict{str->DataFrame}
Dictionary which maps table name to the corresponding DataFrame
version of the table, where all date columns have been coerced back
from int to datetime.
"""
return {
t_name: self.get_df_from_table(t_name, convert_dates)
for t_name in self._datetime_int_cols
}
|
[
"def",
"unpack_db_to_component_dfs",
"(",
"self",
",",
"convert_dates",
"=",
"False",
")",
":",
"return",
"{",
"t_name",
":",
"self",
".",
"get_df_from_table",
"(",
"t_name",
",",
"convert_dates",
")",
"for",
"t_name",
"in",
"self",
".",
"_datetime_int_cols",
"}"
] |
Returns the set of known tables in the adjustments file in DataFrame
form.
Parameters
----------
convert_dates : bool, optional
By default, dates are returned in seconds since EPOCH. If
convert_dates is True, all ints in date columns will be converted
to datetimes.
Returns
-------
dfs : dict{str->DataFrame}
Dictionary which maps table name to the corresponding DataFrame
version of the table, where all date columns have been coerced back
from int to datetime.
|
[
"Returns",
"the",
"set",
"of",
"known",
"tables",
"in",
"the",
"adjustments",
"file",
"in",
"DataFrame",
"form",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/adjustments.py#L268-L289
|
train
|
Unpacks the database file into a dictionary of DataFrame objects.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7C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XL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11 + 0o60) + chr(1449 - 1401), 0o10), ehT0Px3KOsy9(chr(2075 - 2027) + chr(0b100110 + 0o111) + chr(0b110010) + chr(51) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b100000 + 0o117) + chr(0b10111 + 0o33) + '\x33' + '\x30', 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(539 - 486) + chr(839 - 785), 22891 - 22883), ehT0Px3KOsy9(chr(1064 - 1016) + chr(0b1000011 + 0o54) + '\061' + '\x30' + '\x30', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1364 - 1315) + '\067' + '\x32', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100001 + 0o16) + chr(49) + chr(0b110011) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(55) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1011011 + 0o24) + chr(833 - 781), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + '\x34' + '\064', 0o10), ehT0Px3KOsy9(chr(411 - 363) + chr(111) + chr(0b110011) + chr(0b110101) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001001 + 0o46) + chr(0b101100 + 0o7) + '\063' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + chr(242 - 193) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1111 + 0o140) + chr(1784 - 1732) + chr(51), 0o10), ehT0Px3KOsy9(chr(2057 - 2009) + chr(0b1101111) + chr(0b110011) + chr(0b111 + 0o56) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1000000 + 0o57) + '\x32' + chr(462 - 412) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(2913 - 2802) + chr(0b110011) + '\x31' + chr(2248 - 2194), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(1633 - 1522) + chr(1276 - 1221) + chr(0b110000), 4059 - 4051), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + '\062' + chr(0b110000), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(0b110001) + '\062', 15960 - 15952), ehT0Px3KOsy9('\060' + '\157' + chr(0b100110 + 0o16) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + '\x32' + chr(0b110010) + chr(270 - 216), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + '\062' + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1399 - 1348) + '\x35' + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + '\x37' + chr(54), 25493 - 25485), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(0b110011) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11372 - 11261) + '\062' + chr(341 - 286) + '\063', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + '\064' + '\x37', 63006 - 62998), ehT0Px3KOsy9('\x30' + chr(111) + chr(1724 - 1674) + chr(0b11101 + 0o27) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(1778 - 1730) + chr(0b1101111) + chr(51) + chr(52) + chr(2407 - 2354), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + '\062' + chr(0b110100) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(10366 - 10255) + chr(0b100010 + 0o17) + chr(0b10111 + 0o33) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + '\x36' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(68 - 20) + chr(0b111111 + 0o60) + chr(0b100100 + 0o15) + '\063' + chr(0b110011), 17198 - 17190), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + '\067' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(371 - 323) + '\157' + chr(667 - 616) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\157' + chr(0b110011) + chr(54) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(329 - 218) + chr(1122 - 1071) + chr(51) + chr(0b101000 + 0o16), 28976 - 28968), ehT0Px3KOsy9(chr(1887 - 1839) + chr(111) + '\062' + chr(0b100010 + 0o20) + chr(49), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(213 - 163) + chr(1451 - 1402), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + chr(53) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'6'), '\144' + '\145' + chr(99) + '\x6f' + chr(100) + '\145')(chr(117) + '\164' + '\x66' + chr(0b100101 + 0o10) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def tTaG8Puv7U4g(oVre8I6UXc3b, JcOfGmhCIjpm=ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1100011 + 0o14) + chr(0b110000), 0b1000)):
return {xZdAbxgU3KYp: xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x7f\xf9\xecq$\x1c\x03\xdav\xcb\x85\x86\xfeB\x8b\xfc\xab'), '\x64' + chr(9794 - 9693) + chr(7863 - 7764) + chr(12206 - 12095) + chr(4875 - 4775) + '\x65')(chr(5568 - 5451) + '\x74' + '\x66' + '\055' + chr(0b111000)))(xZdAbxgU3KYp, JcOfGmhCIjpm) for xZdAbxgU3KYp in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'G\xf8\xf9Z%\x0e5\xd1a\xfb\x81\xb7\xfe|\x8a\xff\xa2K'), chr(0b1100100) + chr(9354 - 9253) + '\x63' + chr(0b1101111) + '\x64' + '\145')(chr(0b101010 + 0o113) + '\164' + chr(0b1000011 + 0o43) + '\055' + chr(0b1111 + 0o51)))}
|
quantopian/zipline
|
zipline/data/adjustments.py
|
SQLiteAdjustmentReader._df_dtypes
|
def _df_dtypes(self, table_name, convert_dates):
"""Get dtypes to use when unpacking sqlite tables as dataframes.
"""
out = self._raw_table_dtypes[table_name]
if convert_dates:
out = out.copy()
for date_column in self._datetime_int_cols[table_name]:
out[date_column] = datetime64ns_dtype
return out
|
python
|
def _df_dtypes(self, table_name, convert_dates):
"""Get dtypes to use when unpacking sqlite tables as dataframes.
"""
out = self._raw_table_dtypes[table_name]
if convert_dates:
out = out.copy()
for date_column in self._datetime_int_cols[table_name]:
out[date_column] = datetime64ns_dtype
return out
|
[
"def",
"_df_dtypes",
"(",
"self",
",",
"table_name",
",",
"convert_dates",
")",
":",
"out",
"=",
"self",
".",
"_raw_table_dtypes",
"[",
"table_name",
"]",
"if",
"convert_dates",
":",
"out",
"=",
"out",
".",
"copy",
"(",
")",
"for",
"date_column",
"in",
"self",
".",
"_datetime_int_cols",
"[",
"table_name",
"]",
":",
"out",
"[",
"date_column",
"]",
"=",
"datetime64ns_dtype",
"return",
"out"
] |
Get dtypes to use when unpacking sqlite tables as dataframes.
|
[
"Get",
"dtypes",
"to",
"use",
"when",
"unpacking",
"sqlite",
"tables",
"as",
"dataframes",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/adjustments.py#L326-L335
|
train
|
Get dtypes to use when unpacking sqlite tables as dataframes.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,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afqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11 + 0o64), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(6612 - 6501) + '\062' + chr(0b110010) + chr(0b111 + 0o52), 0b1000), ehT0Px3KOsy9(chr(1764 - 1716) + chr(0b1010100 + 0o33) + chr(0b101000 + 0o17) + '\x32', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1111 + 0o42) + chr(0b110100) + chr(0b110101), 65486 - 65478), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\157' + '\x37' + chr(2232 - 2181), 34042 - 34034), ehT0Px3KOsy9('\x30' + chr(1685 - 1574) + chr(49) + '\x34' + chr(1917 - 1865), 0b1000), ehT0Px3KOsy9(chr(1087 - 1039) + chr(111) + chr(623 - 573) + '\066' + '\x32', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\067' + chr(1286 - 1232), 21091 - 21083), ehT0Px3KOsy9(chr(2292 - 2244) + chr(111) + chr(602 - 548) + chr(0b100001 + 0o26), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(0b11111 + 0o22), 0b1000), ehT0Px3KOsy9(chr(591 - 543) + '\157' + chr(0b110000 + 0o5) + '\063', 63107 - 63099), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(0b111 + 0o52) + chr(92 - 42), 14063 - 14055), ehT0Px3KOsy9('\060' + '\157' + chr(0b110000 + 0o2) + '\060', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1805 - 1754) + chr(909 - 860) + '\064', 0b1000), ehT0Px3KOsy9(chr(1846 - 1798) + chr(10627 - 10516) + '\x31' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + '\066' + chr(0b11110 + 0o22), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(12224 - 12113) + '\x32' + chr(0b110111) + chr(0b110101), 22607 - 22599), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + '\064' + chr(0b1010 + 0o55), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2166 - 2115) + chr(1502 - 1447) + chr(0b101001 + 0o13), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(0b110001) + '\x32', 8), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(0b110010) + '\x35', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b101 + 0o56) + chr(0b110001), 29232 - 29224), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10010 + 0o41) + chr(49) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(2004 - 1956) + chr(0b1011110 + 0o21) + chr(0b101011 + 0o11), 49474 - 49466), ehT0Px3KOsy9(chr(2093 - 2045) + chr(111) + chr(0b110011) + chr(0b101011 + 0o11), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + chr(0b11 + 0o57) + '\067' + chr(53), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10000 + 0o42) + chr(1919 - 1865) + chr(1384 - 1336), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(259 - 209) + chr(0b10001 + 0o40) + chr(2015 - 1961), 0b1000), ehT0Px3KOsy9(chr(48) + chr(4861 - 4750) + '\062' + chr(2028 - 1980), 8), ehT0Px3KOsy9('\x30' + chr(0b0 + 0o157) + chr(0b1111 + 0o44) + '\067' + '\x31', 39694 - 39686), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(1756 - 1705) + '\064', 0b1000), ehT0Px3KOsy9(chr(1469 - 1421) + chr(111) + '\x31' + chr(52) + chr(49), 17503 - 17495), ehT0Px3KOsy9('\060' + chr(0b11111 + 0o120) + chr(49) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b110100) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(111) + chr(50) + chr(53) + chr(1477 - 1426), ord("\x08")), ehT0Px3KOsy9(chr(1021 - 973) + chr(1927 - 1816) + '\067' + chr(1549 - 1499), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101110 + 0o3) + chr(0b110101 + 0o1) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1101111) + '\064' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b110101 + 0o72) + chr(50) + chr(0b110111) + chr(48), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(53) + chr(48), 981 - 973)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b')'), chr(0b1100100) + chr(4401 - 4300) + chr(0b1100011) + chr(2258 - 2147) + chr(100) + chr(2119 - 2018))(chr(0b1100111 + 0o16) + '\164' + '\146' + '\055' + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def AMg05xADJ1z5(oVre8I6UXc3b, NKKFbr2Z4sr1, JcOfGmhCIjpm):
UkrMp_I0RDmo = oVre8I6UXc3b._raw_table_dtypes[NKKFbr2Z4sr1]
if JcOfGmhCIjpm:
UkrMp_I0RDmo = UkrMp_I0RDmo.igThHS4jwVsa()
for TtzC0V6DLmxg in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'X\xf5[\x11^\x10\xdbSRNB\xa4d\x93h\xdf\xd1r'), chr(100) + chr(101) + chr(99) + chr(0b1101111) + chr(8167 - 8067) + chr(101))('\165' + chr(624 - 508) + chr(8613 - 8511) + '\x2d' + '\070'))[NKKFbr2Z4sr1]:
UkrMp_I0RDmo[TtzC0V6DLmxg] = CkJp5tuJXrYe
return UkrMp_I0RDmo
|
quantopian/zipline
|
zipline/data/adjustments.py
|
SQLiteAdjustmentWriter.calc_dividend_ratios
|
def calc_dividend_ratios(self, dividends):
"""
Calculate the ratios to apply to equities when looking back at pricing
history so that the price is smoothed over the ex_date, when the market
adjusts to the change in equity value due to upcoming dividend.
Returns
-------
DataFrame
A frame in the same format as splits and mergers, with keys
- sid, the id of the equity
- effective_date, the date in seconds on which to apply the ratio.
- ratio, the ratio to apply to backwards looking pricing data.
"""
if dividends is None or dividends.empty:
return pd.DataFrame(np.array(
[],
dtype=[
('sid', uint64_dtype),
('effective_date', uint32_dtype),
('ratio', float64_dtype),
],
))
pricing_reader = self._equity_daily_bar_reader
input_sids = dividends.sid.values
unique_sids, sids_ix = np.unique(input_sids, return_inverse=True)
dates = pricing_reader.sessions.values
close, = pricing_reader.load_raw_arrays(
['close'],
pd.Timestamp(dates[0], tz='UTC'),
pd.Timestamp(dates[-1], tz='UTC'),
unique_sids,
)
date_ix = np.searchsorted(dates, dividends.ex_date.values)
mask = date_ix > 0
date_ix = date_ix[mask]
sids_ix = sids_ix[mask]
input_dates = dividends.ex_date.values[mask]
# subtract one day to get the close on the day prior to the merger
previous_close = close[date_ix - 1, sids_ix]
input_sids = input_sids[mask]
amount = dividends.amount.values[mask]
ratio = 1.0 - amount / previous_close
non_nan_ratio_mask = ~np.isnan(ratio)
for ix in np.flatnonzero(~non_nan_ratio_mask):
log.warn(
"Couldn't compute ratio for dividend"
" sid={sid}, ex_date={ex_date:%Y-%m-%d}, amount={amount:.3f}",
sid=input_sids[ix],
ex_date=pd.Timestamp(input_dates[ix]),
amount=amount[ix],
)
positive_ratio_mask = ratio > 0
for ix in np.flatnonzero(~positive_ratio_mask & non_nan_ratio_mask):
log.warn(
"Dividend ratio <= 0 for dividend"
" sid={sid}, ex_date={ex_date:%Y-%m-%d}, amount={amount:.3f}",
sid=input_sids[ix],
ex_date=pd.Timestamp(input_dates[ix]),
amount=amount[ix],
)
valid_ratio_mask = non_nan_ratio_mask & positive_ratio_mask
return pd.DataFrame({
'sid': input_sids[valid_ratio_mask],
'effective_date': input_dates[valid_ratio_mask],
'ratio': ratio[valid_ratio_mask],
})
|
python
|
def calc_dividend_ratios(self, dividends):
"""
Calculate the ratios to apply to equities when looking back at pricing
history so that the price is smoothed over the ex_date, when the market
adjusts to the change in equity value due to upcoming dividend.
Returns
-------
DataFrame
A frame in the same format as splits and mergers, with keys
- sid, the id of the equity
- effective_date, the date in seconds on which to apply the ratio.
- ratio, the ratio to apply to backwards looking pricing data.
"""
if dividends is None or dividends.empty:
return pd.DataFrame(np.array(
[],
dtype=[
('sid', uint64_dtype),
('effective_date', uint32_dtype),
('ratio', float64_dtype),
],
))
pricing_reader = self._equity_daily_bar_reader
input_sids = dividends.sid.values
unique_sids, sids_ix = np.unique(input_sids, return_inverse=True)
dates = pricing_reader.sessions.values
close, = pricing_reader.load_raw_arrays(
['close'],
pd.Timestamp(dates[0], tz='UTC'),
pd.Timestamp(dates[-1], tz='UTC'),
unique_sids,
)
date_ix = np.searchsorted(dates, dividends.ex_date.values)
mask = date_ix > 0
date_ix = date_ix[mask]
sids_ix = sids_ix[mask]
input_dates = dividends.ex_date.values[mask]
# subtract one day to get the close on the day prior to the merger
previous_close = close[date_ix - 1, sids_ix]
input_sids = input_sids[mask]
amount = dividends.amount.values[mask]
ratio = 1.0 - amount / previous_close
non_nan_ratio_mask = ~np.isnan(ratio)
for ix in np.flatnonzero(~non_nan_ratio_mask):
log.warn(
"Couldn't compute ratio for dividend"
" sid={sid}, ex_date={ex_date:%Y-%m-%d}, amount={amount:.3f}",
sid=input_sids[ix],
ex_date=pd.Timestamp(input_dates[ix]),
amount=amount[ix],
)
positive_ratio_mask = ratio > 0
for ix in np.flatnonzero(~positive_ratio_mask & non_nan_ratio_mask):
log.warn(
"Dividend ratio <= 0 for dividend"
" sid={sid}, ex_date={ex_date:%Y-%m-%d}, amount={amount:.3f}",
sid=input_sids[ix],
ex_date=pd.Timestamp(input_dates[ix]),
amount=amount[ix],
)
valid_ratio_mask = non_nan_ratio_mask & positive_ratio_mask
return pd.DataFrame({
'sid': input_sids[valid_ratio_mask],
'effective_date': input_dates[valid_ratio_mask],
'ratio': ratio[valid_ratio_mask],
})
|
[
"def",
"calc_dividend_ratios",
"(",
"self",
",",
"dividends",
")",
":",
"if",
"dividends",
"is",
"None",
"or",
"dividends",
".",
"empty",
":",
"return",
"pd",
".",
"DataFrame",
"(",
"np",
".",
"array",
"(",
"[",
"]",
",",
"dtype",
"=",
"[",
"(",
"'sid'",
",",
"uint64_dtype",
")",
",",
"(",
"'effective_date'",
",",
"uint32_dtype",
")",
",",
"(",
"'ratio'",
",",
"float64_dtype",
")",
",",
"]",
",",
")",
")",
"pricing_reader",
"=",
"self",
".",
"_equity_daily_bar_reader",
"input_sids",
"=",
"dividends",
".",
"sid",
".",
"values",
"unique_sids",
",",
"sids_ix",
"=",
"np",
".",
"unique",
"(",
"input_sids",
",",
"return_inverse",
"=",
"True",
")",
"dates",
"=",
"pricing_reader",
".",
"sessions",
".",
"values",
"close",
",",
"=",
"pricing_reader",
".",
"load_raw_arrays",
"(",
"[",
"'close'",
"]",
",",
"pd",
".",
"Timestamp",
"(",
"dates",
"[",
"0",
"]",
",",
"tz",
"=",
"'UTC'",
")",
",",
"pd",
".",
"Timestamp",
"(",
"dates",
"[",
"-",
"1",
"]",
",",
"tz",
"=",
"'UTC'",
")",
",",
"unique_sids",
",",
")",
"date_ix",
"=",
"np",
".",
"searchsorted",
"(",
"dates",
",",
"dividends",
".",
"ex_date",
".",
"values",
")",
"mask",
"=",
"date_ix",
">",
"0",
"date_ix",
"=",
"date_ix",
"[",
"mask",
"]",
"sids_ix",
"=",
"sids_ix",
"[",
"mask",
"]",
"input_dates",
"=",
"dividends",
".",
"ex_date",
".",
"values",
"[",
"mask",
"]",
"# subtract one day to get the close on the day prior to the merger",
"previous_close",
"=",
"close",
"[",
"date_ix",
"-",
"1",
",",
"sids_ix",
"]",
"input_sids",
"=",
"input_sids",
"[",
"mask",
"]",
"amount",
"=",
"dividends",
".",
"amount",
".",
"values",
"[",
"mask",
"]",
"ratio",
"=",
"1.0",
"-",
"amount",
"/",
"previous_close",
"non_nan_ratio_mask",
"=",
"~",
"np",
".",
"isnan",
"(",
"ratio",
")",
"for",
"ix",
"in",
"np",
".",
"flatnonzero",
"(",
"~",
"non_nan_ratio_mask",
")",
":",
"log",
".",
"warn",
"(",
"\"Couldn't compute ratio for dividend\"",
"\" sid={sid}, ex_date={ex_date:%Y-%m-%d}, amount={amount:.3f}\"",
",",
"sid",
"=",
"input_sids",
"[",
"ix",
"]",
",",
"ex_date",
"=",
"pd",
".",
"Timestamp",
"(",
"input_dates",
"[",
"ix",
"]",
")",
",",
"amount",
"=",
"amount",
"[",
"ix",
"]",
",",
")",
"positive_ratio_mask",
"=",
"ratio",
">",
"0",
"for",
"ix",
"in",
"np",
".",
"flatnonzero",
"(",
"~",
"positive_ratio_mask",
"&",
"non_nan_ratio_mask",
")",
":",
"log",
".",
"warn",
"(",
"\"Dividend ratio <= 0 for dividend\"",
"\" sid={sid}, ex_date={ex_date:%Y-%m-%d}, amount={amount:.3f}\"",
",",
"sid",
"=",
"input_sids",
"[",
"ix",
"]",
",",
"ex_date",
"=",
"pd",
".",
"Timestamp",
"(",
"input_dates",
"[",
"ix",
"]",
")",
",",
"amount",
"=",
"amount",
"[",
"ix",
"]",
",",
")",
"valid_ratio_mask",
"=",
"non_nan_ratio_mask",
"&",
"positive_ratio_mask",
"return",
"pd",
".",
"DataFrame",
"(",
"{",
"'sid'",
":",
"input_sids",
"[",
"valid_ratio_mask",
"]",
",",
"'effective_date'",
":",
"input_dates",
"[",
"valid_ratio_mask",
"]",
",",
"'ratio'",
":",
"ratio",
"[",
"valid_ratio_mask",
"]",
",",
"}",
")"
] |
Calculate the ratios to apply to equities when looking back at pricing
history so that the price is smoothed over the ex_date, when the market
adjusts to the change in equity value due to upcoming dividend.
Returns
-------
DataFrame
A frame in the same format as splits and mergers, with keys
- sid, the id of the equity
- effective_date, the date in seconds on which to apply the ratio.
- ratio, the ratio to apply to backwards looking pricing data.
|
[
"Calculate",
"the",
"ratios",
"to",
"apply",
"to",
"equities",
"when",
"looking",
"back",
"at",
"pricing",
"history",
"so",
"that",
"the",
"price",
"is",
"smoothed",
"over",
"the",
"ex_date",
"when",
"the",
"market",
"adjusts",
"to",
"the",
"change",
"in",
"equity",
"value",
"due",
"to",
"upcoming",
"dividend",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/adjustments.py#L456-L530
|
train
|
Calculates the ratios to apply to the dividend when looking back at the market and merger.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,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essError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1601 - 1550) + chr(0b110101) + chr(2320 - 2270), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1000110 + 0o51) + chr(0b110100) + chr(453 - 405), ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\x6f' + chr(51) + chr(0b1 + 0o57) + chr(1545 - 1490), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(2565 - 2514) + '\063', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + '\x37' + chr(1724 - 1676), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(50) + chr(53), 37417 - 37409), ehT0Px3KOsy9(chr(1904 - 1856) + chr(0b1100101 + 0o12) + chr(0b110010) + chr(1385 - 1333) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(971 - 860) + chr(0b1011 + 0o52) + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(2634 - 2581) + chr(1718 - 1670), ord("\x08")), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + chr(49) + chr(0b110000) + '\x37', 44644 - 44636), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + '\063' + chr(1536 - 1486), 0o10), ehT0Px3KOsy9('\060' + chr(0b0 + 0o157) + chr(0b101100 + 0o7) + chr(0b110100) + chr(0b1 + 0o65), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + chr(0b11101 + 0o24) + chr(1292 - 1243) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(8031 - 7920) + chr(0b110001) + chr(0b110001) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + '\060' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b110101 + 0o72) + chr(2244 - 2194) + '\x31' + '\066', 0o10), ehT0Px3KOsy9(chr(96 - 48) + chr(111) + chr(0b10010 + 0o40) + '\x34' + '\061', 8), ehT0Px3KOsy9(chr(97 - 49) + chr(0b1000000 + 0o57) + chr(623 - 572) + chr(0b110011) + '\060', 20199 - 20191), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2706 - 2652) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(606 - 558) + chr(0b1011 + 0o144) + chr(0b101101 + 0o6) + '\066' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(952 - 902) + chr(0b110111) + chr(52), 24096 - 24088), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(311 - 262) + chr(881 - 828), 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + chr(660 - 610) + '\063' + chr(0b110 + 0o60), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110111) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + chr(0b110010) + '\x35' + chr(53), 16139 - 16131), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(51) + chr(0b101 + 0o60), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1100101 + 0o12) + chr(52) + '\x35', 0o10), ehT0Px3KOsy9('\x30' + chr(0b11 + 0o154) + chr(0b110010) + chr(0b110010) + '\063', 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(11702 - 11591) + chr(51) + chr(53) + chr(2026 - 1974), 0o10), ehT0Px3KOsy9(chr(48) + chr(7590 - 7479) + '\x31' + '\x36' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(1656 - 1608) + chr(0b1010101 + 0o32) + '\061' + chr(2394 - 2344) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(806 - 758) + chr(111) + chr(51) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + '\063' + '\x31', 11147 - 11139), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1010 + 0o50) + chr(0b110001 + 0o6), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10001 + 0o42) + chr(0b11010 + 0o34) + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(11067 - 10956) + chr(1472 - 1423) + chr(1498 - 1446) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(853 - 804) + chr(0b101011 + 0o14) + chr(50), 12238 - 12230), ehT0Px3KOsy9('\x30' + chr(4068 - 3957) + chr(1923 - 1873) + chr(0b110001) + chr(0b100101 + 0o13), 56062 - 56054), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(48) + '\067', 0o10), ehT0Px3KOsy9('\060' + chr(2627 - 2516) + chr(0b110111) + chr(54), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + chr(1122 - 1069) + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc4'), chr(0b1100100) + chr(101) + '\x63' + chr(2449 - 2338) + chr(0b110010 + 0o62) + chr(0b1100101))(chr(0b110111 + 0o76) + chr(0b1110100) + chr(0b1011001 + 0o15) + chr(0b100011 + 0o12) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def AlRqNWzTLTOH(oVre8I6UXc3b, cFAyuTNKZHE5):
if cFAyuTNKZHE5 is None or xafqLlk3kkUe(cFAyuTNKZHE5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8fM\xb7/\x01'), '\144' + '\145' + '\x63' + chr(7120 - 7009) + '\144' + '\145')(chr(0b1110101) + chr(2186 - 2070) + '\146' + chr(0b11010 + 0o23) + chr(56))):
return xafqLlk3kkUe(dubtF9GfzOdC, xafqLlk3kkUe(SXOLrMavuUCe(b"\xaeA\xb3:>'\xc0C\xcd"), chr(0b1100100 + 0o0) + chr(0b100001 + 0o104) + chr(4214 - 4115) + '\x6f' + '\144' + chr(0b1010000 + 0o25))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(45) + chr(56)))(xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8\x10\xa2\x0b<=\xd1_\xd0\t\xaf\x88'), chr(5074 - 4974) + chr(1748 - 1647) + chr(99) + '\x6f' + chr(100) + chr(101))(chr(0b101000 + 0o115) + chr(0b1110100) + chr(3935 - 3833) + chr(0b101101) + '\070'))([], dtype=[(xafqLlk3kkUe(SXOLrMavuUCe(b'\x99I\xa3'), chr(0b1100100 + 0o0) + chr(0b1100101) + chr(5031 - 4932) + '\x6f' + chr(100) + chr(0b1100101 + 0o0))(chr(0b1101000 + 0o15) + '\x74' + chr(0b1100110) + chr(0b101101) + chr(0b10110 + 0o42)), IPXhRz1jzrRg), (xafqLlk3kkUe(SXOLrMavuUCe(b'\x8fF\xa1>\x1b!\xc8X\xcd\x18\xfe\x878-'), '\x64' + '\145' + '\143' + '\x6f' + '\x64' + chr(0b1100101))('\165' + chr(116) + '\146' + chr(45) + chr(0b100100 + 0o24)), rp4zvDnBuKl7), (xafqLlk3kkUe(SXOLrMavuUCe(b'\x98A\xb32\x17'), chr(3850 - 3750) + chr(0b1100101) + '\143' + chr(0b1101111) + '\x64' + chr(101))(chr(117) + chr(2036 - 1920) + '\x66' + chr(946 - 901) + '\070'), rZ1BN3UDHnco)]))
Lmmd5UEoxVTN = oVre8I6UXc3b._equity_daily_bar_reader
G8Ebm1pTjdQZ = cFAyuTNKZHE5.sid.SPnCNu54H1db
(u2Kaqkwmtp37, sC8rSpE1vhOk) = WqUC3KWvYVup.unique(G8Ebm1pTjdQZ, return_inverse=ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2247 - 2198), ord("\x08")))
SLiSZu5nk7Kn = Lmmd5UEoxVTN.sessions.SPnCNu54H1db
(MkcqzDT3iB5h,) = Lmmd5UEoxVTN.load_raw_arrays([xafqLlk3kkUe(SXOLrMavuUCe(b'\x89L\xa8(\x1d'), chr(0b1100100) + chr(0b1100000 + 0o5) + '\x63' + chr(111) + chr(100) + chr(101))('\x75' + chr(0b1100101 + 0o17) + '\146' + '\055' + chr(0b111000))], dubtF9GfzOdC.Timestamp(SLiSZu5nk7Kn[ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(48), 0o10)], tz=xafqLlk3kkUe(SXOLrMavuUCe(b'\xbft\x84'), '\144' + chr(0b1100101) + '\143' + '\157' + '\x64' + chr(7571 - 7470))(chr(0b1110101) + chr(116) + chr(0b110111 + 0o57) + '\055' + chr(2145 - 2089))), dubtF9GfzOdC.Timestamp(SLiSZu5nk7Kn[-ehT0Px3KOsy9(chr(0b110000) + chr(0b11000 + 0o127) + '\x31', 8)], tz=xafqLlk3kkUe(SXOLrMavuUCe(b'\xbft\x84'), chr(0b1100100) + chr(101) + chr(0b1100010 + 0o1) + chr(9626 - 9515) + '\144' + '\145')(chr(0b1110101) + chr(0b1010110 + 0o36) + chr(174 - 72) + chr(0b101101) + chr(580 - 524))), u2Kaqkwmtp37)
myi21TFXPj4x = WqUC3KWvYVup.searchsorted(SLiSZu5nk7Kn, cFAyuTNKZHE5.ex_date.SPnCNu54H1db)
Iz1jSgUKZDvt = myi21TFXPj4x > ehT0Px3KOsy9('\060' + chr(0b1101100 + 0o3) + chr(0b100111 + 0o11), 8)
myi21TFXPj4x = myi21TFXPj4x[Iz1jSgUKZDvt]
sC8rSpE1vhOk = sC8rSpE1vhOk[Iz1jSgUKZDvt]
Bybq1_0BWrN5 = cFAyuTNKZHE5.ex_date.SPnCNu54H1db[Iz1jSgUKZDvt]
aHd06fKnJ9RQ = MkcqzDT3iB5h[myi21TFXPj4x - ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31', 8), sC8rSpE1vhOk]
G8Ebm1pTjdQZ = G8Ebm1pTjdQZ[Iz1jSgUKZDvt]
V8Id9YsEjPSB = cFAyuTNKZHE5.amount.SPnCNu54H1db[Iz1jSgUKZDvt]
pyiPBPsXZj35 = 1.0 - V8Id9YsEjPSB / aHd06fKnJ9RQ
WdBnaNijCPKD = ~WqUC3KWvYVup.wN4RVZAxJEhp(pyiPBPsXZj35)
for NhWUxmSUCcoW in xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8cL\xa6/\x16:\xcfT\xcd5\xf5'), chr(7601 - 7501) + chr(0b1100000 + 0o5) + chr(9133 - 9034) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(7489 - 7372) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b1100 + 0o54)))(~WdBnaNijCPKD):
xafqLlk3kkUe(WHAFymdp8Jcy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x84d\x8256\x17\xc0L\xee\t\xd1\x8b'), chr(0b1100100) + '\145' + chr(7716 - 7617) + chr(0b1001001 + 0o46) + chr(2419 - 2319) + chr(101))(chr(117) + chr(7168 - 7052) + chr(102) + chr(623 - 578) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa9O\xb27\x1c;\x86Z\x88$\xf5\x8b<=1\xeb\x81\xaaS\x86\xd5\xa2\xbe]\xc2\xef\x05\xf7\x85\x05=y\xfcy\x93@\t\xe1\xe3\x03\x91S\xae?\x05y\x81K\xd0\x18\xfe\x878-x\xf5\xc4\xa0m\x96\xdd\xb9\xfb\x01\x88\xc4\x08\xb6\x81^qy\xe4;\xd7\x01\x17\xe7\xf2P\x9e\x1d\xbc:\x15:\xd4@\xdc}\xb4\xd5*5'), chr(0b10010 + 0o122) + '\x65' + chr(0b111110 + 0o45) + chr(111) + chr(3306 - 3206) + '\x65')(chr(0b1001 + 0o154) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(0b101011 + 0o15)), sid=G8Ebm1pTjdQZ[NhWUxmSUCcoW], ex_date=xafqLlk3kkUe(dubtF9GfzOdC, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbeI\xaa>\x0b!\xc0C\xd8'), '\x64' + chr(0b10000 + 0o125) + '\x63' + chr(11760 - 11649) + chr(100) + '\x65')(chr(7139 - 7022) + chr(116) + '\146' + '\055' + chr(0b100011 + 0o25)))(Bybq1_0BWrN5[NhWUxmSUCcoW]), amount=V8Id9YsEjPSB[NhWUxmSUCcoW])
fwaPvMBlGqCr = pyiPBPsXZj35 > ehT0Px3KOsy9('\x30' + chr(111) + chr(48), 8)
for NhWUxmSUCcoW in xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8cL\xa6/\x16:\xcfT\xcd5\xf5'), chr(0b100110 + 0o76) + chr(101) + chr(0b110000 + 0o63) + chr(0b111011 + 0o64) + '\x64' + chr(0b111111 + 0o46))(chr(7639 - 7522) + '\164' + chr(0b1100110) + '\055' + chr(0b110101 + 0o3)))(~fwaPvMBlGqCr & WdBnaNijCPKD):
xafqLlk3kkUe(WHAFymdp8Jcy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x84d\x8256\x17\xc0L\xee\t\xd1\x8b'), chr(7953 - 7853) + chr(101) + '\x63' + chr(0b100001 + 0o116) + chr(0b1010000 + 0o24) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(1441 - 1385)))(xafqLlk3kkUe(SXOLrMavuUCe(b"\xaeI\xb12\x1c0\xcfJ\x885\xfb\x92%'e\xb2\x9c\xf8\x02\xd2\xda\xa2\xec\x1b\xc9\xf4S\xfa\x88\x16:y\xb9d\x9e\x04G\xf3\xf4W\x8e]\xeb{\x1d-\xfeJ\xc93\xff\xdb7-=\xd1\xc5\xb9F\x97\x86\xe8\xc7\x16\x88\xf0\x08\xb6\x88\x0ex=\xf8z\x98\x15\x14\xfc\xbaE\x8bM\xa8.\x16!\x9b\x00\x9b!\xe7"), chr(0b101101 + 0o67) + '\145' + chr(5026 - 4927) + chr(0b1101111) + chr(0b1000010 + 0o42) + '\145')('\x75' + chr(3666 - 3550) + chr(0b10 + 0o144) + '\055' + chr(968 - 912)), sid=G8Ebm1pTjdQZ[NhWUxmSUCcoW], ex_date=xafqLlk3kkUe(dubtF9GfzOdC, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbeI\xaa>\x0b!\xc0C\xd8'), chr(760 - 660) + chr(101) + chr(8526 - 8427) + chr(111) + chr(0b110010 + 0o62) + chr(0b11111 + 0o106))('\x75' + chr(116) + chr(102) + '\055' + '\070'))(Bybq1_0BWrN5[NhWUxmSUCcoW]), amount=V8Id9YsEjPSB[NhWUxmSUCcoW])
W6X3mt7IzaoP = WdBnaNijCPKD & fwaPvMBlGqCr
return xafqLlk3kkUe(dubtF9GfzOdC, xafqLlk3kkUe(SXOLrMavuUCe(b"\xaeA\xb3:>'\xc0C\xcd"), '\x64' + chr(2169 - 2068) + '\143' + chr(0b1101000 + 0o7) + chr(1300 - 1200) + '\x65')('\x75' + chr(881 - 765) + chr(0b1011101 + 0o11) + chr(534 - 489) + '\070'))({xafqLlk3kkUe(SXOLrMavuUCe(b'\x99I\xa3'), chr(100) + '\x65' + '\143' + chr(0b1101111) + chr(765 - 665) + chr(101))('\165' + chr(116) + chr(5050 - 4948) + '\055' + chr(0b111000)): G8Ebm1pTjdQZ[W6X3mt7IzaoP], xafqLlk3kkUe(SXOLrMavuUCe(b'\x8fF\xa1>\x1b!\xc8X\xcd\x18\xfe\x878-'), chr(0b101001 + 0o73) + '\145' + chr(0b1001111 + 0o24) + chr(0b11111 + 0o120) + chr(1476 - 1376) + '\x65')(chr(117) + chr(0b111101 + 0o67) + chr(8059 - 7957) + chr(0b100011 + 0o12) + chr(0b110100 + 0o4)): Bybq1_0BWrN5[W6X3mt7IzaoP], xafqLlk3kkUe(SXOLrMavuUCe(b'\x98A\xb32\x17'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(101))(chr(117) + chr(116) + '\x66' + chr(0b101101) + chr(0b10001 + 0o47)): pyiPBPsXZj35[W6X3mt7IzaoP]})
|
quantopian/zipline
|
zipline/data/adjustments.py
|
SQLiteAdjustmentWriter.write_dividend_data
|
def write_dividend_data(self, dividends, stock_dividends=None):
"""
Write both dividend payouts and the derived price adjustment ratios.
"""
# First write the dividend payouts.
self._write_dividends(dividends)
self._write_stock_dividends(stock_dividends)
# Second from the dividend payouts, calculate ratios.
dividend_ratios = self.calc_dividend_ratios(dividends)
self.write_frame('dividends', dividend_ratios)
|
python
|
def write_dividend_data(self, dividends, stock_dividends=None):
"""
Write both dividend payouts and the derived price adjustment ratios.
"""
# First write the dividend payouts.
self._write_dividends(dividends)
self._write_stock_dividends(stock_dividends)
# Second from the dividend payouts, calculate ratios.
dividend_ratios = self.calc_dividend_ratios(dividends)
self.write_frame('dividends', dividend_ratios)
|
[
"def",
"write_dividend_data",
"(",
"self",
",",
"dividends",
",",
"stock_dividends",
"=",
"None",
")",
":",
"# First write the dividend payouts.",
"self",
".",
"_write_dividends",
"(",
"dividends",
")",
"self",
".",
"_write_stock_dividends",
"(",
"stock_dividends",
")",
"# Second from the dividend payouts, calculate ratios.",
"dividend_ratios",
"=",
"self",
".",
"calc_dividend_ratios",
"(",
"dividends",
")",
"self",
".",
"write_frame",
"(",
"'dividends'",
",",
"dividend_ratios",
")"
] |
Write both dividend payouts and the derived price adjustment ratios.
|
[
"Write",
"both",
"dividend",
"payouts",
"and",
"the",
"derived",
"price",
"adjustment",
"ratios",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/adjustments.py#L570-L581
|
train
|
Write the dividend payouts and the derived price adjustment ratios.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbN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YhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + '\063' + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110001 + 0o76) + chr(0b101001 + 0o10) + chr(48) + chr(0b110000), 6735 - 6727), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + chr(0b101010 + 0o15) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + '\065' + chr(2675 - 2623), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b10100 + 0o133) + chr(2411 - 2360) + chr(49) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(135 - 87) + chr(111) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x37' + chr(1763 - 1713), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + '\x31' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(982 - 934) + '\x6f' + chr(0b10100 + 0o35) + chr(0b1011 + 0o46) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + '\065' + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10001 + 0o136) + chr(50) + chr(1024 - 973) + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(74 - 25) + '\x36' + chr(910 - 859), 0b1000), ehT0Px3KOsy9(chr(2182 - 2134) + chr(5387 - 5276) + chr(1556 - 1507) + chr(0b110000) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2026 - 1976) + chr(141 - 87) + chr(0b1111 + 0o46), 0o10), ehT0Px3KOsy9(chr(1903 - 1855) + chr(0b1101111) + chr(49) + chr(0b110001) + chr(51), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + '\066' + chr(0b1010 + 0o47), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(0b110010), 37428 - 37420), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(111) + chr(0b110001) + chr(0b101100 + 0o7) + '\x37', 60706 - 60698), ehT0Px3KOsy9('\060' + chr(111) + '\062' + '\066' + chr(1069 - 1018), 59214 - 59206), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(0b110111) + '\066', 26229 - 26221), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(631 - 578) + chr(0b110001), 19785 - 19777), ehT0Px3KOsy9(chr(48) + chr(0b10111 + 0o130) + chr(0b110011) + '\x36' + chr(530 - 477), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(1767 - 1718) + chr(0b10101 + 0o33), 42300 - 42292), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(0b101001 + 0o10), 0b1000), ehT0Px3KOsy9(chr(1027 - 979) + '\x6f' + chr(0b11111 + 0o24) + chr(49) + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + chr(9316 - 9205) + chr(2191 - 2142) + chr(0b110010) + '\x37', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(885 - 835) + chr(55) + chr(0b11010 + 0o32), 0o10), ehT0Px3KOsy9(chr(1460 - 1412) + chr(111) + chr(1815 - 1765) + '\065' + chr(733 - 683), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(1792 - 1740) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(874 - 826) + chr(0b101100 + 0o103) + chr(54) + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(6597 - 6486) + chr(0b110010) + '\066' + chr(50), 0b1000), ehT0Px3KOsy9(chr(1841 - 1793) + chr(0b110011 + 0o74) + '\061' + '\065' + '\x30', 0o10), ehT0Px3KOsy9(chr(243 - 195) + chr(0b1101111) + chr(0b11111 + 0o22) + chr(0b1110 + 0o45) + chr(0b1011 + 0o54), 8), ehT0Px3KOsy9('\060' + chr(11650 - 11539) + chr(514 - 463) + chr(49) + chr(0b111 + 0o55), 39269 - 39261), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010010 + 0o35) + chr(934 - 885) + chr(0b110101) + chr(55), 0o10), ehT0Px3KOsy9(chr(196 - 148) + '\x6f' + '\x31' + '\067' + '\x34', 15073 - 15065), ehT0Px3KOsy9(chr(588 - 540) + chr(0b1101111) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(0b100000 + 0o23) + chr(2012 - 1960) + chr(0b100001 + 0o25), ord("\x08")), ehT0Px3KOsy9(chr(395 - 347) + '\x6f' + chr(75 - 20) + chr(2153 - 2101), 0b1000), ehT0Px3KOsy9(chr(1019 - 971) + chr(0b1101111) + '\062' + chr(0b111 + 0o51) + '\x32', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + chr(53) + chr(1620 - 1572), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'3'), chr(0b1100100) + '\145' + chr(99) + chr(111) + '\x64' + chr(3346 - 3245))('\165' + chr(0b1110 + 0o146) + chr(102) + chr(45) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def MCbUzxKYpbzw(oVre8I6UXc3b, cFAyuTNKZHE5, tMLaJ0QC_qNS=None):
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'B7H\xc5\xbege\xef"\xdd\xf2\x17!\xdb/\xc2'), chr(100) + chr(6270 - 6169) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(7100 - 6999))(chr(8893 - 8776) + '\164' + chr(0b1100110) + '\x2d' + '\070'))(cFAyuTNKZHE5)
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'B7H\xc5\xbege\xf8?\xc4\xf8\x18\x1b\xd1"\xc7c;\xd6\xd0M\x86'), '\144' + chr(0b1100101) + chr(99) + '\157' + '\144' + '\x65')(chr(9043 - 8926) + chr(0b1001010 + 0o52) + '\x66' + '\055' + '\x38'))(tMLaJ0QC_qNS)
Yh_jGqSdlaTe = oVre8I6UXc3b.calc_dividend_ratios(cFAyuTNKZHE5)
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'j2S\xd8\xaf]\\\xf9*\xc6\xfe'), chr(1973 - 1873) + chr(0b1000100 + 0o41) + chr(0b111 + 0o134) + chr(0b1101111) + chr(9763 - 9663) + '\x65')(chr(117) + chr(116) + chr(2016 - 1914) + chr(1743 - 1698) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'y)L\xc5\xaegT\xef8'), chr(0b1100100) + '\145' + chr(99) + '\157' + chr(0b1100100) + '\x65')(chr(117) + chr(0b1110100) + chr(0b1100110) + '\055' + '\070'), Yh_jGqSdlaTe)
|
quantopian/zipline
|
zipline/data/adjustments.py
|
SQLiteAdjustmentWriter.write
|
def write(self,
splits=None,
mergers=None,
dividends=None,
stock_dividends=None):
"""
Writes data to a SQLite file to be read by SQLiteAdjustmentReader.
Parameters
----------
splits : pandas.DataFrame, optional
Dataframe containing split data. The format of this dataframe is:
effective_date : int
The date, represented as seconds since Unix epoch, on which
the adjustment should be applied.
ratio : float
A value to apply to all data earlier than the effective date.
For open, high, low, and close those values are multiplied by
the ratio. Volume is divided by this value.
sid : int
The asset id associated with this adjustment.
mergers : pandas.DataFrame, optional
DataFrame containing merger data. The format of this dataframe is:
effective_date : int
The date, represented as seconds since Unix epoch, on which
the adjustment should be applied.
ratio : float
A value to apply to all data earlier than the effective date.
For open, high, low, and close those values are multiplied by
the ratio. Volume is unaffected.
sid : int
The asset id associated with this adjustment.
dividends : pandas.DataFrame, optional
DataFrame containing dividend data. The format of the dataframe is:
sid : int
The asset id associated with this adjustment.
ex_date : datetime64
The date on which an equity must be held to be eligible to
receive payment.
declared_date : datetime64
The date on which the dividend is announced to the public.
pay_date : datetime64
The date on which the dividend is distributed.
record_date : datetime64
The date on which the stock ownership is checked to determine
distribution of dividends.
amount : float
The cash amount paid for each share.
Dividend ratios are calculated as:
``1.0 - (dividend_value / "close on day prior to ex_date")``
stock_dividends : pandas.DataFrame, optional
DataFrame containing stock dividend data. The format of the
dataframe is:
sid : int
The asset id associated with this adjustment.
ex_date : datetime64
The date on which an equity must be held to be eligible to
receive payment.
declared_date : datetime64
The date on which the dividend is announced to the public.
pay_date : datetime64
The date on which the dividend is distributed.
record_date : datetime64
The date on which the stock ownership is checked to determine
distribution of dividends.
payment_sid : int
The asset id of the shares that should be paid instead of
cash.
ratio : float
The ratio of currently held shares in the held sid that
should be paid with new shares of the payment_sid.
See Also
--------
zipline.data.adjustments.SQLiteAdjustmentReader
"""
self.write_frame('splits', splits)
self.write_frame('mergers', mergers)
self.write_dividend_data(dividends, stock_dividends)
# Use IF NOT EXISTS here to allow multiple writes if desired.
self.conn.execute(
"CREATE INDEX IF NOT EXISTS splits_sids "
"ON splits(sid)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS splits_effective_date "
"ON splits(effective_date)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS mergers_sids "
"ON mergers(sid)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS mergers_effective_date "
"ON mergers(effective_date)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS dividends_sid "
"ON dividends(sid)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS dividends_effective_date "
"ON dividends(effective_date)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS dividend_payouts_sid "
"ON dividend_payouts(sid)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS dividends_payouts_ex_date "
"ON dividend_payouts(ex_date)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS stock_dividend_payouts_sid "
"ON stock_dividend_payouts(sid)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS stock_dividends_payouts_ex_date "
"ON stock_dividend_payouts(ex_date)"
)
|
python
|
def write(self,
splits=None,
mergers=None,
dividends=None,
stock_dividends=None):
"""
Writes data to a SQLite file to be read by SQLiteAdjustmentReader.
Parameters
----------
splits : pandas.DataFrame, optional
Dataframe containing split data. The format of this dataframe is:
effective_date : int
The date, represented as seconds since Unix epoch, on which
the adjustment should be applied.
ratio : float
A value to apply to all data earlier than the effective date.
For open, high, low, and close those values are multiplied by
the ratio. Volume is divided by this value.
sid : int
The asset id associated with this adjustment.
mergers : pandas.DataFrame, optional
DataFrame containing merger data. The format of this dataframe is:
effective_date : int
The date, represented as seconds since Unix epoch, on which
the adjustment should be applied.
ratio : float
A value to apply to all data earlier than the effective date.
For open, high, low, and close those values are multiplied by
the ratio. Volume is unaffected.
sid : int
The asset id associated with this adjustment.
dividends : pandas.DataFrame, optional
DataFrame containing dividend data. The format of the dataframe is:
sid : int
The asset id associated with this adjustment.
ex_date : datetime64
The date on which an equity must be held to be eligible to
receive payment.
declared_date : datetime64
The date on which the dividend is announced to the public.
pay_date : datetime64
The date on which the dividend is distributed.
record_date : datetime64
The date on which the stock ownership is checked to determine
distribution of dividends.
amount : float
The cash amount paid for each share.
Dividend ratios are calculated as:
``1.0 - (dividend_value / "close on day prior to ex_date")``
stock_dividends : pandas.DataFrame, optional
DataFrame containing stock dividend data. The format of the
dataframe is:
sid : int
The asset id associated with this adjustment.
ex_date : datetime64
The date on which an equity must be held to be eligible to
receive payment.
declared_date : datetime64
The date on which the dividend is announced to the public.
pay_date : datetime64
The date on which the dividend is distributed.
record_date : datetime64
The date on which the stock ownership is checked to determine
distribution of dividends.
payment_sid : int
The asset id of the shares that should be paid instead of
cash.
ratio : float
The ratio of currently held shares in the held sid that
should be paid with new shares of the payment_sid.
See Also
--------
zipline.data.adjustments.SQLiteAdjustmentReader
"""
self.write_frame('splits', splits)
self.write_frame('mergers', mergers)
self.write_dividend_data(dividends, stock_dividends)
# Use IF NOT EXISTS here to allow multiple writes if desired.
self.conn.execute(
"CREATE INDEX IF NOT EXISTS splits_sids "
"ON splits(sid)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS splits_effective_date "
"ON splits(effective_date)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS mergers_sids "
"ON mergers(sid)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS mergers_effective_date "
"ON mergers(effective_date)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS dividends_sid "
"ON dividends(sid)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS dividends_effective_date "
"ON dividends(effective_date)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS dividend_payouts_sid "
"ON dividend_payouts(sid)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS dividends_payouts_ex_date "
"ON dividend_payouts(ex_date)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS stock_dividend_payouts_sid "
"ON stock_dividend_payouts(sid)"
)
self.conn.execute(
"CREATE INDEX IF NOT EXISTS stock_dividends_payouts_ex_date "
"ON stock_dividend_payouts(ex_date)"
)
|
[
"def",
"write",
"(",
"self",
",",
"splits",
"=",
"None",
",",
"mergers",
"=",
"None",
",",
"dividends",
"=",
"None",
",",
"stock_dividends",
"=",
"None",
")",
":",
"self",
".",
"write_frame",
"(",
"'splits'",
",",
"splits",
")",
"self",
".",
"write_frame",
"(",
"'mergers'",
",",
"mergers",
")",
"self",
".",
"write_dividend_data",
"(",
"dividends",
",",
"stock_dividends",
")",
"# Use IF NOT EXISTS here to allow multiple writes if desired.",
"self",
".",
"conn",
".",
"execute",
"(",
"\"CREATE INDEX IF NOT EXISTS splits_sids \"",
"\"ON splits(sid)\"",
")",
"self",
".",
"conn",
".",
"execute",
"(",
"\"CREATE INDEX IF NOT EXISTS splits_effective_date \"",
"\"ON splits(effective_date)\"",
")",
"self",
".",
"conn",
".",
"execute",
"(",
"\"CREATE INDEX IF NOT EXISTS mergers_sids \"",
"\"ON mergers(sid)\"",
")",
"self",
".",
"conn",
".",
"execute",
"(",
"\"CREATE INDEX IF NOT EXISTS mergers_effective_date \"",
"\"ON mergers(effective_date)\"",
")",
"self",
".",
"conn",
".",
"execute",
"(",
"\"CREATE INDEX IF NOT EXISTS dividends_sid \"",
"\"ON dividends(sid)\"",
")",
"self",
".",
"conn",
".",
"execute",
"(",
"\"CREATE INDEX IF NOT EXISTS dividends_effective_date \"",
"\"ON dividends(effective_date)\"",
")",
"self",
".",
"conn",
".",
"execute",
"(",
"\"CREATE INDEX IF NOT EXISTS dividend_payouts_sid \"",
"\"ON dividend_payouts(sid)\"",
")",
"self",
".",
"conn",
".",
"execute",
"(",
"\"CREATE INDEX IF NOT EXISTS dividends_payouts_ex_date \"",
"\"ON dividend_payouts(ex_date)\"",
")",
"self",
".",
"conn",
".",
"execute",
"(",
"\"CREATE INDEX IF NOT EXISTS stock_dividend_payouts_sid \"",
"\"ON stock_dividend_payouts(sid)\"",
")",
"self",
".",
"conn",
".",
"execute",
"(",
"\"CREATE INDEX IF NOT EXISTS stock_dividends_payouts_ex_date \"",
"\"ON stock_dividend_payouts(ex_date)\"",
")"
] |
Writes data to a SQLite file to be read by SQLiteAdjustmentReader.
Parameters
----------
splits : pandas.DataFrame, optional
Dataframe containing split data. The format of this dataframe is:
effective_date : int
The date, represented as seconds since Unix epoch, on which
the adjustment should be applied.
ratio : float
A value to apply to all data earlier than the effective date.
For open, high, low, and close those values are multiplied by
the ratio. Volume is divided by this value.
sid : int
The asset id associated with this adjustment.
mergers : pandas.DataFrame, optional
DataFrame containing merger data. The format of this dataframe is:
effective_date : int
The date, represented as seconds since Unix epoch, on which
the adjustment should be applied.
ratio : float
A value to apply to all data earlier than the effective date.
For open, high, low, and close those values are multiplied by
the ratio. Volume is unaffected.
sid : int
The asset id associated with this adjustment.
dividends : pandas.DataFrame, optional
DataFrame containing dividend data. The format of the dataframe is:
sid : int
The asset id associated with this adjustment.
ex_date : datetime64
The date on which an equity must be held to be eligible to
receive payment.
declared_date : datetime64
The date on which the dividend is announced to the public.
pay_date : datetime64
The date on which the dividend is distributed.
record_date : datetime64
The date on which the stock ownership is checked to determine
distribution of dividends.
amount : float
The cash amount paid for each share.
Dividend ratios are calculated as:
``1.0 - (dividend_value / "close on day prior to ex_date")``
stock_dividends : pandas.DataFrame, optional
DataFrame containing stock dividend data. The format of the
dataframe is:
sid : int
The asset id associated with this adjustment.
ex_date : datetime64
The date on which an equity must be held to be eligible to
receive payment.
declared_date : datetime64
The date on which the dividend is announced to the public.
pay_date : datetime64
The date on which the dividend is distributed.
record_date : datetime64
The date on which the stock ownership is checked to determine
distribution of dividends.
payment_sid : int
The asset id of the shares that should be paid instead of
cash.
ratio : float
The ratio of currently held shares in the held sid that
should be paid with new shares of the payment_sid.
See Also
--------
zipline.data.adjustments.SQLiteAdjustmentReader
|
[
"Writes",
"data",
"to",
"a",
"SQLite",
"file",
"to",
"be",
"read",
"by",
"SQLiteAdjustmentReader",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/adjustments.py#L583-L703
|
train
|
Writes data to a SQLite file.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx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FiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1010010 + 0o35) + '\061' + chr(0b110111) + chr(0b110011), 12955 - 12947), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + '\064' + chr(0b110010), 634 - 626), ehT0Px3KOsy9('\060' + chr(0b100010 + 0o115) + chr(54), 58014 - 58006), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1967 - 1916) + chr(0b1010 + 0o55) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(9448 - 9337) + chr(0b11110 + 0o24) + chr(1100 - 1050) + chr(0b111 + 0o56), 2122 - 2114), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(0b110100) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + chr(1697 - 1643) + '\x33', 0b1000), ehT0Px3KOsy9(chr(1284 - 1236) + '\x6f' + '\064' + chr(0b11111 + 0o22), ord("\x08")), ehT0Px3KOsy9(chr(644 - 596) + '\x6f' + chr(49) + chr(0b1100 + 0o50) + chr(0b10100 + 0o43), 0b1000), ehT0Px3KOsy9(chr(1475 - 1427) + '\x6f' + chr(0b110010) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1101111) + chr(52) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10 + 0o60) + '\066' + '\067', 21182 - 21174), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110100) + chr(55), 55364 - 55356), ehT0Px3KOsy9('\x30' + chr(111) + chr(2060 - 2009), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b1001 + 0o51) + chr(0b100111 + 0o14) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b0 + 0o157) + chr(1638 - 1587) + '\064' + chr(1725 - 1677), 0o10), ehT0Px3KOsy9('\060' + chr(11367 - 11256) + chr(0b11111 + 0o24) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\067', 13851 - 13843), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100101 + 0o14) + '\x34', 55263 - 55255), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(0b110011) + chr(0b110010), 9074 - 9066), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b110000) + chr(0b110001), 45849 - 45841), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1154 - 1103) + chr(0b111 + 0o53) + chr(770 - 722), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b110110) + chr(0b1001 + 0o55), 54966 - 54958), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + '\065' + chr(950 - 897), 6832 - 6824), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100 + 0o56) + chr(0b10110 + 0o37) + chr(0b110000), 17102 - 17094), ehT0Px3KOsy9(chr(2082 - 2034) + chr(0b1101111) + chr(2387 - 2338) + chr(0b110100) + chr(559 - 506), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b100100 + 0o15) + chr(0b10 + 0o56), 0b1000), ehT0Px3KOsy9(chr(1763 - 1715) + chr(3817 - 3706) + chr(0b10011 + 0o42) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + '\060' + chr(53), 53692 - 53684), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(0b110010) + '\x30', 57646 - 57638), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(1862 - 1812) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(56 - 8) + chr(0b1101111) + chr(0b110 + 0o55) + '\067' + chr(0b1010 + 0o55), 61198 - 61190), ehT0Px3KOsy9(chr(48) + chr(10974 - 10863) + '\063' + chr(0b100110 + 0o13) + chr(0b1110 + 0o45), 34449 - 34441), ehT0Px3KOsy9(chr(269 - 221) + chr(4090 - 3979) + '\x32' + chr(0b110 + 0o61) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101010 + 0o5) + chr(1176 - 1125) + '\x30' + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + '\x36' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(52) + chr(55), 8), ehT0Px3KOsy9(chr(48) + chr(3391 - 3280) + chr(50) + chr(0b101011 + 0o12) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1992 - 1881) + chr(51) + chr(0b110011) + '\062', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(120 - 67) + chr(53), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1164 - 1116) + chr(1296 - 1185) + chr(79 - 26) + '\060', 59674 - 59666)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'U'), chr(0b111100 + 0o50) + chr(101) + chr(99) + chr(0b11010 + 0o125) + '\144' + chr(101))(chr(117) + chr(4236 - 4120) + chr(0b1100110) + '\055' + chr(0b110101 + 0o3)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def QywlqEoQilJa(oVre8I6UXc3b, uSBCRSw0LUmo=None, iHLzVNPzXcKD=None, cFAyuTNKZHE5=None, tMLaJ0QC_qNS=None):
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\x90o\x89\xf0\xfe\xd5S\x06}@'), chr(8082 - 7982) + '\x65' + chr(0b1100011) + chr(2190 - 2079) + chr(0b1100100) + '\145')(chr(117) + chr(5705 - 5589) + chr(3617 - 3515) + chr(0b101101) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x08\x92j\x94\xe1\xd2'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(0b1101111) + '\x64' + '\x65')(chr(0b10010 + 0o143) + '\164' + '\x66' + '\055' + chr(0b111000)), uSBCRSw0LUmo)
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\x90o\x89\xf0\xfe\xd5S\x06}@'), '\x64' + chr(101) + chr(8623 - 8524) + chr(6259 - 6148) + chr(0b1011101 + 0o7) + chr(101))(chr(4659 - 4542) + chr(0b1110100) + chr(0b100 + 0o142) + chr(1399 - 1354) + chr(0b110011 + 0o5)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x16\x87t\x9a\xf0\xd3\xc0'), chr(3038 - 2938) + chr(101) + chr(99) + chr(0b1101111) + chr(100) + '\x65')('\x75' + chr(0b11101 + 0o127) + '\146' + '\x2d' + '\070'), iHLzVNPzXcKD)
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\x90o\x89\xf0\xfe\xd7H\x11yA\xd2Ig\xc7\x84~sm'), chr(5027 - 4927) + chr(0b10011 + 0o122) + chr(4401 - 4302) + '\157' + '\144' + chr(7612 - 7511))('\x75' + chr(0b1100110 + 0o16) + chr(102) + '\x2d' + chr(0b1111 + 0o51)))(cFAyuTNKZHE5, tMLaJ0QC_qNS)
xafqLlk3kkUe(oVre8I6UXc3b.conn, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\x9ac\x9e\xe0\xd5\xd6'), '\144' + chr(101) + chr(3343 - 3244) + chr(2573 - 2462) + chr(100) + chr(0b1010011 + 0o22))(chr(2592 - 2475) + chr(0b10101 + 0o137) + chr(0b101100 + 0o72) + '\055' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'8\xb0C\xbc\xc1\xe4\x93h)T`\xef\x07J\xde\xc0QHX\xfa\x04\x88\xff>\xfc6(\\5<\xbc\x8b\xb8\xe6\xb2\x18C\xdc\xfab5\xc2u\x8d\xf9\xc8\xc7ROcL\xd3\x0e'), chr(1338 - 1238) + chr(0b101101 + 0o70) + '\x63' + '\x6f' + chr(7777 - 7677) + chr(101))(chr(117) + chr(3168 - 3052) + '\146' + '\055' + '\x38'))
xafqLlk3kkUe(oVre8I6UXc3b.conn, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\x9ac\x9e\xe0\xd5\xd6'), chr(100) + chr(6543 - 6442) + '\x63' + '\157' + chr(0b1100100) + chr(101))('\165' + chr(0b1100011 + 0o21) + chr(0b1100110) + chr(1115 - 1070) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b"8\xb0C\xbc\xc1\xe4\x93h)T`\xef\x07J\xde\xc0QHX\xfa\x04\x88\xff>\xfc6(\\5<\xbc\x8b\xb8\xe6\xa4\x17A\xca\xb9Y\x12\x94c\xa2\xf1\xc0\xc7DG_k\x97Ts\xf4\x89kt$\xbf'\xb6\xd3\x0e\xdc\x0c~J\x1a4\xb4\x8b\xae\x90"), chr(1541 - 1441) + chr(6796 - 6695) + chr(0b1100011) + '\x6f' + chr(100) + chr(0b1010111 + 0o16))('\x75' + chr(0b110010 + 0o102) + chr(9564 - 9462) + '\x2d' + '\x38'))
xafqLlk3kkUe(oVre8I6UXc3b.conn, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\x9ac\x9e\xe0\xd5\xd6'), chr(9649 - 9549) + chr(101) + chr(5936 - 5837) + chr(111) + chr(100) + chr(101))('\x75' + chr(9526 - 9410) + chr(0b1100110) + '\x2d' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'8\xb0C\xbc\xc1\xe4\x93h)T`\xef\x07J\xde\xc0QHX\xfa\x04\x88\xff>\xfc6(B "\xb2\x9a\xb9\xca\x9e\x02N\xcb\xa9\r4\xac&\x90\xf0\xd3\xd4D\x15c\r\xc4Ng\xb1'), chr(0b1100100) + chr(0b1100101) + chr(7974 - 7875) + chr(0b101111 + 0o100) + chr(698 - 598) + '\x65')(chr(117) + chr(2122 - 2006) + chr(0b1100110) + '\055' + '\x38'))
xafqLlk3kkUe(oVre8I6UXc3b.conn, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\x9ac\x9e\xe0\xd5\xd6'), '\144' + chr(7142 - 7041) + chr(1093 - 994) + '\x6f' + '\144' + '\145')(chr(4682 - 4565) + chr(116) + '\146' + chr(45) + chr(0b100100 + 0o24)))(xafqLlk3kkUe(SXOLrMavuUCe(b'8\xb0C\xbc\xc1\xe4\x93h)T`\xef\x07J\xde\xc0QHX\xfa\x04\x88\xff>\xfc6(B "\xb2\x9a\xb9\xca\x9e\x14A\xc9\xbfN\x0f\x8bp\x98\xca\xc5\xd2U\x020j\xf9\x07n\xfd\x92xb~\xa9i\xb5\xd0\x0b\xcd\x06|F35\x8a\x9b\xaa\xcd\xa4X'), '\144' + chr(7805 - 7704) + chr(0b1010111 + 0o14) + chr(1544 - 1433) + chr(9111 - 9011) + chr(0b101011 + 0o72))('\165' + chr(116) + '\x66' + '\x2d' + chr(0b100011 + 0o25)))
xafqLlk3kkUe(oVre8I6UXc3b.conn, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\x9ac\x9e\xe0\xd5\xd6'), chr(282 - 182) + '\x65' + chr(0b1100011) + chr(111) + chr(9574 - 9474) + chr(101))(chr(117) + '\x74' + chr(0b1100110) + '\x2d' + chr(2696 - 2640)))(xafqLlk3kkUe(SXOLrMavuUCe(b'8\xb0C\xbc\xc1\xe4\x93h)T`\xef\x07J\xde\xc0QHX\xfa\x04\x88\xff>\xfc6(K,&\xbc\x9b\xae\xd7\xa5\x02x\xdc\xb3I[\xadH\xdd\xf1\xc8\xc5H\x03uK\xd3T+\xeb\x89{.'), chr(0b10 + 0o142) + chr(101) + chr(0b1010100 + 0o17) + chr(0b110110 + 0o71) + chr(0b1000000 + 0o44) + '\145')('\x75' + chr(0b1110100) + chr(0b11000 + 0o116) + chr(0b101101) + chr(0b1000 + 0o60)))
xafqLlk3kkUe(oVre8I6UXc3b.conn, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\x9ac\x9e\xe0\xd5\xd6'), chr(5122 - 5022) + chr(5833 - 5732) + '\143' + '\x6f' + '\144' + chr(0b110001 + 0o64))('\165' + '\164' + '\x66' + chr(45) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'8\xb0C\xbc\xc1\xe4\x93h)T`\xef\x07J\xde\xc0QHX\xfa\x04\x88\xff>\xfc6(K,&\xbc\x9b\xae\xd7\xa5\x02x\xca\xbcK\x1e\x81r\x94\xe3\xc4\xecE\x06d@\x97hM\xb8\x84vqe\xbe$\xbe\xd2\x1e\x80\x00nI 3\xa1\x96\xbd\xdc\x9e\x15F\xdb\xbf\x04'), '\x64' + chr(3863 - 3762) + chr(0b10100 + 0o117) + chr(111) + '\x64' + chr(8848 - 8747))(chr(1864 - 1747) + '\x74' + '\x66' + chr(0b101101) + chr(2165 - 2109)))
xafqLlk3kkUe(oVre8I6UXc3b.conn, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\x9ac\x9e\xe0\xd5\xd6'), chr(0b1010 + 0o132) + chr(0b1100101) + chr(99) + chr(813 - 702) + '\144' + chr(0b101101 + 0o70))(chr(0b1100100 + 0o21) + chr(0b111101 + 0o67) + chr(10026 - 9924) + chr(0b101101) + chr(0b110010 + 0o6)))(xafqLlk3kkUe(SXOLrMavuUCe(b'8\xb0C\xbc\xc1\xe4\x93h)T`\xef\x07J\xde\xc0QHX\xfa\x04\x88\xff>\xfc6(K,&\xbc\x9b\xae\xd7\xa5.W\xce\xa3B\x0e\x96u\xa2\xe6\xc8\xd7\x01(^\x05\xd3Nu\xf1\x84zih\x851\xb1\xcf\x02\xdd\x11{\x0769\xb1\xd6'), chr(100) + chr(0b1100 + 0o131) + chr(99) + chr(111) + chr(6278 - 6178) + chr(3346 - 3245))('\x75' + chr(0b1110100) + chr(2121 - 2019) + '\x2d' + chr(2864 - 2808)))
xafqLlk3kkUe(oVre8I6UXc3b.conn, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\x9ac\x9e\xe0\xd5\xd6'), '\144' + chr(0b110011 + 0o62) + chr(0b10110 + 0o115) + chr(11698 - 11587) + chr(0b111001 + 0o53) + chr(0b1010000 + 0o25))(chr(117) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b1011 + 0o55)))(xafqLlk3kkUe(SXOLrMavuUCe(b'8\xb0C\xbc\xc1\xe4\x93h)T`\xef\x07J\xde\xc0QHX\xfa\x04\x88\xff>\xfc6(K,&\xbc\x9b\xae\xd7\xa5\x02x\xdf\xbbT\x14\x97r\x8e\xca\xc4\xcb~\x03qQ\xd2\x07L\xd6\xc0{nz\xb3%\xb5\xd8\t\xf7\x15iV*%\xa1\x8c\xe3\xdc\xb9.C\xce\xaeHR'), chr(0b11010 + 0o112) + chr(101) + chr(99) + chr(0b11101 + 0o122) + chr(0b1100100) + chr(0b11101 + 0o110))('\165' + '\164' + '\x66' + chr(0b101101) + chr(0b110001 + 0o7)))
xafqLlk3kkUe(oVre8I6UXc3b.conn, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\x9ac\x9e\xe0\xd5\xd6'), chr(0b1100100) + '\x65' + '\143' + chr(0b1101111) + chr(0b111001 + 0o53) + chr(0b1100101))(chr(1740 - 1623) + '\x74' + '\x66' + chr(1486 - 1441) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'8\xb0C\xbc\xc1\xe4\x93h)T`\xef\x07J\xde\xc0QHX\xfa\x04\x88\xff>\xfc6(\\1?\xb6\x94\x94\xdd\xa8\x07N\xcb\xbfC\x1f\xbdv\x9c\xec\xce\xc6U\x14OV\xdeC#\xd7\xae?tx\xb5"\xbb\xe9\t\xc1\x13aK >\xb1\xa0\xbb\xd8\xb8\x1eR\xdb\xa9\x05\x08\x8bb\xd4'), '\x64' + chr(101) + '\x63' + '\x6f' + '\x64' + chr(1281 - 1180))(chr(6069 - 5952) + chr(0b1010010 + 0o42) + chr(0b1100110) + '\055' + '\070'))
xafqLlk3kkUe(oVre8I6UXc3b.conn, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\x9ac\x9e\xe0\xd5\xd6'), chr(0b1100100) + '\x65' + chr(0b10001 + 0o122) + chr(0b1100001 + 0o16) + chr(100) + '\145')('\165' + '\164' + '\x66' + chr(45) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'8\xb0C\xbc\xc1\xe4\x93h)T`\xef\x07J\xde\xc0QHX\xfa\x04\x88\xff>\xfc6(\\1?\xb6\x94\x94\xdd\xa8\x07N\xcb\xbfC\x1f\x91Y\x8d\xf4\xd8\xdcT\x13cz\xd2_\\\xfc\x81kb,\x95\x0f\xf0\xc5\x19\xc7\x06cp!9\xa3\x96\xaf\xdc\xaf\x15x\xdf\xbbT\x14\x97r\x8e\xbd\xc4\xcb~\x03qQ\xd2\x0e'), chr(2906 - 2806) + '\x65' + '\x63' + chr(0b1100001 + 0o16) + chr(0b11110 + 0o106) + chr(0b1000001 + 0o44))(chr(0b11011 + 0o132) + chr(0b101011 + 0o111) + '\146' + '\055' + chr(0b111000)))
|
quantopian/zipline
|
zipline/pipeline/mixins.py
|
CustomTermMixin.compute
|
def compute(self, today, assets, out, *arrays):
"""
Override this method with a function that writes a value into `out`.
"""
raise NotImplementedError(
"{name} must define a compute method".format(
name=type(self).__name__
)
)
|
python
|
def compute(self, today, assets, out, *arrays):
"""
Override this method with a function that writes a value into `out`.
"""
raise NotImplementedError(
"{name} must define a compute method".format(
name=type(self).__name__
)
)
|
[
"def",
"compute",
"(",
"self",
",",
"today",
",",
"assets",
",",
"out",
",",
"*",
"arrays",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"{name} must define a compute method\"",
".",
"format",
"(",
"name",
"=",
"type",
"(",
"self",
")",
".",
"__name__",
")",
")"
] |
Override this method with a function that writes a value into `out`.
|
[
"Override",
"this",
"method",
"with",
"a",
"function",
"that",
"writes",
"a",
"value",
"into",
"out",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/mixins.py#L143-L151
|
train
|
Override this method with a function that writes a value into out.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHl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RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b110111 + 0o70) + chr(510 - 460) + chr(0b10110 + 0o41) + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + '\x32', 0b1000), ehT0Px3KOsy9(chr(1349 - 1301) + '\157' + chr(0b100010 + 0o21) + '\067' + '\065', 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(9230 - 9119) + chr(0b110110) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(7656 - 7545) + '\063' + chr(0b10 + 0o64) + chr(54), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(0b110000) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(48) + chr(1473 - 1424), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(5071 - 4960) + chr(0b110011) + chr(50) + chr(0b100100 + 0o17), 31455 - 31447), ehT0Px3KOsy9('\x30' + chr(9806 - 9695) + chr(0b110011) + chr(2529 - 2475) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10000 + 0o137) + chr(51) + '\x32' + '\061', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x37' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1001100 + 0o43) + '\063' + chr(676 - 627) + chr(49), 0b1000), ehT0Px3KOsy9(chr(1163 - 1115) + chr(5158 - 5047) + chr(206 - 155) + chr(0b1000 + 0o53) + chr(52), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b11 + 0o60) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b11011 + 0o124) + chr(50) + chr(1855 - 1804) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(111) + chr(0b101010 + 0o12) + chr(0b1110 + 0o45), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(6838 - 6727) + '\x33' + '\x33' + chr(54), 0b1000), ehT0Px3KOsy9(chr(1282 - 1234) + '\x6f' + '\x34' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(1037 - 989) + chr(0b1101111) + chr(50) + chr(0b101100 + 0o7) + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(2925 - 2870) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(2380 - 2326) + '\x35', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(2329 - 2277) + chr(1150 - 1095), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11111 + 0o21), 0b1000), ehT0Px3KOsy9('\060' + chr(305 - 194) + '\062' + chr(0b110110) + '\x35', 655 - 647), ehT0Px3KOsy9('\060' + chr(111) + chr(1601 - 1551) + chr(54) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + chr(0b110011) + chr(0b11110 + 0o22) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001001 + 0o46) + chr(0b11101 + 0o24) + chr(0b110001) + '\064', 0b1000), ehT0Px3KOsy9('\060' + chr(3536 - 3425) + chr(50) + chr(0b10100 + 0o42) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101111) + chr(0b11000 + 0o32) + '\067' + chr(1201 - 1153), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + '\x36' + chr(53), 0b1000), ehT0Px3KOsy9(chr(48) + chr(6622 - 6511) + chr(0b110011) + chr(0b110010 + 0o0) + '\x31', 8), ehT0Px3KOsy9('\x30' + chr(0b1000100 + 0o53) + chr(51) + '\x35', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1000 + 0o53) + chr(0b100001 + 0o20) + chr(2190 - 2138), 574 - 566), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(0b1110 + 0o47) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(2568 - 2513) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\157' + chr(1650 - 1599) + chr(0b10111 + 0o33) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\x6f' + '\061' + chr(0b101110 + 0o6), ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(111) + chr(2039 - 1989) + chr(1439 - 1391) + chr(55), 55293 - 55285), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b110100) + chr(0b110011), 7613 - 7605), ehT0Px3KOsy9(chr(456 - 408) + chr(9361 - 9250) + '\066' + chr(1842 - 1790), 29088 - 29080)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + chr(53) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x96'), '\144' + '\145' + chr(0b1101 + 0o126) + chr(11844 - 11733) + chr(8175 - 8075) + chr(0b1100101))(chr(0b1011010 + 0o33) + '\x74' + chr(0b1100110) + '\x2d' + chr(0b101000 + 0o20)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Bb4XOt_dN1Ug(oVre8I6UXc3b, P6Se6Fvc_2Jv, YGFU3oxACPcg, UkrMp_I0RDmo, *lmEEfdW_XFlN):
raise _zJ24Vce7wp0(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3d\x9c^\x93\xf9\xe1\xbe\x84\xa2O\xe9\xb8\xfb\xfcJ\xb0@\xbf\x18\x15Do\xd8\xc2\xb78\xd6\x98\x98\xb4i\xa4\x80\x98'), chr(0b1100100) + chr(101) + chr(1363 - 1264) + '\157' + chr(0b111010 + 0o52) + chr(0b1011001 + 0o14))('\x75' + '\164' + chr(0b1100110) + chr(0b100100 + 0o11) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xee>\x8f\\\xbe\xe5\x92\xe0\xa1\xa1^\xa3'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(3511 - 3411) + '\145')('\165' + chr(0b1000111 + 0o55) + '\146' + chr(1866 - 1821) + chr(56)))(name=xafqLlk3kkUe(wmQmyeWBmUpv(oVre8I6UXc3b), xafqLlk3kkUe(SXOLrMavuUCe(b'\xffh\x98Y\xc2\xeb\x9b\xa2\xba\x9dz\xff'), chr(2131 - 2031) + chr(0b1100101) + '\143' + chr(111) + chr(0b100010 + 0o102) + chr(10173 - 10072))(chr(12973 - 12856) + chr(0b1011110 + 0o26) + '\146' + chr(0b101101) + chr(1198 - 1142)))))
|
quantopian/zipline
|
zipline/pipeline/mixins.py
|
CustomTermMixin._allocate_output
|
def _allocate_output(self, windows, shape):
"""
Allocate an output array whose rows should be passed to `self.compute`.
The resulting array must have a shape of ``shape``.
If we have standard outputs (i.e. self.outputs is NotSpecified), the
default is an empty ndarray whose dtype is ``self.dtype``.
If we have an outputs tuple, the default is an empty recarray with
``self.outputs`` as field names. Each field will have dtype
``self.dtype``.
This can be overridden to control the kind of array constructed
(e.g. to produce a LabelArray instead of an ndarray).
"""
missing_value = self.missing_value
outputs = self.outputs
if outputs is not NotSpecified:
out = recarray(
shape,
formats=[self.dtype.str] * len(outputs),
names=outputs,
)
out[:] = missing_value
else:
out = full(shape, missing_value, dtype=self.dtype)
return out
|
python
|
def _allocate_output(self, windows, shape):
"""
Allocate an output array whose rows should be passed to `self.compute`.
The resulting array must have a shape of ``shape``.
If we have standard outputs (i.e. self.outputs is NotSpecified), the
default is an empty ndarray whose dtype is ``self.dtype``.
If we have an outputs tuple, the default is an empty recarray with
``self.outputs`` as field names. Each field will have dtype
``self.dtype``.
This can be overridden to control the kind of array constructed
(e.g. to produce a LabelArray instead of an ndarray).
"""
missing_value = self.missing_value
outputs = self.outputs
if outputs is not NotSpecified:
out = recarray(
shape,
formats=[self.dtype.str] * len(outputs),
names=outputs,
)
out[:] = missing_value
else:
out = full(shape, missing_value, dtype=self.dtype)
return out
|
[
"def",
"_allocate_output",
"(",
"self",
",",
"windows",
",",
"shape",
")",
":",
"missing_value",
"=",
"self",
".",
"missing_value",
"outputs",
"=",
"self",
".",
"outputs",
"if",
"outputs",
"is",
"not",
"NotSpecified",
":",
"out",
"=",
"recarray",
"(",
"shape",
",",
"formats",
"=",
"[",
"self",
".",
"dtype",
".",
"str",
"]",
"*",
"len",
"(",
"outputs",
")",
",",
"names",
"=",
"outputs",
",",
")",
"out",
"[",
":",
"]",
"=",
"missing_value",
"else",
":",
"out",
"=",
"full",
"(",
"shape",
",",
"missing_value",
",",
"dtype",
"=",
"self",
".",
"dtype",
")",
"return",
"out"
] |
Allocate an output array whose rows should be passed to `self.compute`.
The resulting array must have a shape of ``shape``.
If we have standard outputs (i.e. self.outputs is NotSpecified), the
default is an empty ndarray whose dtype is ``self.dtype``.
If we have an outputs tuple, the default is an empty recarray with
``self.outputs`` as field names. Each field will have dtype
``self.dtype``.
This can be overridden to control the kind of array constructed
(e.g. to produce a LabelArray instead of an ndarray).
|
[
"Allocate",
"an",
"output",
"array",
"whose",
"rows",
"should",
"be",
"passed",
"to",
"self",
".",
"compute",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/mixins.py#L153-L180
|
train
|
Allocate an output array whose rows should be passed to self. compute.
|
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Wp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(129 - 81) + '\157' + '\062' + '\067' + chr(48), 0b1000), ehT0Px3KOsy9('\060' + chr(1609 - 1498) + chr(50) + chr(0b101110 + 0o3) + chr(0b1101 + 0o47), 23762 - 23754), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(0b111 + 0o52) + chr(51), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + '\064', 10698 - 10690), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110110) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\065' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(0b110110) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1011100 + 0o23) + chr(0b110010) + '\063' + '\067', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101010 + 0o105) + chr(0b110010) + chr(50) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100000 + 0o117) + chr(0b10011 + 0o40) + '\067' + chr(0b100 + 0o61), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001101 + 0o42) + chr(0b11110 + 0o25) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101110 + 0o1) + '\061' + chr(53), 38794 - 38786), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + '\062' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + '\063' + chr(306 - 253) + chr(1173 - 1124), 8), ehT0Px3KOsy9('\060' + '\157' + chr(595 - 544) + '\x31' + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + '\x37' + chr(0b110010), 15245 - 15237), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\x6f' + chr(1920 - 1869) + '\x35' + '\061', 8), ehT0Px3KOsy9('\060' + chr(0b101101 + 0o102) + '\x32' + '\064' + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(249 - 138) + chr(0b11101 + 0o26) + chr(49) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(1374 - 1325) + chr(49) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(145 - 34) + chr(917 - 866) + chr(0b100 + 0o55) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(909 - 861) + chr(9226 - 9115) + '\x35' + '\060', 17187 - 17179), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110101) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(49) + chr(1650 - 1597), 63761 - 63753), ehT0Px3KOsy9(chr(1196 - 1148) + '\x6f' + chr(0b110011) + chr(0b11011 + 0o31) + chr(0b110001 + 0o4), 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\157' + '\061' + '\x33', 34020 - 34012), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + '\x31' + chr(49) + chr(253 - 199), ord("\x08")), ehT0Px3KOsy9('\060' + chr(6451 - 6340) + chr(50) + '\062' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b100000 + 0o117) + chr(0b110001) + chr(55) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(12017 - 11906) + chr(0b100001 + 0o21) + chr(0b110011) + chr(1919 - 1865), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(11214 - 11103) + chr(0b100010 + 0o22) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6762 - 6651) + '\x33' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b0 + 0o63) + chr(0b11011 + 0o25) + chr(1257 - 1209), 0o10), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\x6f' + chr(0b110010) + chr(54) + '\x31', 6326 - 6318), ehT0Px3KOsy9('\x30' + chr(0b1100111 + 0o10) + '\x33' + chr(371 - 322) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1011 + 0o47) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100000 + 0o22) + chr(0b10101 + 0o40) + '\063', 6892 - 6884), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(9733 - 9622) + '\x32' + '\x31' + '\066', 19022 - 19014)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1100000 + 0o17) + chr(0b110101) + chr(0b11011 + 0o25), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x96'), '\144' + chr(0b101000 + 0o75) + chr(6724 - 6625) + chr(111) + chr(0b1001000 + 0o34) + chr(0b1100101))(chr(0b1110101) + chr(0b1010010 + 0o42) + chr(102) + chr(0b101101) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def LpsZofHHU3aP(oVre8I6UXc3b, tcOADu9A2HE7, nauYfLglTpcb):
cM6FSYO3vPuj = oVre8I6UXc3b.cM6FSYO3vPuj
Dx_DllZ8uCko = oVre8I6UXc3b.Dx_DllZ8uCko
if Dx_DllZ8uCko is not wxCCXClP4Gzp:
UkrMp_I0RDmo = FqoPkn3DgpV8(nauYfLglTpcb, formats=[oVre8I6UXc3b.dtype.str] * c2A0yzQpDQB3(Dx_DllZ8uCko), names=Dx_DllZ8uCko)
UkrMp_I0RDmo[:] = cM6FSYO3vPuj
else:
UkrMp_I0RDmo = KNGATxtxipLV(nauYfLglTpcb, cM6FSYO3vPuj, dtype=oVre8I6UXc3b.jSV9IKnemH7K)
return UkrMp_I0RDmo
|
quantopian/zipline
|
zipline/pipeline/mixins.py
|
CustomTermMixin._compute
|
def _compute(self, windows, dates, assets, mask):
"""
Call the user's `compute` function on each window with a pre-built
output array.
"""
format_inputs = self._format_inputs
compute = self.compute
params = self.params
ndim = self.ndim
shape = (len(mask), 1) if ndim == 1 else mask.shape
out = self._allocate_output(windows, shape)
with self.ctx:
for idx, date in enumerate(dates):
# Never apply a mask to 1D outputs.
out_mask = array([True]) if ndim == 1 else mask[idx]
# Mask our inputs as usual.
inputs_mask = mask[idx]
masked_assets = assets[inputs_mask]
out_row = out[idx][out_mask]
inputs = format_inputs(windows, inputs_mask)
compute(date, masked_assets, out_row, *inputs, **params)
out[idx][out_mask] = out_row
return out
|
python
|
def _compute(self, windows, dates, assets, mask):
"""
Call the user's `compute` function on each window with a pre-built
output array.
"""
format_inputs = self._format_inputs
compute = self.compute
params = self.params
ndim = self.ndim
shape = (len(mask), 1) if ndim == 1 else mask.shape
out = self._allocate_output(windows, shape)
with self.ctx:
for idx, date in enumerate(dates):
# Never apply a mask to 1D outputs.
out_mask = array([True]) if ndim == 1 else mask[idx]
# Mask our inputs as usual.
inputs_mask = mask[idx]
masked_assets = assets[inputs_mask]
out_row = out[idx][out_mask]
inputs = format_inputs(windows, inputs_mask)
compute(date, masked_assets, out_row, *inputs, **params)
out[idx][out_mask] = out_row
return out
|
[
"def",
"_compute",
"(",
"self",
",",
"windows",
",",
"dates",
",",
"assets",
",",
"mask",
")",
":",
"format_inputs",
"=",
"self",
".",
"_format_inputs",
"compute",
"=",
"self",
".",
"compute",
"params",
"=",
"self",
".",
"params",
"ndim",
"=",
"self",
".",
"ndim",
"shape",
"=",
"(",
"len",
"(",
"mask",
")",
",",
"1",
")",
"if",
"ndim",
"==",
"1",
"else",
"mask",
".",
"shape",
"out",
"=",
"self",
".",
"_allocate_output",
"(",
"windows",
",",
"shape",
")",
"with",
"self",
".",
"ctx",
":",
"for",
"idx",
",",
"date",
"in",
"enumerate",
"(",
"dates",
")",
":",
"# Never apply a mask to 1D outputs.",
"out_mask",
"=",
"array",
"(",
"[",
"True",
"]",
")",
"if",
"ndim",
"==",
"1",
"else",
"mask",
"[",
"idx",
"]",
"# Mask our inputs as usual.",
"inputs_mask",
"=",
"mask",
"[",
"idx",
"]",
"masked_assets",
"=",
"assets",
"[",
"inputs_mask",
"]",
"out_row",
"=",
"out",
"[",
"idx",
"]",
"[",
"out_mask",
"]",
"inputs",
"=",
"format_inputs",
"(",
"windows",
",",
"inputs_mask",
")",
"compute",
"(",
"date",
",",
"masked_assets",
",",
"out_row",
",",
"*",
"inputs",
",",
"*",
"*",
"params",
")",
"out",
"[",
"idx",
"]",
"[",
"out_mask",
"]",
"=",
"out_row",
"return",
"out"
] |
Call the user's `compute` function on each window with a pre-built
output array.
|
[
"Call",
"the",
"user",
"s",
"compute",
"function",
"on",
"each",
"window",
"with",
"a",
"pre",
"-",
"built",
"output",
"array",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/mixins.py#L193-L220
|
train
|
Compute the user s compute function on each window with a pre - built array.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdL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kCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(282 - 234), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(11527 - 11416) + '\x32' + chr(54) + chr(0b11001 + 0o34), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + '\x36' + chr(1056 - 1001), ord("\x08")), ehT0Px3KOsy9(chr(486 - 438) + chr(5918 - 5807) + '\065' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101110 + 0o1) + chr(0b110010) + chr(82 - 31) + '\x34', 46899 - 46891), ehT0Px3KOsy9(chr(0b110000) + chr(7625 - 7514) + chr(0b11 + 0o60) + chr(0b111 + 0o52) + chr(0b100 + 0o62), 38149 - 38141), ehT0Px3KOsy9('\060' + chr(3889 - 3778) + '\x34' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1011 + 0o52) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10010 + 0o40) + chr(0b101010 + 0o10) + chr(0b110100), 52834 - 52826), ehT0Px3KOsy9('\060' + chr(813 - 702) + chr(0b101010 + 0o7) + '\x37' + '\063', 39651 - 39643), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1 + 0o62) + chr(55) + chr(0b10 + 0o57), 61605 - 61597), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000 + 0o147) + chr(1155 - 1100) + chr(2182 - 2132), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11011 + 0o30) + chr(545 - 495), 0b1000), ehT0Px3KOsy9('\060' + chr(7631 - 7520) + chr(2091 - 2042) + chr(0b11100 + 0o24) + chr(804 - 755), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b111 + 0o54) + '\060', 0o10), ehT0Px3KOsy9(chr(799 - 751) + '\x6f' + '\062' + '\062' + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1231 - 1182) + '\x34' + chr(0b1001 + 0o50), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1010001 + 0o36) + chr(49) + '\x34' + '\063', 6973 - 6965), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(111) + chr(1616 - 1567) + '\x32' + '\x33', 3729 - 3721), ehT0Px3KOsy9(chr(2200 - 2152) + chr(0b10011 + 0o134) + chr(2141 - 2092) + chr(55) + '\066', 52122 - 52114), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(1614 - 1560), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(0b110111) + chr(49), 8), ehT0Px3KOsy9(chr(48) + chr(0b10 + 0o155) + chr(0b101011 + 0o6) + chr(0b110000) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(111) + chr(51) + '\062' + chr(0b100 + 0o56), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1000010 + 0o55) + '\x32' + chr(0b110011) + chr(583 - 530), ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + chr(591 - 537) + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2287 - 2233) + chr(2075 - 2025), 13441 - 13433), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(674 - 624) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\157' + '\x31' + chr(49) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + chr(0b10111 + 0o32) + chr(0b1110 + 0o43) + chr(0b1011 + 0o51), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011000 + 0o27) + '\x31' + '\x33' + chr(0b101100 + 0o10), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(0b110110) + '\060', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(55) + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + '\x32' + '\064', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b11011 + 0o124) + chr(2701 - 2648) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\066' + '\x32', 8), ehT0Px3KOsy9('\060' + chr(0b1000111 + 0o50) + chr(2318 - 2269) + '\065' + chr(766 - 717), 16141 - 16133), ehT0Px3KOsy9(chr(0b110000) + chr(3836 - 3725) + chr(49) + '\x36' + chr(0b11100 + 0o25), 0o10), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(9335 - 9224) + '\062' + '\063' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + '\x34' + chr(873 - 822), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110101) + '\060', 25541 - 25533)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'&'), chr(100) + chr(0b1100101) + chr(99) + '\x6f' + chr(8921 - 8821) + '\145')(chr(0b111001 + 0o74) + chr(0b1100 + 0o150) + '\x66' + '\x2d' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def PeHoGDqlkidn(oVre8I6UXc3b, tcOADu9A2HE7, SLiSZu5nk7Kn, YGFU3oxACPcg, Iz1jSgUKZDvt):
nvYT_vpiiGam = oVre8I6UXc3b._format_inputs
Bb4XOt_dN1Ug = oVre8I6UXc3b.compute
nEbJZ4wfte2w = oVre8I6UXc3b.nEbJZ4wfte2w
gompHBiTsfJT = oVre8I6UXc3b.gompHBiTsfJT
nauYfLglTpcb = (c2A0yzQpDQB3(Iz1jSgUKZDvt), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + chr(444 - 395), ord("\x08"))) if gompHBiTsfJT == ehT0Px3KOsy9(chr(2143 - 2095) + chr(0b1101111) + chr(1835 - 1786), 8) else Iz1jSgUKZDvt.nauYfLglTpcb
UkrMp_I0RDmo = oVre8I6UXc3b._allocate_output(tcOADu9A2HE7, nauYfLglTpcb)
with xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'g\xf8\x04C\xd0\xa1\x14\x1b\xa7#\x9fb'), chr(100) + chr(101) + chr(0b10010 + 0o121) + chr(0b100000 + 0o117) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(6379 - 6263) + chr(0b1011 + 0o133) + chr(0b101101) + chr(0b11011 + 0o35))):
for (YlqusYB6InkM, J4aeFOr3sjPo) in YlkZvXL8qwsX(SLiSZu5nk7Kn):
WTf2R03MYbDp = B0ePDhpqxN5n([ehT0Px3KOsy9('\060' + chr(258 - 147) + chr(0b10101 + 0o34), 8)]) if gompHBiTsfJT == ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1011 + 0o46), 8) else Iz1jSgUKZDvt[YlqusYB6InkM]
QnxOvREoKmUU = Iz1jSgUKZDvt[YlqusYB6InkM]
tPEDmSwjCJR5 = YGFU3oxACPcg[QnxOvREoKmUU]
Zl0muFvsQ93d = UkrMp_I0RDmo[YlqusYB6InkM][WTf2R03MYbDp]
vXoupepMtCXU = nvYT_vpiiGam(tcOADu9A2HE7, QnxOvREoKmUU)
Bb4XOt_dN1Ug(J4aeFOr3sjPo, tPEDmSwjCJR5, Zl0muFvsQ93d, *vXoupepMtCXU, **nEbJZ4wfte2w)
UkrMp_I0RDmo[YlqusYB6InkM][WTf2R03MYbDp] = Zl0muFvsQ93d
return UkrMp_I0RDmo
|
quantopian/zipline
|
zipline/pipeline/mixins.py
|
AliasedMixin.make_aliased_type
|
def make_aliased_type(cls, other_base):
"""
Factory for making Aliased{Filter,Factor,Classifier}.
"""
docstring = dedent(
"""
A {t} that names another {t}.
Parameters
----------
term : {t}
{{name}}
"""
).format(t=other_base.__name__)
doc = format_docstring(
owner_name=other_base.__name__,
docstring=docstring,
formatters={'name': PIPELINE_ALIAS_NAME_DOC},
)
return type(
'Aliased' + other_base.__name__,
(cls, other_base),
{'__doc__': doc,
'__module__': other_base.__module__},
)
|
python
|
def make_aliased_type(cls, other_base):
"""
Factory for making Aliased{Filter,Factor,Classifier}.
"""
docstring = dedent(
"""
A {t} that names another {t}.
Parameters
----------
term : {t}
{{name}}
"""
).format(t=other_base.__name__)
doc = format_docstring(
owner_name=other_base.__name__,
docstring=docstring,
formatters={'name': PIPELINE_ALIAS_NAME_DOC},
)
return type(
'Aliased' + other_base.__name__,
(cls, other_base),
{'__doc__': doc,
'__module__': other_base.__module__},
)
|
[
"def",
"make_aliased_type",
"(",
"cls",
",",
"other_base",
")",
":",
"docstring",
"=",
"dedent",
"(",
"\"\"\"\n A {t} that names another {t}.\n\n Parameters\n ----------\n term : {t}\n {{name}}\n \"\"\"",
")",
".",
"format",
"(",
"t",
"=",
"other_base",
".",
"__name__",
")",
"doc",
"=",
"format_docstring",
"(",
"owner_name",
"=",
"other_base",
".",
"__name__",
",",
"docstring",
"=",
"docstring",
",",
"formatters",
"=",
"{",
"'name'",
":",
"PIPELINE_ALIAS_NAME_DOC",
"}",
",",
")",
"return",
"type",
"(",
"'Aliased'",
"+",
"other_base",
".",
"__name__",
",",
"(",
"cls",
",",
"other_base",
")",
",",
"{",
"'__doc__'",
":",
"doc",
",",
"'__module__'",
":",
"other_base",
".",
"__module__",
"}",
",",
")"
] |
Factory for making Aliased{Filter,Factor,Classifier}.
|
[
"Factory",
"for",
"making",
"Aliased",
"{",
"Filter",
"Factor",
"Classifier",
"}",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/mixins.py#L297-L323
|
train
|
Create a type that can be used to alias another base.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstr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pXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11 + 0o60) + chr(0b10000 + 0o46) + chr(244 - 194), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(0b110111) + chr(2785 - 2731), 0b1000), ehT0Px3KOsy9('\x30' + chr(8554 - 8443) + '\062' + chr(0b110 + 0o56) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + '\064' + chr(2230 - 2181), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(52) + chr(0b110001), 11647 - 11639), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b100 + 0o153) + '\063' + chr(0b100011 + 0o22) + chr(0b110000), 64287 - 64279), ehT0Px3KOsy9('\060' + chr(111) + chr(1991 - 1941) + '\x37' + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + chr(4744 - 4633) + chr(0b110001) + chr(0b100 + 0o56) + chr(0b110000), 1048 - 1040), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1101111) + chr(0b10001 + 0o42) + '\066' + '\x32', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(53) + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110101) + chr(0b110111), 4272 - 4264), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\x6f' + chr(51) + chr(50) + chr(1571 - 1520), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(50) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(0b1000 + 0o55) + chr(54), 8), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + chr(0b110011) + chr(802 - 750) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001 + 0o0) + chr(0b101 + 0o61) + '\x37', 64924 - 64916), ehT0Px3KOsy9(chr(0b110000) + chr(5028 - 4917) + '\061' + '\x35', 0b1000), ehT0Px3KOsy9(chr(779 - 731) + chr(9437 - 9326) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + '\065' + chr(0b101110 + 0o10), 57687 - 57679), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101000 + 0o7) + chr(0b110001) + chr(903 - 855) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(55) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(1300 - 1250), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b110110) + '\x37', 39168 - 39160), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(111) + chr(0b100011 + 0o20) + chr(1622 - 1571) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + '\065' + chr(0b10 + 0o62), 17018 - 17010), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b111 + 0o150) + '\063' + chr(0b110011) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(985 - 937) + chr(0b1101111) + '\062' + chr(0b10110 + 0o36) + chr(49), 8), ehT0Px3KOsy9('\060' + chr(9752 - 9641) + chr(0b110011) + chr(0b110000) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001100 + 0o43) + chr(0b110010) + chr(0b110010) + '\x33', 42862 - 42854), ehT0Px3KOsy9(chr(48) + chr(4027 - 3916) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(1613 - 1565) + chr(111) + chr(50) + chr(0b110111) + '\060', 0b1000), ehT0Px3KOsy9(chr(363 - 315) + chr(0b1101111) + chr(364 - 311) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + chr(55) + chr(0b101011 + 0o6), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1011010 + 0o25) + chr(55) + chr(1130 - 1075), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(374 - 325) + chr(627 - 576), 38572 - 38564), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(52) + chr(2139 - 2085), 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\157' + chr(1811 - 1761) + chr(49) + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b1101 + 0o47) + chr(48), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(0b100110 + 0o17) + chr(0b101100 + 0o4), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc'), chr(1353 - 1253) + chr(101) + '\x63' + chr(0b1101111) + chr(0b110001 + 0o63) + chr(101))('\165' + '\x74' + chr(0b1100110) + '\x2d' + chr(0b11110 + 0o32)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def vMO76BDqLbl0(NSstowUUZlxS, YTDvgQnQGS5j):
nVYJv7AZy3Rn = ojh11Z5rxCFF(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\x9e\x83\x81A\xc8\x9cp\xd2\xceO\xf3\xb7\xaf\xc5\x0cy|\x8e5w\x99n\x97\xb2\xcd\xb2\xc4\xb0\xb3e\xd6G\xcdWn~\x86\xf7T\x8f\x90\xa9\xabA\xc8\x9cp\xd2\xceO\xf3\xb7\xce\xc5W]`\xdc r\x9dn\xd2\xae\xdf\xd5\x81\xe3\xb3$\x98\x08\x99\x1f+,\x86\xac\r\xdf\x93\x8e\x8cL\xc5\x91}\xdf\xe4O\xf3\xb7\xce\xc5W-!\x8ea?\xd8n\xd2\xae\xc1\xff\x9b\xe3\xe8p\xc5"\x99\x1f+,\x86\xac\x00\xd2\x9e\x83\x81A\x93\xc7>\x93\x83\n\xae\xea\xe4\xc5W-!\x8ea?\xd8:\x97\xfc\x8c'), chr(100) + '\x65' + '\x63' + chr(7956 - 7845) + chr(0b1100100) + chr(0b1001101 + 0o30))(chr(7826 - 7709) + chr(0b1010111 + 0o35) + '\x66' + '\x2d' + '\070')).V4roHaS3Ppej(t=YTDvgQnQGS5j.Gbej4oZqKLA6)
JCpEgna6NeKD = K3yzJYhHpN_t(owner_name=YTDvgQnQGS5j.Gbej4oZqKLA6, docstring=nVYJv7AZy3Rn, formatters={xafqLlk3kkUe(SXOLrMavuUCe(b'\x9c\xdf\xce\xc4'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\144' + chr(0b1100101))(chr(117) + chr(116) + chr(102) + chr(0b101101) + chr(1794 - 1738)): uEmN4Xh0luh8})
return wmQmyeWBmUpv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb3\xd2\xca\xc0\x12\x8d\xd8'), chr(2585 - 2485) + chr(0b101100 + 0o71) + chr(5315 - 5216) + chr(111) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(116) + '\146' + chr(1497 - 1452) + chr(1611 - 1555)) + xafqLlk3kkUe(YTDvgQnQGS5j, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb5\xdc\xc6\xcbU\x87\xe6!\xb9\xa2.\xe5'), '\144' + chr(0b1010110 + 0o17) + chr(0b1100011) + chr(111) + chr(0b1001100 + 0o30) + chr(101))(chr(11151 - 11034) + '\164' + chr(6948 - 6846) + '\055' + chr(0b101 + 0o63))), (NSstowUUZlxS, YTDvgQnQGS5j), {xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xe1\xc7\xce\x02\xb7\xe3'), '\144' + '\x65' + '\143' + '\x6f' + '\144' + chr(0b1100101))('\x75' + chr(5643 - 5527) + chr(0b1011101 + 0o11) + chr(0b101101) + '\070'): JCpEgna6NeKD, xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xe1\xce\xce\x05\x9d\xd05\xad\xb1'), chr(0b1100100) + chr(0b1100101) + '\143' + '\157' + '\x64' + chr(1027 - 926))(chr(117) + chr(0b1110100) + chr(102) + chr(45) + chr(0b111000)): xafqLlk3kkUe(YTDvgQnQGS5j, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbb\xfa\xe9\x96\x17\xb8\xcc\x1a\x94\x81^\x96'), chr(100) + '\145' + chr(0b1100011) + chr(0b1101111) + '\x64' + '\x65')(chr(117) + '\x74' + chr(0b1000011 + 0o43) + chr(0b1101 + 0o40) + '\x38'))})
|
quantopian/zipline
|
zipline/pipeline/mixins.py
|
DownsampledMixin.compute_extra_rows
|
def compute_extra_rows(self,
all_dates,
start_date,
end_date,
min_extra_rows):
"""
Ensure that min_extra_rows pushes us back to a computation date.
Parameters
----------
all_dates : pd.DatetimeIndex
The trading sessions against which ``self`` will be computed.
start_date : pd.Timestamp
The first date for which final output is requested.
end_date : pd.Timestamp
The last date for which final output is requested.
min_extra_rows : int
The minimum number of extra rows required of ``self``, as
determined by other terms that depend on ``self``.
Returns
-------
extra_rows : int
The number of extra rows to compute. This will be the minimum
number of rows required to make our computed start_date fall on a
recomputation date.
"""
try:
current_start_pos = all_dates.get_loc(start_date) - min_extra_rows
if current_start_pos < 0:
raise NoFurtherDataError.from_lookback_window(
initial_message="Insufficient data to compute Pipeline:",
first_date=all_dates[0],
lookback_start=start_date,
lookback_length=min_extra_rows,
)
except KeyError:
before, after = nearest_unequal_elements(all_dates, start_date)
raise ValueError(
"Pipeline start_date {start_date} is not in calendar.\n"
"Latest date before start_date is {before}.\n"
"Earliest date after start_date is {after}.".format(
start_date=start_date,
before=before,
after=after,
)
)
# Our possible target dates are all the dates on or before the current
# starting position.
# TODO: Consider bounding this below by self.window_length
candidates = all_dates[:current_start_pos + 1]
# Choose the latest date in the candidates that is the start of a new
# period at our frequency.
choices = select_sampling_indices(candidates, self._frequency)
# If we have choices, the last choice is the first date if the
# period containing current_start_date. Choose it.
new_start_date = candidates[choices[-1]]
# Add the difference between the new and old start dates to get the
# number of rows for the new start_date.
new_start_pos = all_dates.get_loc(new_start_date)
assert new_start_pos <= current_start_pos, \
"Computed negative extra rows!"
return min_extra_rows + (current_start_pos - new_start_pos)
|
python
|
def compute_extra_rows(self,
all_dates,
start_date,
end_date,
min_extra_rows):
"""
Ensure that min_extra_rows pushes us back to a computation date.
Parameters
----------
all_dates : pd.DatetimeIndex
The trading sessions against which ``self`` will be computed.
start_date : pd.Timestamp
The first date for which final output is requested.
end_date : pd.Timestamp
The last date for which final output is requested.
min_extra_rows : int
The minimum number of extra rows required of ``self``, as
determined by other terms that depend on ``self``.
Returns
-------
extra_rows : int
The number of extra rows to compute. This will be the minimum
number of rows required to make our computed start_date fall on a
recomputation date.
"""
try:
current_start_pos = all_dates.get_loc(start_date) - min_extra_rows
if current_start_pos < 0:
raise NoFurtherDataError.from_lookback_window(
initial_message="Insufficient data to compute Pipeline:",
first_date=all_dates[0],
lookback_start=start_date,
lookback_length=min_extra_rows,
)
except KeyError:
before, after = nearest_unequal_elements(all_dates, start_date)
raise ValueError(
"Pipeline start_date {start_date} is not in calendar.\n"
"Latest date before start_date is {before}.\n"
"Earliest date after start_date is {after}.".format(
start_date=start_date,
before=before,
after=after,
)
)
# Our possible target dates are all the dates on or before the current
# starting position.
# TODO: Consider bounding this below by self.window_length
candidates = all_dates[:current_start_pos + 1]
# Choose the latest date in the candidates that is the start of a new
# period at our frequency.
choices = select_sampling_indices(candidates, self._frequency)
# If we have choices, the last choice is the first date if the
# period containing current_start_date. Choose it.
new_start_date = candidates[choices[-1]]
# Add the difference between the new and old start dates to get the
# number of rows for the new start_date.
new_start_pos = all_dates.get_loc(new_start_date)
assert new_start_pos <= current_start_pos, \
"Computed negative extra rows!"
return min_extra_rows + (current_start_pos - new_start_pos)
|
[
"def",
"compute_extra_rows",
"(",
"self",
",",
"all_dates",
",",
"start_date",
",",
"end_date",
",",
"min_extra_rows",
")",
":",
"try",
":",
"current_start_pos",
"=",
"all_dates",
".",
"get_loc",
"(",
"start_date",
")",
"-",
"min_extra_rows",
"if",
"current_start_pos",
"<",
"0",
":",
"raise",
"NoFurtherDataError",
".",
"from_lookback_window",
"(",
"initial_message",
"=",
"\"Insufficient data to compute Pipeline:\"",
",",
"first_date",
"=",
"all_dates",
"[",
"0",
"]",
",",
"lookback_start",
"=",
"start_date",
",",
"lookback_length",
"=",
"min_extra_rows",
",",
")",
"except",
"KeyError",
":",
"before",
",",
"after",
"=",
"nearest_unequal_elements",
"(",
"all_dates",
",",
"start_date",
")",
"raise",
"ValueError",
"(",
"\"Pipeline start_date {start_date} is not in calendar.\\n\"",
"\"Latest date before start_date is {before}.\\n\"",
"\"Earliest date after start_date is {after}.\"",
".",
"format",
"(",
"start_date",
"=",
"start_date",
",",
"before",
"=",
"before",
",",
"after",
"=",
"after",
",",
")",
")",
"# Our possible target dates are all the dates on or before the current",
"# starting position.",
"# TODO: Consider bounding this below by self.window_length",
"candidates",
"=",
"all_dates",
"[",
":",
"current_start_pos",
"+",
"1",
"]",
"# Choose the latest date in the candidates that is the start of a new",
"# period at our frequency.",
"choices",
"=",
"select_sampling_indices",
"(",
"candidates",
",",
"self",
".",
"_frequency",
")",
"# If we have choices, the last choice is the first date if the",
"# period containing current_start_date. Choose it.",
"new_start_date",
"=",
"candidates",
"[",
"choices",
"[",
"-",
"1",
"]",
"]",
"# Add the difference between the new and old start dates to get the",
"# number of rows for the new start_date.",
"new_start_pos",
"=",
"all_dates",
".",
"get_loc",
"(",
"new_start_date",
")",
"assert",
"new_start_pos",
"<=",
"current_start_pos",
",",
"\"Computed negative extra rows!\"",
"return",
"min_extra_rows",
"+",
"(",
"current_start_pos",
"-",
"new_start_pos",
")"
] |
Ensure that min_extra_rows pushes us back to a computation date.
Parameters
----------
all_dates : pd.DatetimeIndex
The trading sessions against which ``self`` will be computed.
start_date : pd.Timestamp
The first date for which final output is requested.
end_date : pd.Timestamp
The last date for which final output is requested.
min_extra_rows : int
The minimum number of extra rows required of ``self``, as
determined by other terms that depend on ``self``.
Returns
-------
extra_rows : int
The number of extra rows to compute. This will be the minimum
number of rows required to make our computed start_date fall on a
recomputation date.
|
[
"Ensure",
"that",
"min_extra_rows",
"pushes",
"us",
"back",
"to",
"a",
"computation",
"date",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/mixins.py#L370-L437
|
train
|
This method computes the number of extra rows required to make a new simulation.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNG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hLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(111) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(933 - 885) + chr(11103 - 10992) + chr(49) + chr(52) + chr(2514 - 2463), 50450 - 50442), ehT0Px3KOsy9(chr(48) + chr(111) + chr(65 - 16) + chr(51) + chr(0b11111 + 0o26), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1011011 + 0o24) + '\x32' + chr(48) + '\061', 34244 - 34236), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(52) + chr(0b11101 + 0o24), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(0b11 + 0o56) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b100110 + 0o111) + '\x36' + '\064', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(1430 - 1381) + chr(0b110110) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100101 + 0o112) + chr(1742 - 1693) + '\x33' + '\062', 15308 - 15300), ehT0Px3KOsy9(chr(48) + chr(0b101110 + 0o101) + chr(1568 - 1518) + chr(0b110010) + chr(0b100100 + 0o14), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1855 - 1801) + chr(96 - 44), 8), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(6909 - 6798) + chr(1077 - 1028) + '\062' + chr(0b100111 + 0o16), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000110 + 0o51) + chr(49) + '\x34' + chr(0b110011), 8), ehT0Px3KOsy9(chr(48) + chr(0b11011 + 0o124) + chr(51) + '\x34' + chr(0b10111 + 0o37), 17970 - 17962), ehT0Px3KOsy9('\x30' + chr(10150 - 10039) + chr(618 - 568) + chr(0b100001 + 0o20) + chr(1688 - 1640), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1756 - 1706) + chr(50) + chr(48), 8), ehT0Px3KOsy9(chr(1384 - 1336) + '\157' + '\x36' + chr(2621 - 2566), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(48), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\062' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11100 + 0o27) + chr(0b11111 + 0o27) + chr(51), 43501 - 43493), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(2528 - 2475) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(1018 - 970) + '\157' + '\x31' + chr(2674 - 2619) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b110011) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101 + 0o142) + chr(53) + chr(0b101 + 0o55), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(55) + chr(1659 - 1610), 0o10), ehT0Px3KOsy9(chr(1583 - 1535) + chr(111) + '\x32' + chr(50) + chr(0b100001 + 0o24), 62826 - 62818), ehT0Px3KOsy9(chr(162 - 114) + chr(0b1101111) + chr(497 - 447) + '\x33' + '\x33', 294 - 286), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(0b10 + 0o62) + chr(935 - 881), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(8788 - 8677) + '\063' + chr(0b11 + 0o60) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1290 - 1242), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1988 - 1937) + '\x32' + chr(0b101100 + 0o6), 57418 - 57410), ehT0Px3KOsy9(chr(967 - 919) + chr(0b1101111) + chr(49) + chr(820 - 769) + chr(49), 29443 - 29435), ehT0Px3KOsy9('\060' + chr(0b1101101 + 0o2) + chr(0b110011) + '\x30' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(214 - 166) + '\157' + chr(0b11100 + 0o26) + chr(1869 - 1820) + chr(679 - 628), ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(12123 - 12012) + chr(54) + chr(0b110001), 13912 - 13904), ehT0Px3KOsy9('\060' + '\157' + chr(0b101000 + 0o16) + chr(0b100011 + 0o16), 8), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(0b110000) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + chr(416 - 305) + '\x36' + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(11759 - 11648) + chr(2000 - 1950) + chr(858 - 806) + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2473 - 2423), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1366 - 1313) + chr(0b1111 + 0o41), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'*'), chr(4941 - 4841) + chr(0b1001110 + 0o27) + chr(0b10100 + 0o117) + chr(0b11111 + 0o120) + '\144' + chr(0b1100101))(chr(0b1110001 + 0o4) + chr(0b1101100 + 0o10) + chr(102) + '\x2d' + chr(0b10101 + 0o43)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def R9J8rhYYwEJY(oVre8I6UXc3b, VyE8F9F0bDc9, NcwNd9gvgEB5, joOGoPpJ_sck, OWe4Jvoutkl7):
try:
QZuzQ2xw69PM = VyE8F9F0bDc9.get_loc(NcwNd9gvgEB5) - OWe4Jvoutkl7
if QZuzQ2xw69PM < ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(48), 8):
raise xafqLlk3kkUe(rLplDgouBqvI, xafqLlk3kkUe(SXOLrMavuUCe(b'b\x112\xec\xbe\xa3[\x1b1\xf2U6\x08\xb9\xff\xf9Y|}\x84'), chr(100) + chr(0b1100101) + '\x63' + chr(0b100101 + 0o112) + chr(0b1100100) + '\145')(chr(117) + chr(0b1110100) + chr(102) + chr(673 - 628) + '\070'))(initial_message=xafqLlk3kkUe(SXOLrMavuUCe(b'M\r.\xf4\x87\xa9]\x173\xf5Z!C\x82\xe9\xe4V8f\x9c\xcd\x1d\xf3G\xc9\xe0\xef\xc3\xf8P\xbb)\xa1\xe7X_\xa5\x08'), chr(0b1100100) + chr(0b10100 + 0o121) + chr(0b101 + 0o136) + chr(0b1101111) + chr(100) + chr(5329 - 5228))(chr(3575 - 3458) + chr(0b1110100) + '\146' + '\055' + chr(1971 - 1915)), first_date=VyE8F9F0bDc9[ehT0Px3KOsy9(chr(48) + chr(0b101101 + 0o102) + '\x30', 8)], lookback_start=NcwNd9gvgEB5, lookback_length=OWe4Jvoutkl7)
except RQ6CSRrFArYB:
(SYBWeRDQQk_b, yUiKpR0j07vX) = xGd53LkmQxoZ(VyE8F9F0bDc9, NcwNd9gvgEB5)
raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'T\n-\xe4\x8d\xa6Z\x11z\xe3@4\x11\x92\xd7\xf4Vlw\xd3\x96\r\xe8K\xcb\xe1\xc4\xc2\xb9t\xb7$\xe4\xe2B\x11\xae]\xd6"m\r}\xe2\x80\xa3Q\x1a>\xf1F{i\xaa\xe9\xe4Rkf\xd3\x89\x1f\xe8O\x99\xf7\xfe\xc0\xb7r\xb7y\xb7\xffPC\xb4m\xc6cp\x06}\xe8\x92\xefO\x16?\xf6[\'\x06\x9b\xa6\x9ary`\x9f\x84\x1b\xef^\x99\xf1\xfa\xd2\xbd \xb3?\xb0\xeeC\x11\xb3F\xc3pp<9\xe0\x95\xaa\x14\x1d)\xb0O4\x05\x92\xed\xe2J6'), chr(100) + '\145' + chr(6524 - 6425) + '\157' + chr(100) + chr(0b1010001 + 0o24))(chr(0b1110101) + '\164' + '\146' + '\x2d' + chr(131 - 75)), xafqLlk3kkUe(SXOLrMavuUCe(b'RW/\xee\xa9\xaegG\n\xe0Q?'), chr(100) + chr(101) + chr(0b1100011) + '\x6f' + '\x64' + chr(0b1001110 + 0o27))(chr(0b1110101) + chr(0b1110100) + chr(2245 - 2143) + chr(0b101101) + chr(0b111000)))(start_date=NcwNd9gvgEB5, before=SYBWeRDQQk_b, after=yUiKpR0j07vX))
rVMkTcEfqM4b = VyE8F9F0bDc9[:QZuzQ2xw69PM + ehT0Px3KOsy9('\x30' + '\157' + chr(49), 0o10)]
XPnoMuK4S7nS = hfxGr5EiFpw5(rVMkTcEfqM4b, oVre8I6UXc3b._frequency)
FQ7MpyghL_s_ = rVMkTcEfqM4b[XPnoMuK4S7nS[-ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\157' + chr(307 - 258), 8)]]
zvq9J3Mioaqu = VyE8F9F0bDc9.get_loc(FQ7MpyghL_s_)
assert zvq9J3Mioaqu <= QZuzQ2xw69PM, xafqLlk3kkUe(SXOLrMavuUCe(b'G\x0c0\xf1\x94\xbbQ\x10z\xfeQ2\x02\x92\xe1\xe6R8w\x8b\x99\x0c\xfd\n\xcb\xfa\xec\xd5\xf9'), chr(100) + chr(101) + chr(0b1000011 + 0o40) + '\x6f' + chr(0b100010 + 0o102) + chr(0b1100101))(chr(117) + '\164' + chr(0b10000 + 0o126) + chr(0b10 + 0o53) + chr(0b11100 + 0o34))
return OWe4Jvoutkl7 + (QZuzQ2xw69PM - zvq9J3Mioaqu)
|
quantopian/zipline
|
zipline/pipeline/mixins.py
|
DownsampledMixin._compute
|
def _compute(self, inputs, dates, assets, mask):
"""
Compute by delegating to self._wrapped_term._compute on sample dates.
On non-sample dates, forward-fill from previously-computed samples.
"""
to_sample = dates[select_sampling_indices(dates, self._frequency)]
assert to_sample[0] == dates[0], \
"Misaligned sampling dates in %s." % type(self).__name__
real_compute = self._wrapped_term._compute
# Inputs will contain different kinds of values depending on whether or
# not we're a windowed computation.
# If we're windowed, then `inputs` is a list of iterators of ndarrays.
# If we're not windowed, then `inputs` is just a list of ndarrays.
# There are two things we care about doing with the input:
# 1. Preparing an input to be passed to our wrapped term.
# 2. Skipping an input if we're going to use an already-computed row.
# We perform these actions differently based on the expected kind of
# input, and we encapsulate these actions with closures so that we
# don't clutter the code below with lots of branching.
if self.windowed:
# If we're windowed, inputs are stateful AdjustedArrays. We don't
# need to do any preparation before forwarding to real_compute, but
# we need to call `next` on them if we want to skip an iteration.
def prepare_inputs():
return inputs
def skip_this_input():
for w in inputs:
next(w)
else:
# If we're not windowed, inputs are just ndarrays. We need to
# slice out a single row when forwarding to real_compute, but we
# don't need to do anything to skip an input.
def prepare_inputs():
# i is the loop iteration variable below.
return [a[[i]] for a in inputs]
def skip_this_input():
pass
results = []
samples = iter(to_sample)
next_sample = next(samples)
for i, compute_date in enumerate(dates):
if next_sample == compute_date:
results.append(
real_compute(
prepare_inputs(),
dates[i:i + 1],
assets,
mask[i:i + 1],
)
)
try:
next_sample = next(samples)
except StopIteration:
# No more samples to take. Set next_sample to Nat, which
# compares False with any other datetime.
next_sample = pd_NaT
else:
skip_this_input()
# Copy results from previous sample period.
results.append(results[-1])
# We should have exhausted our sample dates.
try:
next_sample = next(samples)
except StopIteration:
pass
else:
raise AssertionError("Unconsumed sample date: %s" % next_sample)
# Concatenate stored results.
return vstack(results)
|
python
|
def _compute(self, inputs, dates, assets, mask):
"""
Compute by delegating to self._wrapped_term._compute on sample dates.
On non-sample dates, forward-fill from previously-computed samples.
"""
to_sample = dates[select_sampling_indices(dates, self._frequency)]
assert to_sample[0] == dates[0], \
"Misaligned sampling dates in %s." % type(self).__name__
real_compute = self._wrapped_term._compute
# Inputs will contain different kinds of values depending on whether or
# not we're a windowed computation.
# If we're windowed, then `inputs` is a list of iterators of ndarrays.
# If we're not windowed, then `inputs` is just a list of ndarrays.
# There are two things we care about doing with the input:
# 1. Preparing an input to be passed to our wrapped term.
# 2. Skipping an input if we're going to use an already-computed row.
# We perform these actions differently based on the expected kind of
# input, and we encapsulate these actions with closures so that we
# don't clutter the code below with lots of branching.
if self.windowed:
# If we're windowed, inputs are stateful AdjustedArrays. We don't
# need to do any preparation before forwarding to real_compute, but
# we need to call `next` on them if we want to skip an iteration.
def prepare_inputs():
return inputs
def skip_this_input():
for w in inputs:
next(w)
else:
# If we're not windowed, inputs are just ndarrays. We need to
# slice out a single row when forwarding to real_compute, but we
# don't need to do anything to skip an input.
def prepare_inputs():
# i is the loop iteration variable below.
return [a[[i]] for a in inputs]
def skip_this_input():
pass
results = []
samples = iter(to_sample)
next_sample = next(samples)
for i, compute_date in enumerate(dates):
if next_sample == compute_date:
results.append(
real_compute(
prepare_inputs(),
dates[i:i + 1],
assets,
mask[i:i + 1],
)
)
try:
next_sample = next(samples)
except StopIteration:
# No more samples to take. Set next_sample to Nat, which
# compares False with any other datetime.
next_sample = pd_NaT
else:
skip_this_input()
# Copy results from previous sample period.
results.append(results[-1])
# We should have exhausted our sample dates.
try:
next_sample = next(samples)
except StopIteration:
pass
else:
raise AssertionError("Unconsumed sample date: %s" % next_sample)
# Concatenate stored results.
return vstack(results)
|
[
"def",
"_compute",
"(",
"self",
",",
"inputs",
",",
"dates",
",",
"assets",
",",
"mask",
")",
":",
"to_sample",
"=",
"dates",
"[",
"select_sampling_indices",
"(",
"dates",
",",
"self",
".",
"_frequency",
")",
"]",
"assert",
"to_sample",
"[",
"0",
"]",
"==",
"dates",
"[",
"0",
"]",
",",
"\"Misaligned sampling dates in %s.\"",
"%",
"type",
"(",
"self",
")",
".",
"__name__",
"real_compute",
"=",
"self",
".",
"_wrapped_term",
".",
"_compute",
"# Inputs will contain different kinds of values depending on whether or",
"# not we're a windowed computation.",
"# If we're windowed, then `inputs` is a list of iterators of ndarrays.",
"# If we're not windowed, then `inputs` is just a list of ndarrays.",
"# There are two things we care about doing with the input:",
"# 1. Preparing an input to be passed to our wrapped term.",
"# 2. Skipping an input if we're going to use an already-computed row.",
"# We perform these actions differently based on the expected kind of",
"# input, and we encapsulate these actions with closures so that we",
"# don't clutter the code below with lots of branching.",
"if",
"self",
".",
"windowed",
":",
"# If we're windowed, inputs are stateful AdjustedArrays. We don't",
"# need to do any preparation before forwarding to real_compute, but",
"# we need to call `next` on them if we want to skip an iteration.",
"def",
"prepare_inputs",
"(",
")",
":",
"return",
"inputs",
"def",
"skip_this_input",
"(",
")",
":",
"for",
"w",
"in",
"inputs",
":",
"next",
"(",
"w",
")",
"else",
":",
"# If we're not windowed, inputs are just ndarrays. We need to",
"# slice out a single row when forwarding to real_compute, but we",
"# don't need to do anything to skip an input.",
"def",
"prepare_inputs",
"(",
")",
":",
"# i is the loop iteration variable below.",
"return",
"[",
"a",
"[",
"[",
"i",
"]",
"]",
"for",
"a",
"in",
"inputs",
"]",
"def",
"skip_this_input",
"(",
")",
":",
"pass",
"results",
"=",
"[",
"]",
"samples",
"=",
"iter",
"(",
"to_sample",
")",
"next_sample",
"=",
"next",
"(",
"samples",
")",
"for",
"i",
",",
"compute_date",
"in",
"enumerate",
"(",
"dates",
")",
":",
"if",
"next_sample",
"==",
"compute_date",
":",
"results",
".",
"append",
"(",
"real_compute",
"(",
"prepare_inputs",
"(",
")",
",",
"dates",
"[",
"i",
":",
"i",
"+",
"1",
"]",
",",
"assets",
",",
"mask",
"[",
"i",
":",
"i",
"+",
"1",
"]",
",",
")",
")",
"try",
":",
"next_sample",
"=",
"next",
"(",
"samples",
")",
"except",
"StopIteration",
":",
"# No more samples to take. Set next_sample to Nat, which",
"# compares False with any other datetime.",
"next_sample",
"=",
"pd_NaT",
"else",
":",
"skip_this_input",
"(",
")",
"# Copy results from previous sample period.",
"results",
".",
"append",
"(",
"results",
"[",
"-",
"1",
"]",
")",
"# We should have exhausted our sample dates.",
"try",
":",
"next_sample",
"=",
"next",
"(",
"samples",
")",
"except",
"StopIteration",
":",
"pass",
"else",
":",
"raise",
"AssertionError",
"(",
"\"Unconsumed sample date: %s\"",
"%",
"next_sample",
")",
"# Concatenate stored results.",
"return",
"vstack",
"(",
"results",
")"
] |
Compute by delegating to self._wrapped_term._compute on sample dates.
On non-sample dates, forward-fill from previously-computed samples.
|
[
"Compute",
"by",
"delegating",
"to",
"self",
".",
"_wrapped_term",
".",
"_compute",
"on",
"sample",
"dates",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/mixins.py#L439-L516
|
train
|
Compute the term for the given dates.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,x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VQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(0b10010 + 0o42) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(0b110011) + '\061' + '\067', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1010 + 0o50) + '\x31' + chr(0b100101 + 0o14), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10111 + 0o40) + chr(0b10110 + 0o41), 23921 - 23913), ehT0Px3KOsy9(chr(48) + chr(11382 - 11271) + '\062' + chr(1777 - 1727) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101011 + 0o4) + chr(49) + chr(55) + chr(0b10011 + 0o40), 57071 - 57063), ehT0Px3KOsy9(chr(636 - 588) + chr(0b1101111) + chr(0b10110 + 0o33) + '\x34' + chr(0b10011 + 0o43), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + chr(0b10111 + 0o33) + '\066' + chr(0b111 + 0o53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + chr(1944 - 1892) + chr(0b110111), 9605 - 9597), ehT0Px3KOsy9(chr(1441 - 1393) + '\x6f' + chr(0b11 + 0o57) + chr(50) + '\x37', 0o10), ehT0Px3KOsy9(chr(2003 - 1955) + chr(111) + chr(1536 - 1485) + '\063' + chr(48), 22946 - 22938), ehT0Px3KOsy9(chr(655 - 607) + chr(0b1101111) + chr(0b110010) + chr(0b110011) + chr(2258 - 2209), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b11100 + 0o123) + chr(0b11100 + 0o25) + chr(0b110011) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x34' + chr(48), 0o10), ehT0Px3KOsy9(chr(2248 - 2200) + chr(0b1001111 + 0o40) + chr(53) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(1220 - 1172) + chr(0b1101111) + chr(0b110001) + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100111 + 0o12) + '\x33' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(10867 - 10756) + chr(50) + '\x37' + '\066', 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1101111) + chr(1332 - 1282) + chr(0b110111) + chr(510 - 455), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(2632 - 2580) + chr(1607 - 1558), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b111001 + 0o66) + '\065' + chr(1871 - 1819), 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(2599 - 2488) + chr(0b110 + 0o53) + chr(276 - 223) + chr(0b11001 + 0o36), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(1850 - 1739) + chr(0b101011 + 0o7) + '\067' + chr(0b110011), 65464 - 65456), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + '\062' + '\x32', 26126 - 26118), ehT0Px3KOsy9(chr(109 - 61) + chr(6613 - 6502) + chr(0b1100 + 0o47) + '\x36' + chr(1990 - 1942), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\x6f' + '\063' + chr(52) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(0b10000 + 0o41) + chr(0b101010 + 0o13), 0o10), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(111) + chr(1378 - 1327) + '\x30' + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1101111) + chr(51) + chr(0b101101 + 0o12) + chr(2002 - 1952), ord("\x08")), ehT0Px3KOsy9(chr(2199 - 2151) + chr(111) + chr(0b11001 + 0o32) + chr(0b11000 + 0o37) + chr(557 - 506), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10001 + 0o42) + '\062' + chr(1555 - 1503), 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\157' + chr(1129 - 1079) + '\062' + chr(49), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(800 - 750) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + chr(0b110010) + chr(0b10010 + 0o42) + chr(485 - 430), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(0b110110) + '\063', 63277 - 63269), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100110 + 0o20) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + '\067' + '\063', 8), ehT0Px3KOsy9(chr(2048 - 2000) + chr(0b1010001 + 0o36) + '\062' + chr(736 - 683) + chr(1286 - 1235), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(1528 - 1417) + chr(51) + chr(52) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1001 + 0o50) + '\x32' + '\x31', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + '\065' + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'J'), chr(2114 - 2014) + chr(8519 - 8418) + chr(0b1100011) + chr(0b1011111 + 0o20) + chr(0b101110 + 0o66) + chr(0b1100101))(chr(9338 - 9221) + chr(116) + '\x66' + chr(0b11010 + 0o23) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def PeHoGDqlkidn(oVre8I6UXc3b, vXoupepMtCXU, SLiSZu5nk7Kn, YGFU3oxACPcg, Iz1jSgUKZDvt):
R3TEDFptZfsV = SLiSZu5nk7Kn[hfxGr5EiFpw5(SLiSZu5nk7Kn, oVre8I6UXc3b._frequency)]
assert R3TEDFptZfsV[ehT0Px3KOsy9(chr(48) + chr(0b100001 + 0o116) + chr(0b100100 + 0o14), 6866 - 6858)] == SLiSZu5nk7Kn[ehT0Px3KOsy9('\060' + chr(2125 - 2014) + chr(48), 8)], xafqLlk3kkUe(SXOLrMavuUCe(b')\xa6\xfa^\xfc\x12\x01\xdc\xc2\xf3\xf8\xea=M_g4\xd0\xd8\x81H\x0e\xcf\xf7\x83\xc4\xa4\xa8\xda\xde\xa7\xbf'), chr(0b1100100) + '\x65' + '\x63' + chr(10355 - 10244) + '\x64' + chr(6010 - 5909))(chr(0b1101 + 0o150) + '\x74' + '\146' + chr(0b101101) + chr(0b100011 + 0o25)) % xafqLlk3kkUe(wmQmyeWBmUpv(oVre8I6UXc3b), xafqLlk3kkUe(SXOLrMavuUCe(b'#\xad\xecU\xa4\x14<\xc3\xec\xdb\x99\xaf'), chr(100) + chr(237 - 136) + chr(99) + chr(111) + chr(100) + '\145')(chr(0b1110101) + chr(116) + chr(0b1100110) + '\055' + chr(56)))
rBOxjCYpz7eG = oVre8I6UXc3b._wrapped_term._compute
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x13\xa6\xe7[\xff\x0c\x03\xd6'), chr(0b1100100) + '\145' + '\143' + '\x6f' + '\x64' + chr(0b1100101))('\x75' + chr(0b110101 + 0o77) + chr(2725 - 2623) + chr(0b1010 + 0o43) + '\070')):
def UMbIIqFM3sCY():
return vXoupepMtCXU
def thdGOtqM3wQJ():
for AOfzRywRzEXp in vXoupepMtCXU:
nSwwHEeM4cxI(AOfzRywRzEXp)
else:
def UMbIIqFM3sCY():
return [XPh1qbAgrPgG[[WVxHKyX45z_L]] for XPh1qbAgrPgG in vXoupepMtCXU]
def thdGOtqM3wQJ():
pass
iIGKX2zSEGYP = []
db1_IZvznkcy = ZdP978XkGspL(R3TEDFptZfsV)
rLx8RQupvoI3 = nSwwHEeM4cxI(db1_IZvznkcy)
for (WVxHKyX45z_L, TcLZsZXhMVwC) in YlkZvXL8qwsX(SLiSZu5nk7Kn):
if rLx8RQupvoI3 == TcLZsZXhMVwC:
xafqLlk3kkUe(iIGKX2zSEGYP, xafqLlk3kkUe(SXOLrMavuUCe(b'\x05\xbf\xf9Z\xfe\x1f'), chr(0b1011100 + 0o10) + '\145' + chr(99) + '\x6f' + '\144' + chr(4367 - 4266))(chr(0b1010110 + 0o37) + chr(11442 - 11326) + chr(0b1010011 + 0o23) + chr(0b101101) + chr(0b11011 + 0o35)))(rBOxjCYpz7eG(UMbIIqFM3sCY(), SLiSZu5nk7Kn[WVxHKyX45z_L:WVxHKyX45z_L + ehT0Px3KOsy9('\060' + '\157' + '\061', 0o10)], YGFU3oxACPcg, Iz1jSgUKZDvt[WVxHKyX45z_L:WVxHKyX45z_L + ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001), 8)]))
try:
rLx8RQupvoI3 = nSwwHEeM4cxI(db1_IZvznkcy)
except hr2QaoivbFQ2:
rLx8RQupvoI3 = PVlSW7DWcUim
else:
thdGOtqM3wQJ()
xafqLlk3kkUe(iIGKX2zSEGYP, xafqLlk3kkUe(SXOLrMavuUCe(b'\x05\xbf\xf9Z\xfe\x1f'), '\144' + chr(0b1111 + 0o126) + chr(5990 - 5891) + chr(6300 - 6189) + '\144' + chr(0b1100101))(chr(117) + '\164' + chr(0b1011000 + 0o16) + chr(45) + '\x38'))(iIGKX2zSEGYP[-ehT0Px3KOsy9(chr(258 - 210) + chr(8907 - 8796) + chr(49), 8)])
try:
rLx8RQupvoI3 = nSwwHEeM4cxI(db1_IZvznkcy)
except hr2QaoivbFQ2:
pass
else:
raise vcEHXBQXuDuh(xafqLlk3kkUe(SXOLrMavuUCe(b'1\xa1\xeaP\xfe\x08\x13\xdf\xc2\xf3\xf8\xea=M_g8\x9e\xdb\xc0X\n\x81\xb2\xd5\x97'), '\144' + chr(3014 - 2913) + chr(0b1011100 + 0o7) + '\157' + '\x64' + chr(0b111110 + 0o47))(chr(0b1110101) + chr(116) + '\x66' + chr(0b101 + 0o50) + '\070') % rLx8RQupvoI3)
return QinywAuNOHNA(iIGKX2zSEGYP)
|
quantopian/zipline
|
zipline/pipeline/mixins.py
|
DownsampledMixin.make_downsampled_type
|
def make_downsampled_type(cls, other_base):
"""
Factory for making Downsampled{Filter,Factor,Classifier}.
"""
docstring = dedent(
"""
A {t} that defers to another {t} at lower-than-daily frequency.
Parameters
----------
term : {t}
{{frequency}}
"""
).format(t=other_base.__name__)
doc = format_docstring(
owner_name=other_base.__name__,
docstring=docstring,
formatters={'frequency': PIPELINE_DOWNSAMPLING_FREQUENCY_DOC},
)
return type(
'Downsampled' + other_base.__name__,
(cls, other_base,),
{'__doc__': doc,
'__module__': other_base.__module__},
)
|
python
|
def make_downsampled_type(cls, other_base):
"""
Factory for making Downsampled{Filter,Factor,Classifier}.
"""
docstring = dedent(
"""
A {t} that defers to another {t} at lower-than-daily frequency.
Parameters
----------
term : {t}
{{frequency}}
"""
).format(t=other_base.__name__)
doc = format_docstring(
owner_name=other_base.__name__,
docstring=docstring,
formatters={'frequency': PIPELINE_DOWNSAMPLING_FREQUENCY_DOC},
)
return type(
'Downsampled' + other_base.__name__,
(cls, other_base,),
{'__doc__': doc,
'__module__': other_base.__module__},
)
|
[
"def",
"make_downsampled_type",
"(",
"cls",
",",
"other_base",
")",
":",
"docstring",
"=",
"dedent",
"(",
"\"\"\"\n A {t} that defers to another {t} at lower-than-daily frequency.\n\n Parameters\n ----------\n term : {t}\n {{frequency}}\n \"\"\"",
")",
".",
"format",
"(",
"t",
"=",
"other_base",
".",
"__name__",
")",
"doc",
"=",
"format_docstring",
"(",
"owner_name",
"=",
"other_base",
".",
"__name__",
",",
"docstring",
"=",
"docstring",
",",
"formatters",
"=",
"{",
"'frequency'",
":",
"PIPELINE_DOWNSAMPLING_FREQUENCY_DOC",
"}",
",",
")",
"return",
"type",
"(",
"'Downsampled'",
"+",
"other_base",
".",
"__name__",
",",
"(",
"cls",
",",
"other_base",
",",
")",
",",
"{",
"'__doc__'",
":",
"doc",
",",
"'__module__'",
":",
"other_base",
".",
"__module__",
"}",
",",
")"
] |
Factory for making Downsampled{Filter,Factor,Classifier}.
|
[
"Factory",
"for",
"making",
"Downsampled",
"{",
"Filter",
"Factor",
"Classifier",
"}",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/mixins.py#L519-L545
|
train
|
Returns a type that can be used to create a Downs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RZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + '\062' + chr(2479 - 2424) + '\x30', 42724 - 42716), ehT0Px3KOsy9(chr(850 - 802) + chr(9023 - 8912) + '\062' + chr(0b10001 + 0o41) + '\x32', 64848 - 64840), ehT0Px3KOsy9(chr(2059 - 2011) + '\x6f' + chr(0b110010) + '\066' + chr(0b101000 + 0o10), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(52) + chr(0b110010), 28494 - 28486), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(461 - 410) + chr(53) + chr(2737 - 2683), 19927 - 19919), ehT0Px3KOsy9('\060' + chr(3325 - 3214) + chr(0b110001) + chr(0b100101 + 0o13) + chr(52), 10843 - 10835), ehT0Px3KOsy9(chr(689 - 641) + '\157' + chr(49) + chr(851 - 799), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(641 - 590), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(52) + '\x31', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(2220 - 2171) + chr(54) + chr(637 - 586), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11011 + 0o27) + '\063' + chr(54), 38229 - 38221), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(0b0 + 0o62) + chr(2729 - 2676), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(0b110000) + chr(1387 - 1338), 19846 - 19838), ehT0Px3KOsy9('\060' + chr(4776 - 4665) + '\x32' + '\063' + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001110 + 0o41) + '\x33' + chr(0b110100) + chr(49), 46562 - 46554), ehT0Px3KOsy9(chr(0b110000) + chr(7564 - 7453) + chr(784 - 735) + chr(1648 - 1598) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1163 - 1052) + '\062' + chr(0b100011 + 0o23) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(49) + chr(0b110110) + '\x33', 8), ehT0Px3KOsy9(chr(0b110000) + chr(7935 - 7824) + chr(955 - 904) + chr(0b110111) + '\x32', 0b1000), ehT0Px3KOsy9(chr(1003 - 955) + chr(0b1101111) + '\062' + '\x30' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(363 - 315) + chr(111) + chr(0b110010) + chr(0b110101) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(111) + chr(50) + chr(0b1010 + 0o53) + chr(48), 26465 - 26457), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(54) + chr(0b110000), 8), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + chr(0b110001) + chr(409 - 357), ord("\x08")), ehT0Px3KOsy9('\060' + chr(3176 - 3065) + chr(0b100011 + 0o17) + '\063' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(819 - 768) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(2657 - 2546) + '\x31' + chr(935 - 880) + chr(0b1101 + 0o52), 25967 - 25959), ehT0Px3KOsy9('\x30' + '\157' + '\066' + chr(0b11011 + 0o26), 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1101111) + chr(899 - 848) + chr(50) + chr(49), 0o10), ehT0Px3KOsy9(chr(682 - 634) + '\x6f' + chr(0b110001) + '\x34' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x30', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001 + 0o146) + '\x32' + chr(0b110011) + chr(713 - 665), 8), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(0b100011 + 0o20) + chr(0b110111) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(0b1001 + 0o47) + chr(54), 29175 - 29167), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + '\x32' + chr(48) + chr(1701 - 1649), 0o10), ehT0Px3KOsy9('\x30' + chr(8114 - 8003) + chr(0b110010) + chr(0b1111 + 0o44) + chr(0b101000 + 0o13), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(764 - 715) + chr(50) + chr(1202 - 1153), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(11786 - 11675) + chr(414 - 363) + '\065' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + '\063' + '\062', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + '\x32' + chr(1515 - 1460), 40046 - 40038)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b111001 + 0o66) + chr(1791 - 1738) + chr(1848 - 1800), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x96'), chr(8028 - 7928) + chr(0b1100101) + chr(0b1100010 + 0o1) + chr(0b10010 + 0o135) + chr(6704 - 6604) + '\x65')('\x75' + '\164' + chr(102) + chr(1425 - 1380) + chr(0b10101 + 0o43)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def LVNiq8F6cy9a(NSstowUUZlxS, YTDvgQnQGS5j):
nVYJv7AZy3Rn = ojh11Z5rxCFF(xafqLlk3kkUe(SXOLrMavuUCe(b"\xb2\xb2\x90\xc2\xced,3\x01S\xbe\xf5\xe1\xd9\xc1(\xc3\x0e\xda\xf6\xc6\xc9\xc4\xac\xfb\xff\x19T\xa3\x14 \xec\x90\xa6\xe5\xf5>\x9c\xb2\xf2\xca\xb2\xcb\x96\x93dmg\x01\x1f\xf1\xa2\xa4\xea\xcc'\xdf\x12\x94\xaf\xca\xc9\xd9\xe0\xe6\xba\x19C\xb4\x16u\xfd\x91\xe5\xfd\xb5[\xe2\xfa\xb7\x98\xb2\x90\xc2\xced,3\x01S\xce\xb4\xb3\xf9\x8c6\xc3\x16\x88\xf1\xa4\x88\x90\xac\xbf\xba_\x11\xf1G \xb8\xdf\xab\xa9\xb6|\xc5\xf7\xba\x95\xbf\x9d\xe8\xced,3\x01S\xbe\xf5\xe1\xb8\xc1s\xc3\x16\x88\xef\x8e\x92\x90\xf7\xeb\xe7u\x11\xf1G \xb8\xdf\xa6\xa4\xbbq\xc8\xfa\xec\xc3\xf4\xc2\x87\x9f1i}B\n\xe3\xa8\xcb\xb8\xc1s\x97S\xda\xa2\x8e\x88\x90\xac\xbf"), '\144' + '\145' + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(117) + '\x74' + '\146' + '\055' + '\x38')).V4roHaS3Ppej(t=YTDvgQnQGS5j.Gbej4oZqKLA6)
JCpEgna6NeKD = K3yzJYhHpN_t(owner_name=YTDvgQnQGS5j.Gbej4oZqKLA6, docstring=nVYJv7AZy3Rn, formatters={xafqLlk3kkUe(SXOLrMavuUCe(b'\xde\xe0\xd5\x93\x9b!bpX'), chr(0b1111 + 0o125) + '\145' + chr(0b100110 + 0o75) + '\157' + chr(0b1100100) + chr(101))('\165' + chr(0b111000 + 0o74) + '\x66' + '\x2d' + chr(0b111000)): ITpPFfkktqdn})
return wmQmyeWBmUpv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfc\xfd\xc7\x8c\x9d%acM\x16\xfa'), '\x64' + '\x65' + chr(0b1100011) + chr(9468 - 9357) + '\x64' + '\145')('\165' + chr(0b110 + 0o156) + '\146' + chr(0b101101) + chr(56)) + xafqLlk3kkUe(YTDvgQnQGS5j, xafqLlk3kkUe(SXOLrMavuUCe(b'\xff\xf0\xd5\x88\xda+Vbj?\xdf\xe3'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(111) + chr(0b1100100) + chr(101))('\x75' + chr(8719 - 8603) + chr(4597 - 4495) + '\055' + '\070')), (NSstowUUZlxS, YTDvgQnQGS5j), {xafqLlk3kkUe(SXOLrMavuUCe(b'\xe7\xcd\xd4\x8d\x8d\x1bS'), '\144' + chr(101) + chr(0b1010110 + 0o15) + chr(8314 - 8203) + '\x64' + chr(1115 - 1014))(chr(3569 - 3452) + chr(821 - 705) + chr(0b101101 + 0o71) + chr(45) + '\x38'): JCpEgna6NeKD, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe7\xcd\xdd\x8d\x8a1`v~,'), chr(100) + chr(0b1100101) + chr(6601 - 6502) + chr(8282 - 8171) + '\x64' + '\145')(chr(0b110010 + 0o103) + chr(116) + '\146' + chr(1720 - 1675) + '\x38'): xafqLlk3kkUe(YTDvgQnQGS5j, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf1\xd6\xfa\xd5\x98\x14|YG\x1c\xaf\x90'), chr(100) + '\145' + chr(0b1100011) + chr(0b1110 + 0o141) + '\144' + chr(0b100100 + 0o101))('\165' + chr(0b110101 + 0o77) + '\x66' + chr(45) + chr(0b1100 + 0o54)))})
|
quantopian/zipline
|
zipline/utils/preprocess.py
|
preprocess
|
def preprocess(*_unused, **processors):
"""
Decorator that applies pre-processors to the arguments of a function before
calling the function.
Parameters
----------
**processors : dict
Map from argument name -> processor function.
A processor function takes three arguments: (func, argname, argvalue).
`func` is the the function for which we're processing args.
`argname` is the name of the argument we're processing.
`argvalue` is the value of the argument we're processing.
Examples
--------
>>> def _ensure_tuple(func, argname, arg):
... if isinstance(arg, tuple):
... return argvalue
... try:
... return tuple(arg)
... except TypeError:
... raise TypeError(
... "%s() expected argument '%s' to"
... " be iterable, but got %s instead." % (
... func.__name__, argname, arg,
... )
... )
...
>>> @preprocess(arg=_ensure_tuple)
... def foo(arg):
... return arg
...
>>> foo([1, 2, 3])
(1, 2, 3)
>>> foo("a")
('a',)
>>> foo(2)
Traceback (most recent call last):
...
TypeError: foo() expected argument 'arg' to be iterable, but got 2 instead.
"""
if _unused:
raise TypeError("preprocess() doesn't accept positional arguments")
def _decorator(f):
args, varargs, varkw, defaults = argspec = getargspec(f)
if defaults is None:
defaults = ()
no_defaults = (NO_DEFAULT,) * (len(args) - len(defaults))
args_defaults = list(zip(args, no_defaults + defaults))
if varargs:
args_defaults.append((varargs, NO_DEFAULT))
if varkw:
args_defaults.append((varkw, NO_DEFAULT))
argset = set(args) | {varargs, varkw} - {None}
# Arguments can be declared as tuples in Python 2.
if not all(isinstance(arg, str) for arg in args):
raise TypeError(
"Can't validate functions using tuple unpacking: %s" %
(argspec,)
)
# Ensure that all processors map to valid names.
bad_names = viewkeys(processors) - argset
if bad_names:
raise TypeError(
"Got processors for unknown arguments: %s." % bad_names
)
return _build_preprocessed_function(
f, processors, args_defaults, varargs, varkw,
)
return _decorator
|
python
|
def preprocess(*_unused, **processors):
"""
Decorator that applies pre-processors to the arguments of a function before
calling the function.
Parameters
----------
**processors : dict
Map from argument name -> processor function.
A processor function takes three arguments: (func, argname, argvalue).
`func` is the the function for which we're processing args.
`argname` is the name of the argument we're processing.
`argvalue` is the value of the argument we're processing.
Examples
--------
>>> def _ensure_tuple(func, argname, arg):
... if isinstance(arg, tuple):
... return argvalue
... try:
... return tuple(arg)
... except TypeError:
... raise TypeError(
... "%s() expected argument '%s' to"
... " be iterable, but got %s instead." % (
... func.__name__, argname, arg,
... )
... )
...
>>> @preprocess(arg=_ensure_tuple)
... def foo(arg):
... return arg
...
>>> foo([1, 2, 3])
(1, 2, 3)
>>> foo("a")
('a',)
>>> foo(2)
Traceback (most recent call last):
...
TypeError: foo() expected argument 'arg' to be iterable, but got 2 instead.
"""
if _unused:
raise TypeError("preprocess() doesn't accept positional arguments")
def _decorator(f):
args, varargs, varkw, defaults = argspec = getargspec(f)
if defaults is None:
defaults = ()
no_defaults = (NO_DEFAULT,) * (len(args) - len(defaults))
args_defaults = list(zip(args, no_defaults + defaults))
if varargs:
args_defaults.append((varargs, NO_DEFAULT))
if varkw:
args_defaults.append((varkw, NO_DEFAULT))
argset = set(args) | {varargs, varkw} - {None}
# Arguments can be declared as tuples in Python 2.
if not all(isinstance(arg, str) for arg in args):
raise TypeError(
"Can't validate functions using tuple unpacking: %s" %
(argspec,)
)
# Ensure that all processors map to valid names.
bad_names = viewkeys(processors) - argset
if bad_names:
raise TypeError(
"Got processors for unknown arguments: %s." % bad_names
)
return _build_preprocessed_function(
f, processors, args_defaults, varargs, varkw,
)
return _decorator
|
[
"def",
"preprocess",
"(",
"*",
"_unused",
",",
"*",
"*",
"processors",
")",
":",
"if",
"_unused",
":",
"raise",
"TypeError",
"(",
"\"preprocess() doesn't accept positional arguments\"",
")",
"def",
"_decorator",
"(",
"f",
")",
":",
"args",
",",
"varargs",
",",
"varkw",
",",
"defaults",
"=",
"argspec",
"=",
"getargspec",
"(",
"f",
")",
"if",
"defaults",
"is",
"None",
":",
"defaults",
"=",
"(",
")",
"no_defaults",
"=",
"(",
"NO_DEFAULT",
",",
")",
"*",
"(",
"len",
"(",
"args",
")",
"-",
"len",
"(",
"defaults",
")",
")",
"args_defaults",
"=",
"list",
"(",
"zip",
"(",
"args",
",",
"no_defaults",
"+",
"defaults",
")",
")",
"if",
"varargs",
":",
"args_defaults",
".",
"append",
"(",
"(",
"varargs",
",",
"NO_DEFAULT",
")",
")",
"if",
"varkw",
":",
"args_defaults",
".",
"append",
"(",
"(",
"varkw",
",",
"NO_DEFAULT",
")",
")",
"argset",
"=",
"set",
"(",
"args",
")",
"|",
"{",
"varargs",
",",
"varkw",
"}",
"-",
"{",
"None",
"}",
"# Arguments can be declared as tuples in Python 2.",
"if",
"not",
"all",
"(",
"isinstance",
"(",
"arg",
",",
"str",
")",
"for",
"arg",
"in",
"args",
")",
":",
"raise",
"TypeError",
"(",
"\"Can't validate functions using tuple unpacking: %s\"",
"%",
"(",
"argspec",
",",
")",
")",
"# Ensure that all processors map to valid names.",
"bad_names",
"=",
"viewkeys",
"(",
"processors",
")",
"-",
"argset",
"if",
"bad_names",
":",
"raise",
"TypeError",
"(",
"\"Got processors for unknown arguments: %s.\"",
"%",
"bad_names",
")",
"return",
"_build_preprocessed_function",
"(",
"f",
",",
"processors",
",",
"args_defaults",
",",
"varargs",
",",
"varkw",
",",
")",
"return",
"_decorator"
] |
Decorator that applies pre-processors to the arguments of a function before
calling the function.
Parameters
----------
**processors : dict
Map from argument name -> processor function.
A processor function takes three arguments: (func, argname, argvalue).
`func` is the the function for which we're processing args.
`argname` is the name of the argument we're processing.
`argvalue` is the value of the argument we're processing.
Examples
--------
>>> def _ensure_tuple(func, argname, arg):
... if isinstance(arg, tuple):
... return argvalue
... try:
... return tuple(arg)
... except TypeError:
... raise TypeError(
... "%s() expected argument '%s' to"
... " be iterable, but got %s instead." % (
... func.__name__, argname, arg,
... )
... )
...
>>> @preprocess(arg=_ensure_tuple)
... def foo(arg):
... return arg
...
>>> foo([1, 2, 3])
(1, 2, 3)
>>> foo("a")
('a',)
>>> foo(2)
Traceback (most recent call last):
...
TypeError: foo() expected argument 'arg' to be iterable, but got 2 instead.
|
[
"Decorator",
"that",
"applies",
"pre",
"-",
"processors",
"to",
"the",
"arguments",
"of",
"a",
"function",
"before",
"calling",
"the",
"function",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/utils/preprocess.py#L35-L112
|
train
|
Decorator that applies pre - processors to the arguments of a function before calling the function.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj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,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b111101 + 0o62) + chr(49) + chr(0b1110 + 0o45) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(54) + chr(2641 - 2589), 0o10), ehT0Px3KOsy9('\x30' + chr(7525 - 7414) + chr(0b110001) + chr(2273 - 2223) + chr(54), 3545 - 3537), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(0b1110 + 0o44) + chr(0b110111) + chr(49), 20007 - 19999), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + '\x34' + chr(2777 - 2722), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x36' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11542 - 11431) + '\x33' + '\x30' + '\060', 62179 - 62171), ehT0Px3KOsy9(chr(0b110000) + chr(0b1110 + 0o141) + chr(50) + '\x33' + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(0b110110 + 0o1) + chr(2257 - 2208), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + '\067' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(110 - 62) + chr(0b1 + 0o156) + chr(0b110011) + '\060' + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1001101 + 0o42) + '\x31' + '\x30' + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1405 - 1355) + '\065' + chr(50), 19274 - 19266), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b110111 + 0o70) + chr(0b110011) + '\066' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(0b11111 + 0o21) + chr(50), 15110 - 15102), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10000 + 0o44) + '\x34', 21811 - 21803), ehT0Px3KOsy9('\060' + chr(0b1010010 + 0o35) + chr(1677 - 1628) + chr(49) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + chr(49) + '\067', 6974 - 6966), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(11857 - 11746) + chr(0b110001) + chr(0b110010 + 0o4) + chr(770 - 722), 57048 - 57040), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11100 + 0o25) + chr(0b110010) + chr(575 - 524), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10100 + 0o35) + '\x36' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + '\x33' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(0b111101 + 0o62) + chr(0b110010) + '\067' + chr(0b100110 + 0o12), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(763 - 652) + chr(2097 - 2046) + chr(48) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\x6f' + chr(0b110010) + chr(1075 - 1020) + chr(49), 8), ehT0Px3KOsy9(chr(0b110000) + chr(11567 - 11456) + '\x32' + chr(0b110100) + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + chr(0b110001) + '\x36', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + '\061' + chr(548 - 500), 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + chr(49) + '\x36' + '\x30', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001101 + 0o42) + chr(51) + '\060' + chr(2282 - 2233), 8), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\x6f' + '\063' + chr(53) + chr(2041 - 1993), 9660 - 9652), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + '\064' + chr(51), 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(5862 - 5751) + '\x31' + chr(0b110001) + chr(0b110101), 8200 - 8192), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(52) + chr(499 - 448), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(415 - 366) + chr(0b11101 + 0o23), 8), ehT0Px3KOsy9(chr(1345 - 1297) + chr(0b1101111) + chr(1608 - 1557) + chr(2482 - 2431) + chr(1286 - 1238), 13458 - 13450), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010011 + 0o34) + chr(0b111 + 0o51), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + '\x34' + '\x33', 8), ehT0Px3KOsy9(chr(1798 - 1750) + '\157' + '\063' + chr(0b110011) + chr(427 - 376), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1001110 + 0o41) + chr(2607 - 2554) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'r'), chr(0b1100100) + chr(0b101011 + 0o72) + '\143' + chr(10579 - 10468) + chr(100) + chr(3902 - 3801))(chr(117) + chr(0b111111 + 0o65) + '\x66' + chr(45) + chr(0b111 + 0o61)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def n8IJXbSueTJV(*ya8krOPlToYX, **frZ1xA36HyF0):
if ya8krOPlToYX:
raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b',\x863\xc9\x15X\xa3\xf8\xcaL\xedk\x8a\x92i\xe7W (\x04s\x15\xb8\xdb\xa4\xc9\xd3n8\x1f\xb2\x81\xd7$\x8c&\xb9l\xc3\xba.\x93#\xd4\x02Y\xb4\xee'), '\144' + chr(7976 - 7875) + chr(99) + chr(0b1101111) + chr(0b111110 + 0o46) + chr(101))(chr(4292 - 4175) + chr(116) + '\x66' + chr(45) + '\070'))
def VeQdDvuEY8FO(EGyt1xfPT1P6):
(kJDRfRhcZHjS, XPnBcq4XF5Ur, jR6wPHvf0kU1, sRkYTJirQlN8) = UuCc3Vtxh59H = TF3y0nq90QLr(EGyt1xfPT1P6)
if sRkYTJirQlN8 is None:
sRkYTJirQlN8 = ()
howUjopPeRng = (QSYPb_39gyZb,) * (c2A0yzQpDQB3(kJDRfRhcZHjS) - c2A0yzQpDQB3(sRkYTJirQlN8))
SiSSA3CbFx_l = YyaZ4tpXu4lf(pZ0NK2y6HRbn(kJDRfRhcZHjS, howUjopPeRng + sRkYTJirQlN8))
if XPnBcq4XF5Ur:
xafqLlk3kkUe(SiSSA3CbFx_l, xafqLlk3kkUe(SXOLrMavuUCe(b'=\x84&\xdc\tS'), chr(5637 - 5537) + '\x65' + chr(0b110110 + 0o55) + '\157' + '\x64' + '\145')(chr(5508 - 5391) + chr(0b1110000 + 0o4) + '\146' + chr(0b101101) + '\070'))((XPnBcq4XF5Ur, QSYPb_39gyZb))
if jR6wPHvf0kU1:
xafqLlk3kkUe(SiSSA3CbFx_l, xafqLlk3kkUe(SXOLrMavuUCe(b'=\x84&\xdc\tS'), '\x64' + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(100) + '\x65')(chr(117) + chr(116) + chr(4113 - 4011) + chr(45) + chr(0b10 + 0o66)))((jR6wPHvf0kU1, QSYPb_39gyZb))
a14QTvyK9oMw = MVEN8G6CxlvR(kJDRfRhcZHjS) | {XPnBcq4XF5Ur, jR6wPHvf0kU1} - {None}
if not Dl48nj1rbi23((PlSM16l2KDPD(LTE9MPUbqSos, M8_cKLkHVB2V) for LTE9MPUbqSos in kJDRfRhcZHjS)):
raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b"\x1f\x958\x9e\x13\x17\xb6\xfc\xd5V\xa1#\xde\x93&\xe4Q l\x04:\x1b\xb5\xcb\xe1\xcc\xd4'&\x17\xe1\x9c\xd6=\x8f-\xf8u\x8d\xab=\x97=\xd0\tP\xfa\xbd\x9cL"), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1101101 + 0o2) + chr(0b1100100) + chr(0b1100101))('\165' + chr(116) + '\146' + chr(968 - 923) + '\070') % (UuCc3Vtxh59H,))
eOGHDOpMiXig = ibVce80NjHnP(frZ1xA36HyF0) - a14QTvyK9oMw
if eOGHDOpMiXig:
raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1b\x9b"\x99\x17E\xaf\xfe\xdcL\xb6-\xd8\x85&\xe4K</\x05=\x1f\xb5\xd7\xb6\xd7\x87/:\x17\xb4\x85\xc6#\x97;\xe2 \xc6\xa8r'), '\144' + chr(0b1100101) + '\143' + chr(0b101011 + 0o104) + chr(719 - 619) + chr(0b1100101))('\x75' + '\164' + chr(0b100010 + 0o104) + chr(0b100010 + 0o13) + '\070') % eOGHDOpMiXig)
return rRObbjgqoUgp(EGyt1xfPT1P6, frZ1xA36HyF0, SiSSA3CbFx_l, XPnBcq4XF5Ur, jR6wPHvf0kU1)
return VeQdDvuEY8FO
|
quantopian/zipline
|
zipline/utils/preprocess.py
|
call
|
def call(f):
"""
Wrap a function in a processor that calls `f` on the argument before
passing it along.
Useful for creating simple arguments to the `@preprocess` decorator.
Parameters
----------
f : function
Function accepting a single argument and returning a replacement.
Examples
--------
>>> @preprocess(x=call(lambda x: x + 1))
... def foo(x):
... return x
...
>>> foo(1)
2
"""
@wraps(f)
def processor(func, argname, arg):
return f(arg)
return processor
|
python
|
def call(f):
"""
Wrap a function in a processor that calls `f` on the argument before
passing it along.
Useful for creating simple arguments to the `@preprocess` decorator.
Parameters
----------
f : function
Function accepting a single argument and returning a replacement.
Examples
--------
>>> @preprocess(x=call(lambda x: x + 1))
... def foo(x):
... return x
...
>>> foo(1)
2
"""
@wraps(f)
def processor(func, argname, arg):
return f(arg)
return processor
|
[
"def",
"call",
"(",
"f",
")",
":",
"@",
"wraps",
"(",
"f",
")",
"def",
"processor",
"(",
"func",
",",
"argname",
",",
"arg",
")",
":",
"return",
"f",
"(",
"arg",
")",
"return",
"processor"
] |
Wrap a function in a processor that calls `f` on the argument before
passing it along.
Useful for creating simple arguments to the `@preprocess` decorator.
Parameters
----------
f : function
Function accepting a single argument and returning a replacement.
Examples
--------
>>> @preprocess(x=call(lambda x: x + 1))
... def foo(x):
... return x
...
>>> foo(1)
2
|
[
"Wrap",
"a",
"function",
"in",
"a",
"processor",
"that",
"calls",
"f",
"on",
"the",
"argument",
"before",
"passing",
"it",
"along",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/utils/preprocess.py#L115-L139
|
train
|
A function decorator that calls f on the argument before returning a replacement.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qR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,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101110 + 0o6) + '\065', 9393 - 9385), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(519 - 469) + chr(48) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1010100 + 0o33) + chr(51) + chr(0b10001 + 0o45) + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1424 - 1375) + chr(2682 - 2630), 0b1000), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\157' + '\065' + chr(1639 - 1588), 0o10), ehT0Px3KOsy9(chr(177 - 129) + chr(11621 - 11510) + chr(0b1011 + 0o50), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110110) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(1859 - 1811) + chr(111) + chr(408 - 359) + chr(1957 - 1903) + chr(53), 42115 - 42107), ehT0Px3KOsy9('\060' + '\x6f' + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b100111 + 0o12) + '\x33', 6494 - 6486), ehT0Px3KOsy9(chr(1684 - 1636) + chr(111) + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(394 - 340), 0o10), ehT0Px3KOsy9(chr(824 - 776) + '\x6f' + chr(0b1010 + 0o51) + '\067' + chr(50), 0o10), ehT0Px3KOsy9(chr(962 - 914) + '\x6f' + chr(727 - 676) + '\x34' + chr(677 - 623), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(2115 - 2066) + chr(0b100101 + 0o22), 54759 - 54751), ehT0Px3KOsy9('\x30' + '\157' + chr(49), 8), ehT0Px3KOsy9('\x30' + '\157' + '\063' + '\x37' + chr(52), 4940 - 4932), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b100001 + 0o116) + '\x31' + chr(0b100101 + 0o13) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11101 + 0o25) + chr(1739 - 1686) + chr(1728 - 1673), 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + '\067' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b101010 + 0o105) + '\x33', 8), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + chr(2432 - 2381) + '\x31' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(700 - 652) + '\x6f' + '\x37' + '\066', 137 - 129), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + '\063' + chr(1143 - 1090) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(2414 - 2303) + chr(2188 - 2137) + chr(0b110111) + chr(0b1000 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(55), 8), ehT0Px3KOsy9(chr(470 - 422) + chr(111) + chr(0b110011) + '\066' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1101111) + chr(0b11010 + 0o30) + chr(50) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(0b110001) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(6614 - 6503) + '\063' + chr(1408 - 1355) + chr(53), 0o10), ehT0Px3KOsy9(chr(949 - 901) + '\157' + chr(0b110001) + chr(1449 - 1395) + chr(60 - 11), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(53) + '\x37', 8), ehT0Px3KOsy9(chr(0b110000) + chr(2657 - 2546) + chr(0b11001 + 0o30) + chr(0b110010) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1101111) + chr(49) + chr(0b11001 + 0o30) + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1010110 + 0o31) + '\x31' + chr(188 - 134) + '\x36', 26987 - 26979), ehT0Px3KOsy9('\060' + chr(6944 - 6833) + chr(2398 - 2348) + chr(52) + chr(0b1001 + 0o56), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(0b10111 + 0o37) + chr(0b11010 + 0o27), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2193 - 2144) + chr(0b101010 + 0o7) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(2978 - 2867) + '\x34' + chr(51), 0b1000), ehT0Px3KOsy9(chr(1682 - 1634) + '\x6f' + chr(0b11101 + 0o25) + '\067' + '\066', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x35' + '\x30', 8910 - 8902)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x0b'), '\144' + chr(0b1010110 + 0o17) + chr(9332 - 9233) + chr(2451 - 2340) + chr(0b1100100) + chr(4363 - 4262))(chr(2720 - 2603) + chr(116) + chr(102) + chr(45) + chr(0b11 + 0o65)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def yty8SpL8o6wD(EGyt1xfPT1P6):
@cUOaMZfY2Ho1(EGyt1xfPT1P6)
def Qv_npqgRBB71(EzOtJ3kbK5x4, ugZDRzWzTXdH, LTE9MPUbqSos):
return EGyt1xfPT1P6(LTE9MPUbqSos)
return Qv_npqgRBB71
|
quantopian/zipline
|
zipline/utils/preprocess.py
|
_build_preprocessed_function
|
def _build_preprocessed_function(func,
processors,
args_defaults,
varargs,
varkw):
"""
Build a preprocessed function with the same signature as `func`.
Uses `exec` internally to build a function that actually has the same
signature as `func.
"""
format_kwargs = {'func_name': func.__name__}
def mangle(name):
return 'a' + uuid4().hex + name
format_kwargs['mangled_func'] = mangled_funcname = mangle(func.__name__)
def make_processor_assignment(arg, processor_name):
template = "{arg} = {processor}({func}, '{arg}', {arg})"
return template.format(
arg=arg,
processor=processor_name,
func=mangled_funcname,
)
exec_globals = {mangled_funcname: func, 'wraps': wraps}
defaults_seen = 0
default_name_template = 'a' + uuid4().hex + '_%d'
signature = []
call_args = []
assignments = []
star_map = {
varargs: '*',
varkw: '**',
}
def name_as_arg(arg):
return star_map.get(arg, '') + arg
for arg, default in args_defaults:
if default is NO_DEFAULT:
signature.append(name_as_arg(arg))
else:
default_name = default_name_template % defaults_seen
exec_globals[default_name] = default
signature.append('='.join([name_as_arg(arg), default_name]))
defaults_seen += 1
if arg in processors:
procname = mangle('_processor_' + arg)
exec_globals[procname] = processors[arg]
assignments.append(make_processor_assignment(arg, procname))
call_args.append(name_as_arg(arg))
exec_str = dedent(
"""\
@wraps({wrapped_funcname})
def {func_name}({signature}):
{assignments}
return {wrapped_funcname}({call_args})
"""
).format(
func_name=func.__name__,
signature=', '.join(signature),
assignments='\n '.join(assignments),
wrapped_funcname=mangled_funcname,
call_args=', '.join(call_args),
)
compiled = compile(
exec_str,
func.__code__.co_filename,
mode='exec',
)
exec_locals = {}
exec_(compiled, exec_globals, exec_locals)
new_func = exec_locals[func.__name__]
code = new_func.__code__
args = {
attr: getattr(code, attr)
for attr in dir(code)
if attr.startswith('co_')
}
# Copy the firstlineno out of the underlying function so that exceptions
# get raised with the correct traceback.
# This also makes dynamic source inspection (like IPython `??` operator)
# work as intended.
try:
# Try to get the pycode object from the underlying function.
original_code = func.__code__
except AttributeError:
try:
# The underlying callable was not a function, try to grab the
# `__func__.__code__` which exists on method objects.
original_code = func.__func__.__code__
except AttributeError:
# The underlying callable does not have a `__code__`. There is
# nothing for us to correct.
return new_func
args['co_firstlineno'] = original_code.co_firstlineno
new_func.__code__ = CodeType(*map(getitem(args), _code_argorder))
return new_func
|
python
|
def _build_preprocessed_function(func,
processors,
args_defaults,
varargs,
varkw):
"""
Build a preprocessed function with the same signature as `func`.
Uses `exec` internally to build a function that actually has the same
signature as `func.
"""
format_kwargs = {'func_name': func.__name__}
def mangle(name):
return 'a' + uuid4().hex + name
format_kwargs['mangled_func'] = mangled_funcname = mangle(func.__name__)
def make_processor_assignment(arg, processor_name):
template = "{arg} = {processor}({func}, '{arg}', {arg})"
return template.format(
arg=arg,
processor=processor_name,
func=mangled_funcname,
)
exec_globals = {mangled_funcname: func, 'wraps': wraps}
defaults_seen = 0
default_name_template = 'a' + uuid4().hex + '_%d'
signature = []
call_args = []
assignments = []
star_map = {
varargs: '*',
varkw: '**',
}
def name_as_arg(arg):
return star_map.get(arg, '') + arg
for arg, default in args_defaults:
if default is NO_DEFAULT:
signature.append(name_as_arg(arg))
else:
default_name = default_name_template % defaults_seen
exec_globals[default_name] = default
signature.append('='.join([name_as_arg(arg), default_name]))
defaults_seen += 1
if arg in processors:
procname = mangle('_processor_' + arg)
exec_globals[procname] = processors[arg]
assignments.append(make_processor_assignment(arg, procname))
call_args.append(name_as_arg(arg))
exec_str = dedent(
"""\
@wraps({wrapped_funcname})
def {func_name}({signature}):
{assignments}
return {wrapped_funcname}({call_args})
"""
).format(
func_name=func.__name__,
signature=', '.join(signature),
assignments='\n '.join(assignments),
wrapped_funcname=mangled_funcname,
call_args=', '.join(call_args),
)
compiled = compile(
exec_str,
func.__code__.co_filename,
mode='exec',
)
exec_locals = {}
exec_(compiled, exec_globals, exec_locals)
new_func = exec_locals[func.__name__]
code = new_func.__code__
args = {
attr: getattr(code, attr)
for attr in dir(code)
if attr.startswith('co_')
}
# Copy the firstlineno out of the underlying function so that exceptions
# get raised with the correct traceback.
# This also makes dynamic source inspection (like IPython `??` operator)
# work as intended.
try:
# Try to get the pycode object from the underlying function.
original_code = func.__code__
except AttributeError:
try:
# The underlying callable was not a function, try to grab the
# `__func__.__code__` which exists on method objects.
original_code = func.__func__.__code__
except AttributeError:
# The underlying callable does not have a `__code__`. There is
# nothing for us to correct.
return new_func
args['co_firstlineno'] = original_code.co_firstlineno
new_func.__code__ = CodeType(*map(getitem(args), _code_argorder))
return new_func
|
[
"def",
"_build_preprocessed_function",
"(",
"func",
",",
"processors",
",",
"args_defaults",
",",
"varargs",
",",
"varkw",
")",
":",
"format_kwargs",
"=",
"{",
"'func_name'",
":",
"func",
".",
"__name__",
"}",
"def",
"mangle",
"(",
"name",
")",
":",
"return",
"'a'",
"+",
"uuid4",
"(",
")",
".",
"hex",
"+",
"name",
"format_kwargs",
"[",
"'mangled_func'",
"]",
"=",
"mangled_funcname",
"=",
"mangle",
"(",
"func",
".",
"__name__",
")",
"def",
"make_processor_assignment",
"(",
"arg",
",",
"processor_name",
")",
":",
"template",
"=",
"\"{arg} = {processor}({func}, '{arg}', {arg})\"",
"return",
"template",
".",
"format",
"(",
"arg",
"=",
"arg",
",",
"processor",
"=",
"processor_name",
",",
"func",
"=",
"mangled_funcname",
",",
")",
"exec_globals",
"=",
"{",
"mangled_funcname",
":",
"func",
",",
"'wraps'",
":",
"wraps",
"}",
"defaults_seen",
"=",
"0",
"default_name_template",
"=",
"'a'",
"+",
"uuid4",
"(",
")",
".",
"hex",
"+",
"'_%d'",
"signature",
"=",
"[",
"]",
"call_args",
"=",
"[",
"]",
"assignments",
"=",
"[",
"]",
"star_map",
"=",
"{",
"varargs",
":",
"'*'",
",",
"varkw",
":",
"'**'",
",",
"}",
"def",
"name_as_arg",
"(",
"arg",
")",
":",
"return",
"star_map",
".",
"get",
"(",
"arg",
",",
"''",
")",
"+",
"arg",
"for",
"arg",
",",
"default",
"in",
"args_defaults",
":",
"if",
"default",
"is",
"NO_DEFAULT",
":",
"signature",
".",
"append",
"(",
"name_as_arg",
"(",
"arg",
")",
")",
"else",
":",
"default_name",
"=",
"default_name_template",
"%",
"defaults_seen",
"exec_globals",
"[",
"default_name",
"]",
"=",
"default",
"signature",
".",
"append",
"(",
"'='",
".",
"join",
"(",
"[",
"name_as_arg",
"(",
"arg",
")",
",",
"default_name",
"]",
")",
")",
"defaults_seen",
"+=",
"1",
"if",
"arg",
"in",
"processors",
":",
"procname",
"=",
"mangle",
"(",
"'_processor_'",
"+",
"arg",
")",
"exec_globals",
"[",
"procname",
"]",
"=",
"processors",
"[",
"arg",
"]",
"assignments",
".",
"append",
"(",
"make_processor_assignment",
"(",
"arg",
",",
"procname",
")",
")",
"call_args",
".",
"append",
"(",
"name_as_arg",
"(",
"arg",
")",
")",
"exec_str",
"=",
"dedent",
"(",
"\"\"\"\\\n @wraps({wrapped_funcname})\n def {func_name}({signature}):\n {assignments}\n return {wrapped_funcname}({call_args})\n \"\"\"",
")",
".",
"format",
"(",
"func_name",
"=",
"func",
".",
"__name__",
",",
"signature",
"=",
"', '",
".",
"join",
"(",
"signature",
")",
",",
"assignments",
"=",
"'\\n '",
".",
"join",
"(",
"assignments",
")",
",",
"wrapped_funcname",
"=",
"mangled_funcname",
",",
"call_args",
"=",
"', '",
".",
"join",
"(",
"call_args",
")",
",",
")",
"compiled",
"=",
"compile",
"(",
"exec_str",
",",
"func",
".",
"__code__",
".",
"co_filename",
",",
"mode",
"=",
"'exec'",
",",
")",
"exec_locals",
"=",
"{",
"}",
"exec_",
"(",
"compiled",
",",
"exec_globals",
",",
"exec_locals",
")",
"new_func",
"=",
"exec_locals",
"[",
"func",
".",
"__name__",
"]",
"code",
"=",
"new_func",
".",
"__code__",
"args",
"=",
"{",
"attr",
":",
"getattr",
"(",
"code",
",",
"attr",
")",
"for",
"attr",
"in",
"dir",
"(",
"code",
")",
"if",
"attr",
".",
"startswith",
"(",
"'co_'",
")",
"}",
"# Copy the firstlineno out of the underlying function so that exceptions",
"# get raised with the correct traceback.",
"# This also makes dynamic source inspection (like IPython `??` operator)",
"# work as intended.",
"try",
":",
"# Try to get the pycode object from the underlying function.",
"original_code",
"=",
"func",
".",
"__code__",
"except",
"AttributeError",
":",
"try",
":",
"# The underlying callable was not a function, try to grab the",
"# `__func__.__code__` which exists on method objects.",
"original_code",
"=",
"func",
".",
"__func__",
".",
"__code__",
"except",
"AttributeError",
":",
"# The underlying callable does not have a `__code__`. There is",
"# nothing for us to correct.",
"return",
"new_func",
"args",
"[",
"'co_firstlineno'",
"]",
"=",
"original_code",
".",
"co_firstlineno",
"new_func",
".",
"__code__",
"=",
"CodeType",
"(",
"*",
"map",
"(",
"getitem",
"(",
"args",
")",
",",
"_code_argorder",
")",
")",
"return",
"new_func"
] |
Build a preprocessed function with the same signature as `func`.
Uses `exec` internally to build a function that actually has the same
signature as `func.
|
[
"Build",
"a",
"preprocessed",
"function",
"with",
"the",
"same",
"signature",
"as",
"func",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/utils/preprocess.py#L142-L247
|
train
|
Builds a preprocessed function that has the same signature as func.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW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dqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(9252 - 9141) + chr(50) + chr(0b110000) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110101) + chr(49), 12429 - 12421), ehT0Px3KOsy9(chr(537 - 489) + chr(0b1101111) + chr(2080 - 2029) + chr(0b110001) + chr(0b1 + 0o60), 49513 - 49505), ehT0Px3KOsy9(chr(1918 - 1870) + chr(8451 - 8340) + '\061' + chr(48) + chr(0b100 + 0o56), 0b1000), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1101111) + chr(0b11000 + 0o33) + chr(0b110110) + chr(2344 - 2291), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b11010 + 0o125) + '\063' + chr(52) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(48) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(1527 - 1478), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(1271 - 1217) + chr(0b101001 + 0o14), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(314 - 260) + chr(0b110110 + 0o1), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101 + 0o142) + '\067' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(3135 - 3024) + chr(49) + '\x30' + chr(1372 - 1322), 8), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b110101) + chr(0b100110 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b110110 + 0o71) + chr(0b110101) + chr(49), 8), ehT0Px3KOsy9('\x30' + chr(0b10 + 0o155) + chr(864 - 813) + chr(50) + chr(0b10101 + 0o36), 53932 - 53924), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1639 - 1589) + chr(50) + chr(51), 11023 - 11015), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101000 + 0o11) + chr(0b110011) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(924 - 871) + '\x35', 29190 - 29182), ehT0Px3KOsy9('\060' + chr(111) + chr(52) + '\x31', 20531 - 20523), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(111) + '\062' + '\065', 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + chr(0b11 + 0o56) + chr(904 - 855) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(1643 - 1595) + chr(0b1101111) + chr(1101 - 1050) + chr(0b110001) + '\x31', 8), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + chr(0b10100 + 0o36), 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(6995 - 6884) + chr(51) + chr(0b110100) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(1043 - 995), 54218 - 54210), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + '\063' + chr(0b100000 + 0o23), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + '\065' + '\x35', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\061' + '\x34' + chr(51), 39479 - 39471), ehT0Px3KOsy9('\060' + chr(2503 - 2392) + '\063' + '\x32' + '\x37', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b1011 + 0o53) + '\x35', 8), ehT0Px3KOsy9(chr(0b110000) + chr(11936 - 11825) + '\061' + chr(527 - 473) + '\x30', 18645 - 18637), ehT0Px3KOsy9(chr(1577 - 1529) + chr(6724 - 6613) + chr(49), 11934 - 11926), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1825 - 1776) + chr(0b110101) + chr(1257 - 1205), 19191 - 19183), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + chr(0b11100 + 0o27) + chr(0b110110) + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2260 - 2209) + chr(1781 - 1733) + chr(916 - 864), 0b1000), ehT0Px3KOsy9(chr(1002 - 954) + chr(0b1101111) + chr(49) + chr(50) + chr(0b10110 + 0o34), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(5597 - 5486) + chr(1676 - 1625) + chr(0b100010 + 0o24), 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + chr(0b110001) + chr(0b110011) + chr(1430 - 1378), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(243 - 132) + chr(0b101110 + 0o5) + chr(48) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(55) + '\x33', 51347 - 51339)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(518 - 407) + chr(53) + '\x30', 38547 - 38539)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xad'), chr(7272 - 7172) + chr(101) + '\x63' + chr(0b1101100 + 0o3) + '\x64' + '\x65')(chr(0b1110101) + chr(0b1010 + 0o152) + '\x66' + '\x2d' + chr(2390 - 2334)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def rRObbjgqoUgp(EzOtJ3kbK5x4, frZ1xA36HyF0, SiSSA3CbFx_l, XPnBcq4XF5Ur, jR6wPHvf0kU1):
_0sJJXBfiGr0 = {xafqLlk3kkUe(SXOLrMavuUCe(b'\xe5\\\xa7!\xaa\x8c$t\xd0'), '\x64' + chr(0b11110 + 0o107) + '\143' + '\157' + chr(3089 - 2989) + chr(362 - 261))(chr(0b1110101) + chr(4145 - 4029) + '\146' + chr(1290 - 1245) + '\x38'): EzOtJ3kbK5x4.Gbej4oZqKLA6}
def NKqGz5Qjtmxs(AIvJRzLdDfgF):
return xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2'), chr(100) + chr(0b1100101) + chr(0b1001011 + 0o30) + chr(0b1010100 + 0o33) + chr(100) + chr(0b1100101))(chr(117) + '\x74' + chr(102) + chr(581 - 536) + chr(56)) + xafqLlk3kkUe(dJSYj_sVqQsO(), xafqLlk3kkUe(SXOLrMavuUCe(b'\xebL\xb1'), chr(0b1100100) + '\x65' + chr(99) + '\x6f' + chr(0b1100100) + chr(101))(chr(0b100100 + 0o121) + chr(0b100000 + 0o124) + chr(5083 - 4981) + '\055' + chr(270 - 214))) + AIvJRzLdDfgF
_0sJJXBfiGr0[xafqLlk3kkUe(SXOLrMavuUCe(b'\xeeH\xa7%\x99\x87!F\xd3BQ!'), '\144' + '\145' + '\143' + chr(111) + chr(6084 - 5984) + '\145')('\x75' + '\x74' + chr(102) + '\055' + '\070')] = f4ehIbDiUd8x = NKqGz5Qjtmxs(EzOtJ3kbK5x4.Gbej4oZqKLA6)
def kgOQqk8jtmB3(LTE9MPUbqSos, nbdkgQfYSusl):
jJBnSHEgylNZ = xafqLlk3kkUe(SXOLrMavuUCe(b"\xf8H\xbb%\x88\xc2x9\xceGM-\x0cL\xa0\xe00\x9f\\=3\xafw\x8fkfAC\xf0\x8e\x11s\x0b\x8c\xe3~>'\xa3\xc9\xe4T\xe0"), chr(0b1011 + 0o131) + '\x65' + '\143' + chr(0b100001 + 0o116) + chr(3365 - 3265) + chr(0b1100101))('\165' + '\x74' + chr(102) + '\x2d' + chr(0b11101 + 0o33))
return xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5\x1d\xbb-\xbd\x83\x16*\xe5GZ('), '\144' + '\x65' + '\x63' + chr(0b1101111) + chr(9613 - 9513) + chr(0b1100101))('\x75' + '\x74' + '\146' + chr(0b10000 + 0o35) + chr(0b111000)))(arg=LTE9MPUbqSos, processor=nbdkgQfYSusl, func=f4ehIbDiUd8x)
BsUS1n_IuFLp = {f4ehIbDiUd8x: EzOtJ3kbK5x4, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf4[\xa82\x86'), chr(0b10001 + 0o123) + '\145' + chr(0b1100000 + 0o3) + '\x6f' + '\144' + chr(0b1010011 + 0o22))(chr(4789 - 4672) + chr(0b1110100) + chr(0b11111 + 0o107) + chr(0b101011 + 0o2) + chr(2666 - 2610)): cUOaMZfY2Ho1}
W6gHMUvj0Qsm = ehT0Px3KOsy9('\x30' + '\x6f' + '\x30', 62516 - 62508)
B9Ff5iHSFeN7 = xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2'), '\x64' + chr(101) + chr(99) + '\157' + '\x64' + chr(4640 - 4539))('\165' + chr(0b100011 + 0o121) + '\x66' + chr(0b101101) + chr(0b100001 + 0o27)) + dJSYj_sVqQsO().hex + xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc\x0c\xad'), '\x64' + '\145' + chr(0b1000111 + 0o34) + chr(11135 - 11024) + chr(100) + '\x65')(chr(0b1001101 + 0o50) + chr(11901 - 11785) + '\x66' + '\x2d' + chr(0b111000))
W65V97aJT0Tb = []
d83WwAUAnDhv = []
rUaT0KsxnFel = []
veU6_xmOBKNg = {XPnBcq4XF5Ur: xafqLlk3kkUe(SXOLrMavuUCe(b'\xa9'), chr(100) + '\x65' + '\x63' + '\x6f' + chr(5728 - 5628) + chr(0b1100101))(chr(117) + '\x74' + chr(102) + chr(0b101101) + chr(2662 - 2606)), jR6wPHvf0kU1: xafqLlk3kkUe(SXOLrMavuUCe(b'\xa9\x03'), chr(100) + '\x65' + chr(0b1000 + 0o133) + '\x6f' + '\x64' + chr(2117 - 2016))(chr(7237 - 7120) + '\164' + chr(0b1100110) + '\x2d' + chr(0b111000))}
def p5QIrNXkO4zO(LTE9MPUbqSos):
return xafqLlk3kkUe(veU6_xmOBKNg, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe4L\xbd'), chr(100) + '\x65' + '\x63' + chr(0b1101111) + chr(2146 - 2046) + chr(8295 - 8194))(chr(117) + chr(1367 - 1251) + '\146' + '\x2d' + '\x38'))(LTE9MPUbqSos, xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1011 + 0o144) + chr(100) + chr(0b1100101))(chr(3238 - 3121) + '\x74' + chr(4246 - 4144) + chr(0b101101) + '\x38')) + LTE9MPUbqSos
for (LTE9MPUbqSos, t1v7afVhe01t) in SiSSA3CbFx_l:
if t1v7afVhe01t is QSYPb_39gyZb:
xafqLlk3kkUe(W65V97aJT0Tb, xafqLlk3kkUe(SXOLrMavuUCe(b"\xe2Y\xb9'\x9b\x86"), chr(100) + chr(101) + '\143' + chr(0b10101 + 0o132) + '\144' + chr(0b0 + 0o145))(chr(0b101011 + 0o112) + '\164' + '\x66' + chr(2006 - 1961) + '\070'))(p5QIrNXkO4zO(LTE9MPUbqSos))
else:
lwdAwPGy1Grh = B9Ff5iHSFeN7 % W6gHMUvj0Qsm
BsUS1n_IuFLp[lwdAwPGy1Grh] = t1v7afVhe01t
xafqLlk3kkUe(W65V97aJT0Tb, xafqLlk3kkUe(SXOLrMavuUCe(b"\xe2Y\xb9'\x9b\x86"), '\144' + chr(0b1010010 + 0o23) + '\143' + '\x6f' + '\144' + '\145')('\165' + '\164' + '\146' + chr(0b10000 + 0o35) + '\x38'))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe'), '\144' + '\145' + chr(0b111100 + 0o47) + chr(0b1011 + 0o144) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(116) + chr(0b100110 + 0o100) + chr(0b1101 + 0o40) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdcF\x9e\x1a\x8f\x96\x13W\xdbFw\x04'), '\144' + '\x65' + chr(99) + chr(111) + '\x64' + chr(101))(chr(117) + chr(5348 - 5232) + chr(102) + chr(0b101101) + chr(56)))([p5QIrNXkO4zO(LTE9MPUbqSos), lwdAwPGy1Grh]))
W6gHMUvj0Qsm += ehT0Px3KOsy9(chr(48) + '\157' + '\061', 8)
if LTE9MPUbqSos in frZ1xA36HyF0:
nDALq3FCR9wN = NKqGz5Qjtmxs(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdcY\xbb-\x96\x876j\xdaE`'), '\x64' + chr(0b111110 + 0o47) + chr(5269 - 5170) + chr(7542 - 7431) + chr(100) + chr(101))('\x75' + chr(0b1110100) + chr(102) + chr(45) + chr(1004 - 948)) + LTE9MPUbqSos)
BsUS1n_IuFLp[nDALq3FCR9wN] = frZ1xA36HyF0[LTE9MPUbqSos]
xafqLlk3kkUe(rUaT0KsxnFel, xafqLlk3kkUe(SXOLrMavuUCe(b"\xe2Y\xb9'\x9b\x86"), chr(100) + chr(0b110111 + 0o56) + '\143' + chr(0b1101100 + 0o3) + chr(0b1 + 0o143) + chr(0b111110 + 0o47))(chr(117) + chr(0b1110100) + chr(102) + chr(45) + '\070'))(kgOQqk8jtmB3(LTE9MPUbqSos, nDALq3FCR9wN))
xafqLlk3kkUe(d83WwAUAnDhv, xafqLlk3kkUe(SXOLrMavuUCe(b"\xe2Y\xb9'\x9b\x86"), chr(100) + chr(0b100110 + 0o77) + chr(8030 - 7931) + chr(111) + '\x64' + chr(0b1001101 + 0o30))('\x75' + chr(0b1110100) + chr(0b1100110) + '\x2d' + '\070'))(p5QIrNXkO4zO(LTE9MPUbqSos))
e0lM1ejITT2b = ojh11Z5rxCFF(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3\t\xe9b\xd5\xc2e9\xf5@M#\x1fZ\xfb\xe8(\x9f@e8\xacf\xbenn\x03\x00\xb9\x94\x1dd\x11\xd8\xcer>|\xe2\x9b\xa3\t\xe9&\x90\x84eb\xd3BQ!0G\xb2\xfe:\x90\tn;\xa0e\x8fio\x18\x11\xb2\x88Y;f\xd1\xe4r>|\xe2\x9b\xa3\t\xe9b\xd5\x99$j\xc6^X,\x02L\xbd\xe7,\x90+5h\xe9"\xc1(;MC\xf7\xd5Ps\t\x85\xb1 p|\xb9\xcc\xf1H\xb92\x90\x86\x1a\x7f\xc0Y\\,\x0eD\xb6\xeew\x96Bt$\xa5]\x80z|\x1e\x1e\xfe\xffP!L\xd1\xe4r>|'), '\x64' + chr(0b1100101) + chr(0b11011 + 0o110) + chr(111) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b101000 + 0o114) + chr(0b11000 + 0o116) + chr(45) + chr(2672 - 2616))).V4roHaS3Ppej(func_name=EzOtJ3kbK5x4.Gbej4oZqKLA6, signature=xafqLlk3kkUe(SXOLrMavuUCe(b'\xaf\t'), chr(0b1001101 + 0o27) + chr(0b1100101) + chr(99) + chr(11454 - 11343) + '\x64' + chr(101))(chr(0b1110101) + chr(116) + chr(4074 - 3972) + chr(807 - 762) + chr(0b1100 + 0o54))._oWXztVNnqHF(W65V97aJT0Tb), assignments=xafqLlk3kkUe(SXOLrMavuUCe(b'\x89\t\xe9b\xd5'), '\x64' + chr(8205 - 8104) + chr(7624 - 7525) + chr(0b1101111) + chr(0b1010111 + 0o15) + '\x65')(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(56))._oWXztVNnqHF(rUaT0KsxnFel), wrapped_funcname=f4ehIbDiUd8x, call_args=xafqLlk3kkUe(SXOLrMavuUCe(b'\xaf\t'), chr(0b1001 + 0o133) + chr(1842 - 1741) + '\x63' + '\x6f' + '\144' + chr(101))(chr(0b1110101) + chr(5178 - 5062) + chr(102) + '\x2d' + chr(0b10010 + 0o46))._oWXztVNnqHF(d83WwAUAnDhv))
hzpCPNAc7zFi = reqGiMiVQ77y(e0lM1ejITT2b, EzOtJ3kbK5x4.__code__.co_filename, mode=xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6Q\xac!'), '\144' + chr(101) + chr(0b111010 + 0o51) + '\157' + '\x64' + chr(3255 - 3154))(chr(117) + '\x74' + '\146' + '\x2d' + chr(0b11000 + 0o40)))
oWhkuW3hY8Cg = {}
tqkSewQRJyQm(hzpCPNAc7zFi, BsUS1n_IuFLp, oWhkuW3hY8Cg)
OztBowTWvLMb = oWhkuW3hY8Cg[EzOtJ3kbK5x4.Gbej4oZqKLA6]
ZWRNGxZ3R69y = OztBowTWvLMb.Z4eKz4wFO8LD
kJDRfRhcZHjS = {uwnd9_euJYKT: xafqLlk3kkUe(ZWRNGxZ3R69y, uwnd9_euJYKT) for uwnd9_euJYKT in g1Uy6IV0tyJQ(ZWRNGxZ3R69y) if uwnd9_euJYKT.startswith(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0F\x96'), '\144' + chr(0b111110 + 0o47) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(0b1100101))('\165' + chr(11834 - 11718) + chr(0b1100110) + chr(1173 - 1128) + chr(0b111000)))}
try:
fjSmbXo8OsQJ = EzOtJ3kbK5x4.Z4eKz4wFO8LD
except sHOWSIAKtU58:
try:
fjSmbXo8OsQJ = EzOtJ3kbK5x4.__func__.Z4eKz4wFO8LD
except sHOWSIAKtU58:
return OztBowTWvLMb
kJDRfRhcZHjS[xafqLlk3kkUe(SXOLrMavuUCe(b"\xe0F\x96$\x9c\x906m\xd9^Q'\x01F"), chr(0b1100100) + chr(0b1011010 + 0o13) + chr(0b10101 + 0o116) + chr(0b1101101 + 0o2) + chr(0b1100100) + chr(101))(chr(117) + '\164' + '\146' + chr(0b0 + 0o55) + chr(0b11010 + 0o36))] = fjSmbXo8OsQJ.co_firstlineno
OztBowTWvLMb.Z4eKz4wFO8LD = ALscLiAWKo_U(*abA97kOQKaLo(NHSNSGvyreOf(kJDRfRhcZHjS), qjJoeHNpdMoD))
return OztBowTWvLMb
|
quantopian/zipline
|
zipline/data/benchmarks.py
|
get_benchmark_returns
|
def get_benchmark_returns(symbol):
"""
Get a Series of benchmark returns from IEX associated with `symbol`.
Default is `SPY`.
Parameters
----------
symbol : str
Benchmark symbol for which we're getting the returns.
The data is provided by IEX (https://iextrading.com/), and we can
get up to 5 years worth of data.
"""
r = requests.get(
'https://api.iextrading.com/1.0/stock/{}/chart/5y'.format(symbol)
)
data = r.json()
df = pd.DataFrame(data)
df.index = pd.DatetimeIndex(df['date'])
df = df['close']
return df.sort_index().tz_localize('UTC').pct_change(1).iloc[1:]
|
python
|
def get_benchmark_returns(symbol):
"""
Get a Series of benchmark returns from IEX associated with `symbol`.
Default is `SPY`.
Parameters
----------
symbol : str
Benchmark symbol for which we're getting the returns.
The data is provided by IEX (https://iextrading.com/), and we can
get up to 5 years worth of data.
"""
r = requests.get(
'https://api.iextrading.com/1.0/stock/{}/chart/5y'.format(symbol)
)
data = r.json()
df = pd.DataFrame(data)
df.index = pd.DatetimeIndex(df['date'])
df = df['close']
return df.sort_index().tz_localize('UTC').pct_change(1).iloc[1:]
|
[
"def",
"get_benchmark_returns",
"(",
"symbol",
")",
":",
"r",
"=",
"requests",
".",
"get",
"(",
"'https://api.iextrading.com/1.0/stock/{}/chart/5y'",
".",
"format",
"(",
"symbol",
")",
")",
"data",
"=",
"r",
".",
"json",
"(",
")",
"df",
"=",
"pd",
".",
"DataFrame",
"(",
"data",
")",
"df",
".",
"index",
"=",
"pd",
".",
"DatetimeIndex",
"(",
"df",
"[",
"'date'",
"]",
")",
"df",
"=",
"df",
"[",
"'close'",
"]",
"return",
"df",
".",
"sort_index",
"(",
")",
".",
"tz_localize",
"(",
"'UTC'",
")",
".",
"pct_change",
"(",
"1",
")",
".",
"iloc",
"[",
"1",
":",
"]"
] |
Get a Series of benchmark returns from IEX associated with `symbol`.
Default is `SPY`.
Parameters
----------
symbol : str
Benchmark symbol for which we're getting the returns.
The data is provided by IEX (https://iextrading.com/), and we can
get up to 5 years worth of data.
|
[
"Get",
"a",
"Series",
"of",
"benchmark",
"returns",
"from",
"IEX",
"associated",
"with",
"symbol",
".",
"Default",
"is",
"SPY",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/benchmarks.py#L19-L42
|
train
|
Get a Series of benchmark returns from IEX associated with symbol.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcP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z9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\157' + chr(0b110001) + chr(52) + chr(51), 50140 - 50132), ehT0Px3KOsy9(chr(1769 - 1721) + chr(111) + chr(2365 - 2311) + chr(1238 - 1190), 56834 - 56826), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10010 + 0o37) + chr(52) + chr(410 - 357), 34968 - 34960), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(959 - 909) + '\x34' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(2271 - 2223) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + chr(0b10011 + 0o40) + chr(0b110010) + chr(1363 - 1311), 57575 - 57567), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + '\x31' + chr(49), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + '\063' + chr(0b11001 + 0o32) + chr(469 - 419), 34613 - 34605), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + '\061' + chr(1133 - 1080) + chr(0b101001 + 0o7), ord("\x08")), ehT0Px3KOsy9('\060' + chr(10177 - 10066) + chr(0b10 + 0o57) + '\x32' + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + chr(1536 - 1425) + chr(0b110101 + 0o1) + chr(1085 - 1031), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + '\061' + chr(597 - 547), 51961 - 51953), ehT0Px3KOsy9('\060' + chr(111) + chr(276 - 227) + '\061', 0o10), ehT0Px3KOsy9('\x30' + chr(7025 - 6914) + chr(1098 - 1048) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(0b110010) + '\061', 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + chr(0b110010) + '\061' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(0b110110) + '\062', 0o10), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b1010 + 0o145) + chr(0b110010) + chr(50) + chr(656 - 606), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(322 - 272) + chr(0b1010 + 0o50) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101000 + 0o7) + chr(423 - 372) + chr(52) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(111) + chr(0b100000 + 0o21) + chr(0b100011 + 0o17) + '\x30', 0o10), ehT0Px3KOsy9('\060' + chr(7872 - 7761) + chr(0b110010) + '\x35' + chr(53), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2252 - 2202) + chr(1507 - 1457) + chr(0b1001 + 0o51), 8), ehT0Px3KOsy9('\060' + chr(1288 - 1177) + chr(0b101011 + 0o11) + '\x32', 29387 - 29379), ehT0Px3KOsy9('\x30' + '\157' + chr(1503 - 1454) + '\062' + '\062', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(0b110011) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x34' + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + '\x36' + chr(2225 - 2174), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1001100 + 0o43) + chr(0b110010) + chr(1877 - 1829) + '\060', 5544 - 5536), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + '\x32' + '\066', 8), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1101111) + '\063' + chr(0b110110) + '\064', 46398 - 46390), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(48) + '\061', 40745 - 40737), ehT0Px3KOsy9(chr(75 - 27) + '\x6f' + chr(408 - 358) + chr(49) + chr(0b11100 + 0o25), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101101 + 0o5) + chr(1276 - 1228) + chr(425 - 373), 0b1000), ehT0Px3KOsy9(chr(1614 - 1566) + '\x6f' + '\x32' + chr(52) + chr(0b100100 + 0o17), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111 + 0o0) + chr(0b110010) + chr(50) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + '\x33' + chr(0b11101 + 0o24) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(1518 - 1470) + chr(11877 - 11766) + chr(2124 - 2071) + '\060', 6496 - 6488), ehT0Px3KOsy9(chr(195 - 147) + chr(0b1101111) + '\x33' + '\x36' + chr(1611 - 1557), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(379 - 326) + chr(0b110000), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'M'), chr(2464 - 2364) + '\145' + chr(99) + '\x6f' + '\144' + chr(0b1100101))(chr(3914 - 3797) + '\164' + '\x66' + chr(0b10100 + 0o31) + chr(1538 - 1482)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def FCXBtRTiVSPe(Usr5ykvL2UZF):
JWG5qApaeJkp = Mx6ixpcPMQy3.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\x0bD\x11\xd1\xf1\xee\xa6\xf5\t!_\xa4`s\xa9\xff\x80\xf3\xf2\x8f>\xca\xbcA=\xf3\t>\x9d\xb0\xb9\x875\xe6\xe7\xc8\xbb\xb4U\xd9\x00X\x04\xd3\xf6\xfb\xbc\xa3'), chr(0b111010 + 0o52) + chr(0b1100101) + '\143' + chr(0b1000111 + 0o50) + '\x64' + '\145')('\x75' + '\164' + '\146' + chr(45) + chr(2032 - 1976)).V4roHaS3Ppej(Usr5ykvL2UZF))
ULnjp6D6efFH = JWG5qApaeJkp.json()
aVhM9WzaWXU5 = dubtF9GfzOdC.DataFrame(ULnjp6D6efFH)
aVhM9WzaWXU5.XdowRbJKZWL9 = dubtF9GfzOdC.DatetimeIndex(aVhM9WzaWXU5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x07Q\x11\xc4'), chr(1338 - 1238) + chr(0b101111 + 0o66) + chr(0b1100011) + chr(0b1010001 + 0o36) + chr(0b1100100) + chr(6044 - 5943))('\x75' + chr(0b1110100) + chr(3366 - 3264) + chr(0b100010 + 0o13) + '\x38')])
aVhM9WzaWXU5 = aVhM9WzaWXU5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x00\\\n\xd2\xe7'), chr(100) + chr(101) + chr(0b1001000 + 0o33) + chr(0b1101111) + chr(6091 - 5991) + '\x65')('\x75' + chr(0b1010110 + 0o36) + chr(4688 - 4586) + '\055' + chr(56))]
return xafqLlk3kkUe(aVhM9WzaWXU5.sort_index().tz_localize(xafqLlk3kkUe(SXOLrMavuUCe(b'6d&'), chr(0b1010111 + 0o15) + '\x65' + chr(0b10101 + 0o116) + chr(0b110010 + 0o75) + chr(0b1100100) + '\x65')('\x75' + chr(0b1110100) + chr(0b100 + 0o142) + chr(45) + chr(0b10 + 0o66))).pct_change(ehT0Px3KOsy9('\060' + '\157' + chr(0b11011 + 0o26), 0b1000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\t\tT\xd7\xcd\xb0\xc0\x92)\x12d\xc9'), '\144' + chr(0b1100101) + chr(8783 - 8684) + '\157' + '\144' + chr(0b1011111 + 0o6))('\x75' + chr(0b1110100) + '\146' + chr(616 - 571) + '\070'))[ehT0Px3KOsy9(chr(1536 - 1488) + chr(0b1101111) + chr(0b110001), 8):]
|
quantopian/zipline
|
zipline/pipeline/visualize.py
|
delimit
|
def delimit(delimiters, content):
"""
Surround `content` with the first and last characters of `delimiters`.
>>> delimit('[]', "foo") # doctest: +SKIP
'[foo]'
>>> delimit('""', "foo") # doctest: +SKIP
'"foo"'
"""
if len(delimiters) != 2:
raise ValueError(
"`delimiters` must be of length 2. Got %r" % delimiters
)
return ''.join([delimiters[0], content, delimiters[1]])
|
python
|
def delimit(delimiters, content):
"""
Surround `content` with the first and last characters of `delimiters`.
>>> delimit('[]', "foo") # doctest: +SKIP
'[foo]'
>>> delimit('""', "foo") # doctest: +SKIP
'"foo"'
"""
if len(delimiters) != 2:
raise ValueError(
"`delimiters` must be of length 2. Got %r" % delimiters
)
return ''.join([delimiters[0], content, delimiters[1]])
|
[
"def",
"delimit",
"(",
"delimiters",
",",
"content",
")",
":",
"if",
"len",
"(",
"delimiters",
")",
"!=",
"2",
":",
"raise",
"ValueError",
"(",
"\"`delimiters` must be of length 2. Got %r\"",
"%",
"delimiters",
")",
"return",
"''",
".",
"join",
"(",
"[",
"delimiters",
"[",
"0",
"]",
",",
"content",
",",
"delimiters",
"[",
"1",
"]",
"]",
")"
] |
Surround `content` with the first and last characters of `delimiters`.
>>> delimit('[]', "foo") # doctest: +SKIP
'[foo]'
>>> delimit('""', "foo") # doctest: +SKIP
'"foo"'
|
[
"Surround",
"content",
"with",
"the",
"first",
"and",
"last",
"characters",
"of",
"delimiters",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/visualize.py#L24-L37
|
train
|
Returns a new string with the first and last characters of delimiters.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,Y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_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(5576 - 5465) + '\x33' + chr(0b110010) + '\066', 16327 - 16319), ehT0Px3KOsy9(chr(380 - 332) + chr(0b1100100 + 0o13) + chr(0b110011) + chr(0b110111) + '\065', 1352 - 1344), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + '\x35' + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(51) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + '\064', 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(2862 - 2751) + chr(0b110010) + chr(0b110101) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101011 + 0o4) + chr(546 - 495) + chr(455 - 402) + chr(0b101100 + 0o10), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(2641 - 2586) + chr(52), 0o10), ehT0Px3KOsy9(chr(360 - 312) + '\x6f' + '\063' + chr(50) + '\066', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(55) + chr(2493 - 2443), 0b1000), ehT0Px3KOsy9('\060' + chr(3282 - 3171) + chr(0b110001) + chr(0b110110) + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(294 - 244) + '\060' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(2298 - 2247) + '\x30' + chr(49), 15816 - 15808), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(54) + chr(1377 - 1327), 0b1000), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + chr(48), 60474 - 60466), ehT0Px3KOsy9(chr(48) + chr(468 - 357) + chr(51) + chr(0b110011) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10111 + 0o33) + '\x37' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9054 - 8943) + chr(0b110001) + chr(420 - 369) + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + '\x32' + chr(51), 3976 - 3968), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + chr(0b110011) + chr(1618 - 1564) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(55) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1100000 + 0o17) + '\062' + '\066' + '\064', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100011 + 0o114) + '\063' + chr(2252 - 2198) + chr(50), 8), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + '\066' + '\x34', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(344 - 294) + '\x35' + chr(0b110111), 8), ehT0Px3KOsy9(chr(48) + chr(7096 - 6985) + '\063' + chr(0b110010) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b110100) + chr(1574 - 1520), ord("\x08")), ehT0Px3KOsy9(chr(1456 - 1408) + chr(0b10101 + 0o132) + chr(51) + '\066' + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + chr(0b110001) + '\064' + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\065' + '\x31', 16252 - 16244), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1101111) + chr(0b10101 + 0o42) + chr(0b101001 + 0o7), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(1416 - 1365) + chr(0b100001 + 0o26) + chr(0b10101 + 0o41), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(2204 - 2150) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4083 - 3972) + chr(49) + '\060' + chr(2852 - 2797), 0o10), ehT0Px3KOsy9('\060' + chr(2547 - 2436) + '\x33' + chr(0b1101 + 0o52), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b100000 + 0o117) + chr(49) + chr(53) + chr(53), 0b1000), ehT0Px3KOsy9('\x30' + chr(10782 - 10671) + '\x33' + chr(330 - 279) + chr(708 - 660), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b11000 + 0o127) + '\062' + chr(0b101010 + 0o11), 0b1000), ehT0Px3KOsy9(chr(1637 - 1589) + '\x6f' + chr(51) + chr(0b110000) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(191 - 143) + '\x6f' + chr(0b101010 + 0o10) + chr(0b11100 + 0o24) + chr(0b110101), 26674 - 26666)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + chr(2250 - 2197) + '\060', 9458 - 9450)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8'), chr(6525 - 6425) + chr(0b1100101) + chr(99) + '\157' + chr(0b1100100) + chr(101))(chr(0b1110101) + '\164' + chr(0b1100110) + chr(0b101101) + chr(0b11010 + 0o36)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def INbWkjZMQIfM(ToU2dlUSkLsP, VjgGQlDzfDa9):
if c2A0yzQpDQB3(ToU2dlUSkLsP) != ehT0Px3KOsy9(chr(1258 - 1210) + '\157' + chr(50), ord("\x08")):
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6\x99\xc9\xb3}\xc2\x85H\xb3\x08\x01\xe7\xe1_u\xa8\xcc\x7f\xb1\x97\xdf\xdb\x94T\xc3\xb2\x08\x93\x17A\x18\xcc\xdegX\x02\xac3\xe2\xf7'), '\x64' + '\145' + chr(0b1100011) + '\x6f' + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(8609 - 8493) + '\x66' + chr(0b101 + 0o50) + chr(0b100001 + 0o27)) % ToU2dlUSkLsP)
return xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b111011 + 0o51) + '\x65' + chr(0b110 + 0o135) + chr(2530 - 2419) + chr(100) + chr(101))('\x75' + chr(4907 - 4791) + '\x66' + '\055' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x89\x92\xfb\x87n\xdb\xbar\xb8\x0b:\xc1'), '\x64' + chr(0b101111 + 0o66) + chr(0b1100011) + '\x6f' + '\144' + chr(101))('\165' + '\x74' + '\146' + chr(1179 - 1134) + chr(56)))([ToU2dlUSkLsP[ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(8697 - 8586) + '\060', 8)], VjgGQlDzfDa9, ToU2dlUSkLsP[ehT0Px3KOsy9('\x30' + '\x6f' + '\061', 0b1000)]])
|
quantopian/zipline
|
zipline/pipeline/visualize.py
|
roots
|
def roots(g):
"Get nodes from graph G with indegree 0"
return set(n for n, d in iteritems(g.in_degree()) if d == 0)
|
python
|
def roots(g):
"Get nodes from graph G with indegree 0"
return set(n for n, d in iteritems(g.in_degree()) if d == 0)
|
[
"def",
"roots",
"(",
"g",
")",
":",
"return",
"set",
"(",
"n",
"for",
"n",
",",
"d",
"in",
"iteritems",
"(",
"g",
".",
"in_degree",
"(",
")",
")",
"if",
"d",
"==",
"0",
")"
] |
Get nodes from graph G with indegree 0
|
[
"Get",
"nodes",
"from",
"graph",
"G",
"with",
"indegree",
"0"
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/visualize.py#L73-L75
|
train
|
Get nodes from graph G with indegree 0
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bd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PkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + '\060' + chr(2318 - 2266), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9180 - 9069) + chr(2446 - 2393) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10111 + 0o34) + chr(0b110110) + chr(0b10010 + 0o41), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10001 + 0o42) + chr(0b110000) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(2849 - 2738) + chr(0b110011) + '\064' + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(0b100011 + 0o114) + chr(0b110011) + chr(0b110111) + chr(147 - 98), ord("\x08")), ehT0Px3KOsy9(chr(336 - 288) + chr(0b1101111) + '\062' + '\x34', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + '\063' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b110010) + chr(1912 - 1864), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b11110 + 0o23) + chr(52) + chr(0b100100 + 0o20), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(1702 - 1650) + chr(55), 5201 - 5193), ehT0Px3KOsy9('\060' + chr(9843 - 9732) + '\x32' + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b110101) + chr(53), 44001 - 43993), ehT0Px3KOsy9(chr(1681 - 1633) + '\x6f' + chr(2181 - 2131) + chr(0b110101) + '\066', 0o10), ehT0Px3KOsy9(chr(2027 - 1979) + '\157' + chr(53) + chr(2802 - 2747), 55731 - 55723), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\157' + '\061' + chr(0b110111) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(9649 - 9538) + '\x32' + chr(0b101001 + 0o10) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b101110 + 0o11) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101111) + chr(0b1111 + 0o43) + '\x35', 25531 - 25523), ehT0Px3KOsy9(chr(0b110000) + chr(4344 - 4233) + chr(49) + chr(51) + chr(1718 - 1664), 59811 - 59803), ehT0Px3KOsy9(chr(1348 - 1300) + chr(111) + chr(1212 - 1162) + chr(0b100111 + 0o20) + chr(50), 33214 - 33206), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11 + 0o57) + chr(2022 - 1973) + chr(1211 - 1161), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11 + 0o57) + chr(0b110101), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(54) + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b110110 + 0o71) + chr(0b110001) + '\062' + chr(49), 50430 - 50422), ehT0Px3KOsy9(chr(1896 - 1848) + '\x6f' + '\x32' + chr(49) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101111) + chr(0b101011 + 0o10) + chr(48) + chr(0b100011 + 0o15), 8), ehT0Px3KOsy9(chr(1478 - 1430) + chr(0b1010000 + 0o37) + chr(0b101010 + 0o10) + '\x30' + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101101 + 0o2) + '\x33' + '\061' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x34' + chr(768 - 720), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000101 + 0o52) + '\063' + chr(326 - 273), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4101 - 3990) + chr(0b11110 + 0o24) + chr(489 - 441), 20789 - 20781), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b1100011 + 0o14) + chr(1420 - 1370) + '\x30' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(0b11111 + 0o23) + chr(1430 - 1379), 13602 - 13594), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(7011 - 6900) + chr(0b110010) + chr(0b10010 + 0o41) + '\x30', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(647 - 596), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(53) + chr(0b101010 + 0o7), 0b1000), ehT0Px3KOsy9(chr(437 - 389) + chr(0b101000 + 0o107) + chr(2173 - 2121) + '\x34', 38009 - 38001), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10000 + 0o44) + '\x35', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + chr(53) + chr(1469 - 1421), 54554 - 54546)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'j'), chr(100) + chr(0b1 + 0o144) + chr(2346 - 2247) + '\x6f' + chr(0b1100100) + chr(3998 - 3897))(chr(0b1110101) + chr(116) + '\x66' + chr(1468 - 1423) + chr(2360 - 2304)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def gq6urYXi3N2I(RWHpzFEeviFP):
return MVEN8G6CxlvR((m1NkCryOw9Bx for (m1NkCryOw9Bx, pd3lxn9vqWxp) in WYXqUHkBa2Bx(xafqLlk3kkUe(RWHpzFEeviFP, xafqLlk3kkUe(SXOLrMavuUCe(b'-E\xac\xa4\x83\x9ef?\xb5'), chr(0b1100100) + chr(4440 - 4339) + '\x63' + '\157' + chr(100) + chr(101))('\165' + chr(0b1110100) + '\x66' + chr(0b1101 + 0o40) + '\x38'))()) if pd3lxn9vqWxp == ehT0Px3KOsy9('\x30' + chr(6371 - 6260) + chr(2261 - 2213), ord("\x08"))))
|
quantopian/zipline
|
zipline/pipeline/visualize.py
|
_render
|
def _render(g, out, format_, include_asset_exists=False):
"""
Draw `g` as a graph to `out`, in format `format`.
Parameters
----------
g : zipline.pipeline.graph.TermGraph
Graph to render.
out : file-like object
format_ : str {'png', 'svg'}
Output format.
include_asset_exists : bool
Whether to filter out `AssetExists()` nodes.
"""
graph_attrs = {'rankdir': 'TB', 'splines': 'ortho'}
cluster_attrs = {'style': 'filled', 'color': 'lightgoldenrod1'}
in_nodes = g.loadable_terms
out_nodes = list(g.outputs.values())
f = BytesIO()
with graph(f, "G", **graph_attrs):
# Write outputs cluster.
with cluster(f, 'Output', labelloc='b', **cluster_attrs):
for term in filter_nodes(include_asset_exists, out_nodes):
add_term_node(f, term)
# Write inputs cluster.
with cluster(f, 'Input', **cluster_attrs):
for term in filter_nodes(include_asset_exists, in_nodes):
add_term_node(f, term)
# Write intermediate results.
for term in filter_nodes(include_asset_exists,
topological_sort(g.graph)):
if term in in_nodes or term in out_nodes:
continue
add_term_node(f, term)
# Write edges
for source, dest in g.graph.edges():
if source is AssetExists() and not include_asset_exists:
continue
add_edge(f, id(source), id(dest))
cmd = ['dot', '-T', format_]
try:
proc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
except OSError as e:
if e.errno == errno.ENOENT:
raise RuntimeError(
"Couldn't find `dot` graph layout program. "
"Make sure Graphviz is installed and `dot` is on your path."
)
else:
raise
f.seek(0)
proc_stdout, proc_stderr = proc.communicate(f.read())
if proc_stderr:
raise RuntimeError(
"Error(s) while rendering graph: %s" % proc_stderr.decode('utf-8')
)
out.write(proc_stdout)
|
python
|
def _render(g, out, format_, include_asset_exists=False):
"""
Draw `g` as a graph to `out`, in format `format`.
Parameters
----------
g : zipline.pipeline.graph.TermGraph
Graph to render.
out : file-like object
format_ : str {'png', 'svg'}
Output format.
include_asset_exists : bool
Whether to filter out `AssetExists()` nodes.
"""
graph_attrs = {'rankdir': 'TB', 'splines': 'ortho'}
cluster_attrs = {'style': 'filled', 'color': 'lightgoldenrod1'}
in_nodes = g.loadable_terms
out_nodes = list(g.outputs.values())
f = BytesIO()
with graph(f, "G", **graph_attrs):
# Write outputs cluster.
with cluster(f, 'Output', labelloc='b', **cluster_attrs):
for term in filter_nodes(include_asset_exists, out_nodes):
add_term_node(f, term)
# Write inputs cluster.
with cluster(f, 'Input', **cluster_attrs):
for term in filter_nodes(include_asset_exists, in_nodes):
add_term_node(f, term)
# Write intermediate results.
for term in filter_nodes(include_asset_exists,
topological_sort(g.graph)):
if term in in_nodes or term in out_nodes:
continue
add_term_node(f, term)
# Write edges
for source, dest in g.graph.edges():
if source is AssetExists() and not include_asset_exists:
continue
add_edge(f, id(source), id(dest))
cmd = ['dot', '-T', format_]
try:
proc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
except OSError as e:
if e.errno == errno.ENOENT:
raise RuntimeError(
"Couldn't find `dot` graph layout program. "
"Make sure Graphviz is installed and `dot` is on your path."
)
else:
raise
f.seek(0)
proc_stdout, proc_stderr = proc.communicate(f.read())
if proc_stderr:
raise RuntimeError(
"Error(s) while rendering graph: %s" % proc_stderr.decode('utf-8')
)
out.write(proc_stdout)
|
[
"def",
"_render",
"(",
"g",
",",
"out",
",",
"format_",
",",
"include_asset_exists",
"=",
"False",
")",
":",
"graph_attrs",
"=",
"{",
"'rankdir'",
":",
"'TB'",
",",
"'splines'",
":",
"'ortho'",
"}",
"cluster_attrs",
"=",
"{",
"'style'",
":",
"'filled'",
",",
"'color'",
":",
"'lightgoldenrod1'",
"}",
"in_nodes",
"=",
"g",
".",
"loadable_terms",
"out_nodes",
"=",
"list",
"(",
"g",
".",
"outputs",
".",
"values",
"(",
")",
")",
"f",
"=",
"BytesIO",
"(",
")",
"with",
"graph",
"(",
"f",
",",
"\"G\"",
",",
"*",
"*",
"graph_attrs",
")",
":",
"# Write outputs cluster.",
"with",
"cluster",
"(",
"f",
",",
"'Output'",
",",
"labelloc",
"=",
"'b'",
",",
"*",
"*",
"cluster_attrs",
")",
":",
"for",
"term",
"in",
"filter_nodes",
"(",
"include_asset_exists",
",",
"out_nodes",
")",
":",
"add_term_node",
"(",
"f",
",",
"term",
")",
"# Write inputs cluster.",
"with",
"cluster",
"(",
"f",
",",
"'Input'",
",",
"*",
"*",
"cluster_attrs",
")",
":",
"for",
"term",
"in",
"filter_nodes",
"(",
"include_asset_exists",
",",
"in_nodes",
")",
":",
"add_term_node",
"(",
"f",
",",
"term",
")",
"# Write intermediate results.",
"for",
"term",
"in",
"filter_nodes",
"(",
"include_asset_exists",
",",
"topological_sort",
"(",
"g",
".",
"graph",
")",
")",
":",
"if",
"term",
"in",
"in_nodes",
"or",
"term",
"in",
"out_nodes",
":",
"continue",
"add_term_node",
"(",
"f",
",",
"term",
")",
"# Write edges",
"for",
"source",
",",
"dest",
"in",
"g",
".",
"graph",
".",
"edges",
"(",
")",
":",
"if",
"source",
"is",
"AssetExists",
"(",
")",
"and",
"not",
"include_asset_exists",
":",
"continue",
"add_edge",
"(",
"f",
",",
"id",
"(",
"source",
")",
",",
"id",
"(",
"dest",
")",
")",
"cmd",
"=",
"[",
"'dot'",
",",
"'-T'",
",",
"format_",
"]",
"try",
":",
"proc",
"=",
"Popen",
"(",
"cmd",
",",
"stdin",
"=",
"PIPE",
",",
"stdout",
"=",
"PIPE",
",",
"stderr",
"=",
"PIPE",
")",
"except",
"OSError",
"as",
"e",
":",
"if",
"e",
".",
"errno",
"==",
"errno",
".",
"ENOENT",
":",
"raise",
"RuntimeError",
"(",
"\"Couldn't find `dot` graph layout program. \"",
"\"Make sure Graphviz is installed and `dot` is on your path.\"",
")",
"else",
":",
"raise",
"f",
".",
"seek",
"(",
"0",
")",
"proc_stdout",
",",
"proc_stderr",
"=",
"proc",
".",
"communicate",
"(",
"f",
".",
"read",
"(",
")",
")",
"if",
"proc_stderr",
":",
"raise",
"RuntimeError",
"(",
"\"Error(s) while rendering graph: %s\"",
"%",
"proc_stderr",
".",
"decode",
"(",
"'utf-8'",
")",
")",
"out",
".",
"write",
"(",
"proc_stdout",
")"
] |
Draw `g` as a graph to `out`, in format `format`.
Parameters
----------
g : zipline.pipeline.graph.TermGraph
Graph to render.
out : file-like object
format_ : str {'png', 'svg'}
Output format.
include_asset_exists : bool
Whether to filter out `AssetExists()` nodes.
|
[
"Draw",
"g",
"as",
"a",
"graph",
"to",
"out",
"in",
"format",
"format",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/visualize.py#L84-L149
|
train
|
Draw g as a graph to out in format format.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7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W,iDQ_gSK8V7h0,Rurm1zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11111 + 0o24) + chr(452 - 397) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1001101 + 0o42) + chr(1606 - 1551) + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1001 + 0o51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(0b110100) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + '\067' + '\066', 8), ehT0Px3KOsy9(chr(1009 - 961) + chr(0b1101111) + chr(51) + chr(0b10 + 0o57) + chr(2342 - 2293), ord("\x08")), ehT0Px3KOsy9(chr(862 - 814) + '\157' + chr(50) + chr(49) + chr(0b100001 + 0o17), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(49) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(2112 - 2001) + '\063' + chr(0b110011) + chr(949 - 901), 20204 - 20196), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2033 - 1982) + chr(1952 - 1904) + chr(0b101011 + 0o7), 0o10), ehT0Px3KOsy9(chr(1153 - 1105) + chr(0b110100 + 0o73) + chr(0b11001 + 0o32) + chr(1229 - 1177) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2463 - 2412) + '\x31' + chr(0b110100), 29339 - 29331), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(0b110111) + chr(0b100100 + 0o17), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9460 - 9349) + chr(0b1011 + 0o46) + chr(797 - 748) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + chr(50) + chr(0b11111 + 0o21) + chr(1527 - 1474), 8063 - 8055), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1365 - 1316) + chr(1064 - 1011) + chr(0b110011 + 0o2), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1000000 + 0o57) + chr(49) + '\065' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(2296 - 2248) + chr(111) + chr(0b110010) + '\063' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b111100 + 0o63) + chr(0b100101 + 0o14) + '\060' + chr(0b10001 + 0o43), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(0b110011 + 0o2) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100010 + 0o21) + '\065' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + chr(0b1 + 0o61) + '\x33' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(1655 - 1607) + '\x6f' + chr(2434 - 2384) + '\x30' + '\x35', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110101) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + '\x32' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1000111 + 0o50) + chr(0b110001 + 0o0) + '\065' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(856 - 808) + chr(7778 - 7667) + chr(0b110010) + chr(0b101 + 0o57) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(1531 - 1480) + '\063' + '\x35', 8396 - 8388), ehT0Px3KOsy9('\x30' + chr(3647 - 3536) + chr(757 - 703) + chr(0b10 + 0o62), ord("\x08")), ehT0Px3KOsy9(chr(865 - 817) + '\x6f' + chr(887 - 837) + chr(48) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b111100 + 0o63) + chr(2420 - 2369) + chr(0b110000 + 0o0) + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000010 + 0o55) + chr(1195 - 1142) + chr(0b110000 + 0o6), 29018 - 29010), ehT0Px3KOsy9(chr(288 - 240) + chr(0b1101111) + chr(0b10101 + 0o35) + chr(0b11111 + 0o23) + chr(0b11110 + 0o26), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + '\x32' + '\067', 13893 - 13885), ehT0Px3KOsy9('\060' + chr(0b11110 + 0o121) + chr(1719 - 1668) + '\064' + chr(1100 - 1052), 32539 - 32531), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b111 + 0o52) + chr(0b11101 + 0o27) + chr(0b10010 + 0o45), 0b1000), ehT0Px3KOsy9('\x30' + chr(11671 - 11560) + chr(269 - 216) + chr(0b1010 + 0o54), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b110101 + 0o72) + chr(0b100011 + 0o20) + chr(574 - 521), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(54) + '\061', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2207 - 2154) + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd0'), '\144' + chr(101) + chr(0b1100011) + '\157' + '\144' + chr(101))(chr(0b0 + 0o165) + '\164' + '\x66' + chr(0b101101) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Iu6Y2lPjGdmH(RWHpzFEeviFP, UkrMp_I0RDmo, OyP3qLoaNfwE, Di5EqVGeQEQg=ehT0Px3KOsy9(chr(48) + chr(2844 - 2733) + chr(0b100000 + 0o20), 57653 - 57645)):
k7U2s5WQKIpr = {xafqLlk3kkUe(SXOLrMavuUCe(b'\x8cZl\n\x9a\xa0\xfa'), chr(6295 - 6195) + chr(101) + chr(0b1100011) + chr(0b1011100 + 0o23) + chr(0b1100100) + chr(0b10101 + 0o120))(chr(0b10111 + 0o136) + chr(10076 - 9960) + '\146' + chr(45) + chr(1162 - 1106)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xaay'), '\144' + chr(101) + chr(8415 - 8316) + chr(4297 - 4186) + chr(0b1100100) + chr(6278 - 6177))('\x75' + chr(0b1110100) + chr(102) + '\x2d' + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x8dKn\x08\x90\xac\xfb'), '\144' + chr(0b101 + 0o140) + chr(99) + chr(0b111001 + 0o66) + '\x64' + chr(9308 - 9207))(chr(0b110 + 0o157) + '\x74' + chr(102) + chr(45) + chr(812 - 756)): xafqLlk3kkUe(SXOLrMavuUCe(b'\x91Iv\t\x91'), chr(100) + chr(0b1000111 + 0o36) + chr(0b1110 + 0o125) + chr(111) + chr(0b111110 + 0o46) + '\x65')(chr(0b1101000 + 0o15) + chr(116) + '\146' + chr(1786 - 1741) + chr(0b101010 + 0o16))}
tIpdMNePiRlz = {xafqLlk3kkUe(SXOLrMavuUCe(b'\x8dO{\r\x9b'), '\144' + chr(0b11001 + 0o114) + '\143' + chr(111) + chr(0b100011 + 0o101) + chr(8647 - 8546))('\165' + chr(116) + chr(0b1100110) + chr(0b101101) + chr(739 - 683)): xafqLlk3kkUe(SXOLrMavuUCe(b'\x98Rn\r\x9b\xad'), chr(0b1001001 + 0o33) + '\x65' + '\x63' + chr(111) + chr(100) + '\145')(chr(0b1110101) + '\x74' + '\x66' + chr(45) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x9dTn\x0e\x8c'), chr(0b111111 + 0o45) + '\x65' + '\x63' + chr(0b101101 + 0o102) + chr(7990 - 7890) + chr(101))(chr(117) + chr(0b1010110 + 0o36) + chr(0b1011111 + 0o7) + '\055' + chr(0b111000)): xafqLlk3kkUe(SXOLrMavuUCe(b'\x92Re\t\x8a\xae\xe7\xa2\xbc\xa7\x89\xbe\x94)\xb4'), '\x64' + chr(8167 - 8066) + chr(0b1100011) + chr(111) + chr(100) + '\x65')(chr(1562 - 1445) + chr(0b110111 + 0o75) + '\x66' + '\x2d' + '\070')}
PnK_xjn9um6m = RWHpzFEeviFP.loadable_terms
iSMY4ox6JgZM = YyaZ4tpXu4lf(RWHpzFEeviFP.outputs.SPnCNu54H1db())
EGyt1xfPT1P6 = f9L_Rzl5SCCf()
with H9yw8tZKkKME(EGyt1xfPT1P6, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9'), chr(100) + '\x65' + chr(0b1100011) + chr(0b10110 + 0o131) + chr(100) + chr(101))(chr(117) + chr(0b1110100) + chr(5741 - 5639) + chr(1494 - 1449) + chr(0b10100 + 0o44)), **k7U2s5WQKIpr):
with MM44MZHrD3Bf(EGyt1xfPT1P6, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1Nv\x11\x8b\xbd'), chr(8350 - 8250) + chr(0b1010110 + 0o17) + '\143' + '\x6f' + chr(0b1100100) + chr(101))(chr(0b100100 + 0o121) + chr(0b1010001 + 0o43) + chr(0b1100110) + '\x2d' + chr(845 - 789)), labelloc=xafqLlk3kkUe(SXOLrMavuUCe(b'\x9c'), '\144' + chr(0b1100101) + chr(0b101000 + 0o73) + chr(0b11100 + 0o123) + '\x64' + chr(0b111111 + 0o46))('\x75' + chr(9061 - 8945) + '\146' + chr(0b101101) + '\x38'), **tIpdMNePiRlz):
for BnuOe7t2jDZ6 in Btpusb5HOoPL(Di5EqVGeQEQg, iSMY4ox6JgZM):
M1PkY4wsoJY7(EGyt1xfPT1P6, BnuOe7t2jDZ6)
with MM44MZHrD3Bf(EGyt1xfPT1P6, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7Ur\x14\x8a'), '\144' + chr(495 - 394) + chr(0b110 + 0o135) + chr(0b1101111) + '\144' + chr(4740 - 4639))(chr(3028 - 2911) + '\x74' + chr(9878 - 9776) + '\x2d' + '\070'), **tIpdMNePiRlz):
for BnuOe7t2jDZ6 in Btpusb5HOoPL(Di5EqVGeQEQg, PnK_xjn9um6m):
M1PkY4wsoJY7(EGyt1xfPT1P6, BnuOe7t2jDZ6)
for BnuOe7t2jDZ6 in Btpusb5HOoPL(Di5EqVGeQEQg, QBjvHpl3I3P4(xafqLlk3kkUe(RWHpzFEeviFP, xafqLlk3kkUe(SXOLrMavuUCe(b'\x99Ic\x11\x96'), chr(0b1100100) + chr(2747 - 2646) + '\143' + '\157' + chr(1922 - 1822) + chr(434 - 333))('\165' + chr(116) + chr(0b1101 + 0o131) + chr(45) + chr(56))))):
if BnuOe7t2jDZ6 in PnK_xjn9um6m or BnuOe7t2jDZ6 in iSMY4ox6JgZM:
continue
M1PkY4wsoJY7(EGyt1xfPT1P6, BnuOe7t2jDZ6)
for (Qas9W3D0Xbzi, r6aMMPMZwN9t) in xafqLlk3kkUe(RWHpzFEeviFP.graph, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b_e\x04\x8d'), chr(0b1100100) + chr(1239 - 1138) + chr(0b1011101 + 0o6) + chr(111) + chr(6439 - 6339) + chr(101))('\165' + chr(116) + chr(0b1010110 + 0o20) + chr(0b101101) + chr(0b111000)))():
if Qas9W3D0Xbzi is Y37WEre6txuQ() and (not Di5EqVGeQEQg):
continue
UhjpM9yGdv3H(EGyt1xfPT1P6, z8EhBlYI2Bx4(Qas9W3D0Xbzi), z8EhBlYI2Bx4(r6aMMPMZwN9t))
cTsjNbtiBYNK = [xafqLlk3kkUe(SXOLrMavuUCe(b'\x9aTv'), chr(0b1100100) + chr(0b111010 + 0o53) + '\143' + chr(0b1101111) + chr(7651 - 7551) + chr(1270 - 1169))('\165' + chr(116) + chr(0b101110 + 0o70) + chr(0b101101) + chr(2815 - 2759)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3o'), '\x64' + '\x65' + chr(0b1010011 + 0o20) + '\157' + '\144' + chr(2672 - 2571))(chr(0b11110 + 0o127) + chr(0b1110100) + chr(0b1 + 0o145) + '\055' + '\070'), OyP3qLoaNfwE]
try:
qWgorv6lsPwr = AwT96CkVCSSy(cTsjNbtiBYNK, stdin=LbMp3lPepCj3, stdout=LbMp3lPepCj3, stderr=LbMp3lPepCj3)
except KlPSljPzIJ_u as GlnVAPeT6CUe:
if xafqLlk3kkUe(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'\x92pxT\xa8\xa1\xe6\xad\x95\xa8\xa0\xa9'), chr(2517 - 2417) + chr(0b1000111 + 0o36) + chr(99) + chr(111) + '\144' + chr(101))(chr(0b1100101 + 0o20) + chr(11577 - 11461) + '\x66' + chr(0b101101) + '\070')) == xafqLlk3kkUe(lKz5VhncMjGe, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbbuM$\xb0\x9d'), chr(100) + '\145' + chr(0b1100011) + chr(111) + chr(0b100000 + 0o104) + chr(101))(chr(3906 - 3789) + chr(859 - 743) + '\x66' + chr(45) + chr(2497 - 2441))):
raise n0ZkatoveZpF(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbdTw\r\x9a\xa7\xaf\xba\xf8\xa4\x8e\xa2\x9fm\xe5\t\x00\xec$He\x9b\xff\xf5E\xb4\x06\xc2\xa4[\xf7\xb1\x0e\xe4\xa5\x8f\x00\\|\xdc\xd0\x1bO\x00\x95\xac\xa8\xbd\xad\xb0\x82\xec\xbc?\xe4\x1d\x07\xee-\x12"\x80\xed\xa5D\xfa\x19\xd7\xbcX\xee\xa0J\xb4\xb6\x8e\x03\x0e}\xd5\x91ObA\x97\xba\xa8\xa1\xb6\xe2\x9e\xa3\x8e?\xa5\x1d\x0e\xec,F'), chr(0b1100100) + '\x65' + '\x63' + '\157' + chr(6494 - 6394) + chr(101))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(1219 - 1174) + '\070'))
else:
raise
xafqLlk3kkUe(EGyt1xfPT1P6, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8d^g\n'), '\x64' + chr(0b1100101) + '\x63' + chr(0b1 + 0o156) + chr(0b1100100) + chr(5720 - 5619))('\x75' + chr(0b1011111 + 0o25) + chr(0b1100110) + '\055' + chr(0b110001 + 0o7)))(ehT0Px3KOsy9(chr(48) + '\157' + chr(0b111 + 0o51), 8))
(XWMCwdla0KKU, EXTp9w34BUU9) = qWgorv6lsPwr.communicate(EGyt1xfPT1P6.U6MiWrhuCi2Y())
if EXTp9w34BUU9:
raise n0ZkatoveZpF(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbbIp\x0e\x8c\xe1\xfb\xe7\xf8\xb5\x8f\xa5\x97(\xa5\x1f\n\xf6 \rp\x80\xf0\xe2\r\xf3\x18\xc2\xad\\\xb8\xe5\x0b\xe7'), chr(0b100010 + 0o102) + chr(0b1100101) + chr(0b1100011) + chr(0b10000 + 0o137) + chr(0b1100100) + chr(0b1100101))('\x75' + '\164' + '\x66' + '\x2d' + chr(56)) % xafqLlk3kkUe(EXTp9w34BUU9, chr(0b1100100) + chr(101) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8bOdL\xc6'), '\x64' + chr(0b1100101) + '\143' + '\x6f' + '\144' + chr(0b1100101))(chr(0b1110101) + chr(116) + '\146' + chr(45) + '\070')))
xafqLlk3kkUe(UkrMp_I0RDmo, xafqLlk3kkUe(SXOLrMavuUCe(b'\x89Ik\x15\x9b'), chr(0b1000 + 0o134) + chr(101) + chr(99) + chr(111) + chr(0b110101 + 0o57) + chr(0b1100101))('\165' + '\x74' + '\146' + chr(45) + chr(1177 - 1121)))(XWMCwdla0KKU)
|
quantopian/zipline
|
zipline/pipeline/visualize.py
|
display_graph
|
def display_graph(g, format='svg', include_asset_exists=False):
"""
Display a TermGraph interactively from within IPython.
"""
try:
import IPython.display as display
except ImportError:
raise NoIPython("IPython is not installed. Can't display graph.")
if format == 'svg':
display_cls = display.SVG
elif format in ("jpeg", "png"):
display_cls = partial(display.Image, format=format, embed=True)
out = BytesIO()
_render(g, out, format, include_asset_exists=include_asset_exists)
return display_cls(data=out.getvalue())
|
python
|
def display_graph(g, format='svg', include_asset_exists=False):
"""
Display a TermGraph interactively from within IPython.
"""
try:
import IPython.display as display
except ImportError:
raise NoIPython("IPython is not installed. Can't display graph.")
if format == 'svg':
display_cls = display.SVG
elif format in ("jpeg", "png"):
display_cls = partial(display.Image, format=format, embed=True)
out = BytesIO()
_render(g, out, format, include_asset_exists=include_asset_exists)
return display_cls(data=out.getvalue())
|
[
"def",
"display_graph",
"(",
"g",
",",
"format",
"=",
"'svg'",
",",
"include_asset_exists",
"=",
"False",
")",
":",
"try",
":",
"import",
"IPython",
".",
"display",
"as",
"display",
"except",
"ImportError",
":",
"raise",
"NoIPython",
"(",
"\"IPython is not installed. Can't display graph.\"",
")",
"if",
"format",
"==",
"'svg'",
":",
"display_cls",
"=",
"display",
".",
"SVG",
"elif",
"format",
"in",
"(",
"\"jpeg\"",
",",
"\"png\"",
")",
":",
"display_cls",
"=",
"partial",
"(",
"display",
".",
"Image",
",",
"format",
"=",
"format",
",",
"embed",
"=",
"True",
")",
"out",
"=",
"BytesIO",
"(",
")",
"_render",
"(",
"g",
",",
"out",
",",
"format",
",",
"include_asset_exists",
"=",
"include_asset_exists",
")",
"return",
"display_cls",
"(",
"data",
"=",
"out",
".",
"getvalue",
"(",
")",
")"
] |
Display a TermGraph interactively from within IPython.
|
[
"Display",
"a",
"TermGraph",
"interactively",
"from",
"within",
"IPython",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/visualize.py#L152-L168
|
train
|
Display a TermGraph interactively from within IPython.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFAr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,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1142 - 1090) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(2152 - 2101) + chr(0b110111) + chr(52), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(0b110111) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(563 - 515) + chr(0b1100 + 0o143) + chr(51) + '\066' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(1680 - 1632) + chr(0b1011010 + 0o25) + chr(1904 - 1855) + chr(53) + chr(0b1010 + 0o51), 56036 - 56028), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101011 + 0o7) + chr(0b110001 + 0o6) + chr(540 - 487), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1796 - 1747) + '\x35' + chr(48), 5254 - 5246), ehT0Px3KOsy9(chr(1898 - 1850) + '\x6f' + '\062' + chr(0b110101) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11001 + 0o126) + chr(0b110011) + chr(48) + chr(0b110 + 0o55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(54) + chr(2574 - 2519), ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(111) + '\063' + chr(0b1011 + 0o52) + chr(2272 - 2224), ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\157' + '\063' + chr(1157 - 1105) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(2568 - 2517) + '\x33' + chr(53), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + chr(54) + chr(0b100001 + 0o17), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100010 + 0o21) + chr(0b110100 + 0o1) + chr(0b100111 + 0o17), 14318 - 14310), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1010 + 0o145) + chr(49) + chr(1333 - 1283), 13178 - 13170), ehT0Px3KOsy9(chr(70 - 22) + '\157' + chr(51) + chr(49) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(560 - 512) + chr(0b1101111) + chr(0b110001) + '\x30' + chr(1137 - 1082), 0b1000), ehT0Px3KOsy9(chr(1223 - 1175) + '\157' + chr(1059 - 1006) + chr(2079 - 2024), 47314 - 47306), ehT0Px3KOsy9('\x30' + '\157' + chr(999 - 949) + '\063' + chr(0b100110 + 0o15), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\066' + chr(702 - 652), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(111) + '\x33' + chr(0b10110 + 0o33) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(1117 - 1067) + chr(55) + chr(0b11110 + 0o24), 19207 - 19199), ehT0Px3KOsy9(chr(148 - 100) + '\157' + '\x32' + chr(0b100001 + 0o23) + chr(1423 - 1373), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + '\x36' + chr(2139 - 2089), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2483 - 2433) + chr(0b1 + 0o60) + chr(0b110011), 42359 - 42351), ehT0Px3KOsy9('\060' + chr(0b1001010 + 0o45) + '\x37', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(8610 - 8499) + '\x33' + chr(2292 - 2244) + chr(54), 6433 - 6425), ehT0Px3KOsy9('\060' + chr(0b10000 + 0o137) + '\x33' + chr(53) + '\060', 8), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(11614 - 11503) + '\x32' + chr(54) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(1787 - 1737) + chr(0b100 + 0o61), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1101111) + '\x31' + chr(0b110001) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + '\066' + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100110 + 0o111) + chr(0b101101 + 0o5) + chr(474 - 421) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(1811 - 1761) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010100 + 0o33) + chr(0b110001) + chr(2101 - 2050) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1010000 + 0o37) + chr(0b110000 + 0o2) + '\x35', 0b1000), ehT0Px3KOsy9(chr(60 - 12) + chr(111) + '\x32' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5460 - 5349) + '\x33' + '\x31' + chr(52), 28597 - 28589), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2031 - 1977) + '\065', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + '\x35' + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c'), '\x64' + '\145' + chr(0b10110 + 0o115) + chr(0b1101111) + chr(1511 - 1411) + '\145')('\165' + chr(0b111000 + 0o74) + chr(0b110 + 0o140) + '\055' + chr(0b10101 + 0o43)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Y4KKXc80r4A5(RWHpzFEeviFP, V4roHaS3Ppej=xafqLlk3kkUe(SXOLrMavuUCe(b'Q\x8a\x1b'), chr(100) + '\x65' + '\143' + chr(111) + chr(9414 - 9314) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\x66' + '\055' + '\x38'), Di5EqVGeQEQg=ehT0Px3KOsy9(chr(48) + chr(111) + '\060', 0b1000)):
try:
(RHkuqVmnahXJ,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'k\xac\x05\x86\x03\xd2\x06\x85\xa7^\x9b\x90\xb1\xd1\x97'), '\144' + chr(101) + '\143' + chr(8076 - 7965) + chr(2115 - 2015) + '\x65')(chr(11228 - 11111) + chr(116) + '\146' + chr(0b101101) + chr(300 - 244)), xafqLlk3kkUe(SXOLrMavuUCe(b'F\x95\x0f\x82\x07\xdc\x11'), chr(2627 - 2527) + '\x65' + chr(99) + '\157' + '\x64' + chr(0b1100101))('\x75' + '\164' + chr(10039 - 9937) + '\x2d' + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'F\x95\x0f\x82\x07\xdc\x11'), chr(2394 - 2294) + chr(8079 - 7978) + '\143' + chr(0b1101111) + chr(0b1011000 + 0o14) + '\x65')(chr(0b1110101) + chr(0b1110100) + '\146' + '\055' + '\x38')),)
except yROw0HWBk0Qc:
raise htl4WWPJaZJn(xafqLlk3kkUe(SXOLrMavuUCe(b"k\xac\x05\x86\x03\xd2\x06\x8b\xaaD\xc8\x8e\xb2\xc4\xcec\xa44[\xfa^\xa4\xdf\xc6\x9c\xab'\x85\x89\xda\xb2:\xd7\xcb\xbd/e{\xadL\x02\x9b\x0e\x93\x1b\xd5F"), chr(7059 - 6959) + '\145' + '\143' + '\157' + chr(5121 - 5021) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b110100 + 0o4)))
if V4roHaS3Ppej == xafqLlk3kkUe(SXOLrMavuUCe(b'Q\x8a\x1b'), '\144' + chr(0b1100101) + '\143' + chr(0b100100 + 0o113) + chr(0b1100100) + chr(0b110110 + 0o57))(chr(0b1110101) + '\164' + chr(102) + '\x2d' + '\x38'):
MflEo4JAWE4m = RHkuqVmnahXJ.SVG
elif V4roHaS3Ppej in (xafqLlk3kkUe(SXOLrMavuUCe(b'H\x8c\x19\x95'), '\144' + chr(5206 - 5105) + '\x63' + '\x6f' + chr(0b10000 + 0o124) + '\x65')('\165' + chr(116) + chr(102) + '\x2d' + chr(0b11111 + 0o31)), xafqLlk3kkUe(SXOLrMavuUCe(b'R\x92\x1b'), chr(0b111110 + 0o46) + chr(101) + chr(0b101111 + 0o64) + chr(111) + chr(100) + chr(0b1100101))(chr(12278 - 12161) + '\x74' + '\146' + chr(0b110 + 0o47) + chr(56))):
MflEo4JAWE4m = q_kvx1iNIzrz(RHkuqVmnahXJ.Image, format=V4roHaS3Ppej, embed=ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31', ord("\x08")))
UkrMp_I0RDmo = f9L_Rzl5SCCf()
Iu6Y2lPjGdmH(RWHpzFEeviFP, UkrMp_I0RDmo, V4roHaS3Ppej, include_asset_exists=Di5EqVGeQEQg)
return MflEo4JAWE4m(data=xafqLlk3kkUe(UkrMp_I0RDmo, xafqLlk3kkUe(SXOLrMavuUCe(b'E\x99\x08\x84\n\xd1\x1d\xce'), chr(100) + '\145' + '\143' + chr(699 - 588) + chr(8029 - 7929) + chr(101))(chr(0b1110101) + chr(116) + chr(7904 - 7802) + '\055' + chr(1012 - 956)))())
|
quantopian/zipline
|
zipline/pipeline/visualize.py
|
format_attrs
|
def format_attrs(attrs):
"""
Format key, value pairs from attrs into graphviz attrs format
Examples
--------
>>> format_attrs({'key1': 'value1', 'key2': 'value2'}) # doctest: +SKIP
'[key1=value1, key2=value2]'
"""
if not attrs:
return ''
entries = ['='.join((key, value)) for key, value in iteritems(attrs)]
return '[' + ', '.join(entries) + ']'
|
python
|
def format_attrs(attrs):
"""
Format key, value pairs from attrs into graphviz attrs format
Examples
--------
>>> format_attrs({'key1': 'value1', 'key2': 'value2'}) # doctest: +SKIP
'[key1=value1, key2=value2]'
"""
if not attrs:
return ''
entries = ['='.join((key, value)) for key, value in iteritems(attrs)]
return '[' + ', '.join(entries) + ']'
|
[
"def",
"format_attrs",
"(",
"attrs",
")",
":",
"if",
"not",
"attrs",
":",
"return",
"''",
"entries",
"=",
"[",
"'='",
".",
"join",
"(",
"(",
"key",
",",
"value",
")",
")",
"for",
"key",
",",
"value",
"in",
"iteritems",
"(",
"attrs",
")",
"]",
"return",
"'['",
"+",
"', '",
".",
"join",
"(",
"entries",
")",
"+",
"']'"
] |
Format key, value pairs from attrs into graphviz attrs format
Examples
--------
>>> format_attrs({'key1': 'value1', 'key2': 'value2'}) # doctest: +SKIP
'[key1=value1, key2=value2]'
|
[
"Format",
"key",
"value",
"pairs",
"from",
"attrs",
"into",
"graphviz",
"attrs",
"format"
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/visualize.py#L215-L227
|
train
|
Format key value pairs from attrs into graphviz attrs format
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAf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_gSK8V7h0,Rurm1zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(2064 - 2016) + '\157' + chr(1021 - 972) + chr(52) + '\x32', 47170 - 47162), ehT0Px3KOsy9(chr(48) + chr(6775 - 6664) + chr(2024 - 1974) + chr(2684 - 2632), 0o10), ehT0Px3KOsy9('\x30' + chr(0b10001 + 0o136) + '\062' + chr(54) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\x6f' + chr(0b110011) + '\x33' + chr(55), 17688 - 17680), ehT0Px3KOsy9(chr(48) + chr(11211 - 11100) + chr(0b110011) + '\064' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + '\060' + chr(103 - 49), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b10011 + 0o35) + chr(55), 59424 - 59416), ehT0Px3KOsy9('\060' + '\x6f' + chr(52) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110000 + 0o3) + chr(51) + chr(50), 0o10), ehT0Px3KOsy9(chr(1995 - 1947) + '\x6f' + chr(0b100110 + 0o13) + chr(0b110100) + '\065', 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + chr(519 - 469) + chr(2173 - 2123) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + chr(49) + chr(0b10101 + 0o40) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b111101 + 0o62) + '\063' + '\060' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + chr(0b100001 + 0o21) + chr(0b110001) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(885 - 837) + chr(0b1101111) + '\x33' + '\x37', 0b1000), ehT0Px3KOsy9(chr(1043 - 995) + '\x6f' + '\x33' + chr(0b110110) + chr(922 - 867), 5650 - 5642), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(8327 - 8216) + '\x33' + chr(0b10010 + 0o37), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + '\063' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(1532 - 1482) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1001101 + 0o42) + chr(51) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b11101 + 0o32) + chr(2402 - 2347), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(3827 - 3716) + chr(0b110110) + '\x31', 0b1000), ehT0Px3KOsy9(chr(1196 - 1148) + chr(0b101111 + 0o100) + chr(314 - 263) + '\060' + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + chr(55) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + chr(0b110001) + chr(0b110111) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + '\x32' + '\060' + '\067', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010000 + 0o37) + '\061' + chr(0b110001) + chr(872 - 819), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(2136 - 2085) + chr(0b1001 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + '\x37' + '\065', 0b1000), ehT0Px3KOsy9('\x30' + chr(10055 - 9944) + chr(0b110011) + chr(0b11110 + 0o24) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b111 + 0o60), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10101 + 0o36), 37992 - 37984), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1919 - 1870) + '\x32' + '\x36', 21725 - 21717), ehT0Px3KOsy9(chr(1950 - 1902) + '\157' + chr(555 - 505) + '\064' + chr(0b10111 + 0o35), 0b1000), ehT0Px3KOsy9(chr(875 - 827) + '\157' + chr(53) + '\063', 40777 - 40769), ehT0Px3KOsy9('\060' + '\157' + '\064' + '\x30', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10 + 0o63) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b111 + 0o54) + '\067' + chr(52), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9080 - 8969) + chr(52) + '\x33', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1854 - 1806) + chr(0b1101111) + '\x35' + chr(0b110000), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'L'), '\144' + '\145' + '\143' + chr(0b1001000 + 0o47) + chr(100) + '\145')(chr(0b1110101) + '\x74' + chr(5959 - 5857) + '\055' + chr(0b110110 + 0o2)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def sC3PnG49fS0C(oIhwMA96NShQ):
if not oIhwMA96NShQ:
return xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b111111 + 0o45) + chr(0b1010000 + 0o25) + chr(781 - 682) + chr(0b1001011 + 0o44) + chr(0b1100100) + chr(0b1011000 + 0o15))(chr(7429 - 7312) + chr(116) + chr(102) + '\055' + chr(56))
tzAocNV6MBUm = [xafqLlk3kkUe(SXOLrMavuUCe(b'_'), chr(100) + '\x65' + '\143' + '\157' + chr(8293 - 8193) + chr(101))(chr(0b1001001 + 0o54) + chr(0b1010101 + 0o37) + chr(0b1100110) + chr(0b101101) + chr(0b101111 + 0o11))._oWXztVNnqHF((K3J4ZwSlE0sT, QmmgWUB13VCJ)) for (K3J4ZwSlE0sT, QmmgWUB13VCJ) in WYXqUHkBa2Bx(oIhwMA96NShQ)]
return xafqLlk3kkUe(SXOLrMavuUCe(b'9'), chr(8834 - 8734) + '\x65' + chr(99) + chr(111) + '\x64' + '\145')('\x75' + chr(0b1011101 + 0o27) + chr(0b1100110) + '\x2d' + chr(0b100011 + 0o25)) + xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'N4'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(100) + '\145')('\165' + '\x74' + '\146' + '\055' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'={\xe0\x87\x9f\xf2\xd1j\xb4\x14\xdf('), '\144' + chr(101) + '\x63' + chr(0b1101111) + chr(7354 - 7254) + chr(101))(chr(0b1001010 + 0o53) + chr(6359 - 6243) + chr(102) + chr(45) + chr(56)))(tzAocNV6MBUm) + xafqLlk3kkUe(SXOLrMavuUCe(b'?'), '\144' + chr(101) + chr(99) + chr(111) + chr(0b1010100 + 0o20) + '\x65')(chr(0b101 + 0o160) + '\x74' + chr(8623 - 8521) + chr(0b101101) + '\x38')
|
quantopian/zipline
|
zipline/utils/pool.py
|
SequentialPool.apply_async
|
def apply_async(f, args=(), kwargs=None, callback=None):
"""Apply a function but emulate the API of an asynchronous call.
Parameters
----------
f : callable
The function to call.
args : tuple, optional
The positional arguments.
kwargs : dict, optional
The keyword arguments.
Returns
-------
future : ApplyAsyncResult
The result of calling the function boxed in a future-like api.
Notes
-----
This calls the function eagerly but wraps it so that ``SequentialPool``
can be used where a :class:`multiprocessing.Pool` or
:class:`gevent.pool.Pool` would be used.
"""
try:
value = (identity if callback is None else callback)(
f(*args, **kwargs or {}),
)
successful = True
except Exception as e:
value = e
successful = False
return ApplyAsyncResult(value, successful)
|
python
|
def apply_async(f, args=(), kwargs=None, callback=None):
"""Apply a function but emulate the API of an asynchronous call.
Parameters
----------
f : callable
The function to call.
args : tuple, optional
The positional arguments.
kwargs : dict, optional
The keyword arguments.
Returns
-------
future : ApplyAsyncResult
The result of calling the function boxed in a future-like api.
Notes
-----
This calls the function eagerly but wraps it so that ``SequentialPool``
can be used where a :class:`multiprocessing.Pool` or
:class:`gevent.pool.Pool` would be used.
"""
try:
value = (identity if callback is None else callback)(
f(*args, **kwargs or {}),
)
successful = True
except Exception as e:
value = e
successful = False
return ApplyAsyncResult(value, successful)
|
[
"def",
"apply_async",
"(",
"f",
",",
"args",
"=",
"(",
")",
",",
"kwargs",
"=",
"None",
",",
"callback",
"=",
"None",
")",
":",
"try",
":",
"value",
"=",
"(",
"identity",
"if",
"callback",
"is",
"None",
"else",
"callback",
")",
"(",
"f",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
"or",
"{",
"}",
")",
",",
")",
"successful",
"=",
"True",
"except",
"Exception",
"as",
"e",
":",
"value",
"=",
"e",
"successful",
"=",
"False",
"return",
"ApplyAsyncResult",
"(",
"value",
",",
"successful",
")"
] |
Apply a function but emulate the API of an asynchronous call.
Parameters
----------
f : callable
The function to call.
args : tuple, optional
The positional arguments.
kwargs : dict, optional
The keyword arguments.
Returns
-------
future : ApplyAsyncResult
The result of calling the function boxed in a future-like api.
Notes
-----
This calls the function eagerly but wraps it so that ``SequentialPool``
can be used where a :class:`multiprocessing.Pool` or
:class:`gevent.pool.Pool` would be used.
|
[
"Apply",
"a",
"function",
"but",
"emulate",
"the",
"API",
"of",
"an",
"asynchronous",
"call",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/utils/pool.py#L84-L116
|
train
|
Apply a function but emulate the API of an asynchronous call.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoAL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72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\x6f' + '\x33' + '\060' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(126 - 78) + chr(111) + '\067' + '\x37', 38660 - 38652), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(55) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1000010 + 0o55) + chr(50) + chr(53), 13949 - 13941), ehT0Px3KOsy9(chr(1626 - 1578) + chr(2122 - 2011) + chr(51) + chr(1367 - 1315), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11000 + 0o33) + '\067' + chr(0b110011), 1399 - 1391), ehT0Px3KOsy9(chr(882 - 834) + '\x6f' + '\x31' + chr(1141 - 1087) + '\x35', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(0b110100) + chr(0b11110 + 0o22), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101101 + 0o2) + '\061' + '\x30' + '\064', 51279 - 51271), ehT0Px3KOsy9(chr(0b110000) + chr(11921 - 11810) + '\x32' + chr(53) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(49) + '\x37', 0o10), ehT0Px3KOsy9(chr(334 - 286) + chr(0b110110 + 0o71) + '\061' + chr(0b110000) + chr(52), 8), ehT0Px3KOsy9('\x30' + chr(5371 - 5260) + chr(0b110011) + chr(0b110101) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + chr(0b100101 + 0o16) + chr(0b110001), 14118 - 14110), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + chr(51) + chr(0b110010) + chr(1365 - 1313), 0b1000), ehT0Px3KOsy9(chr(1045 - 997) + chr(11700 - 11589) + chr(132 - 81) + chr(49) + chr(0b10110 + 0o32), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(641 - 589) + chr(1330 - 1279), 0b1000), ehT0Px3KOsy9(chr(119 - 71) + '\157' + chr(49) + chr(0b101 + 0o53) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b110110 + 0o71) + chr(831 - 782) + '\x32' + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + chr(11632 - 11521) + '\x31' + '\x34' + chr(0b110011 + 0o1), 0b1000), ehT0Px3KOsy9('\x30' + chr(3415 - 3304) + chr(0b110110) + '\063', 14321 - 14313), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + '\063' + chr(0b1101 + 0o47), 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + chr(2428 - 2378) + chr(1009 - 957) + chr(0b100100 + 0o14), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(0b110010) + chr(0b110011 + 0o1), 0o10), ehT0Px3KOsy9('\x30' + chr(5165 - 5054) + chr(49) + '\064' + chr(0b110010), 9354 - 9346), ehT0Px3KOsy9(chr(1343 - 1295) + chr(8908 - 8797) + '\061' + '\065' + chr(52), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1739 - 1689) + chr(0b110101) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\065' + chr(0b100011 + 0o23), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b11101 + 0o24) + chr(0b110001 + 0o3) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(1250 - 1139) + chr(0b110011) + '\x37' + chr(53), 37949 - 37941), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + '\x37' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + chr(7086 - 6975) + chr(2096 - 2047) + chr(0b1100 + 0o46), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(3587 - 3476) + chr(0b110001) + chr(0b11110 + 0o31) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(51) + '\060' + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1577 - 1526) + '\065' + chr(289 - 238), 0o10), ehT0Px3KOsy9(chr(1623 - 1575) + chr(9899 - 9788) + chr(49) + chr(0b110011) + chr(0b110001 + 0o3), 8), ehT0Px3KOsy9(chr(0b110000) + chr(9364 - 9253) + chr(0b110011) + '\063' + chr(0b10010 + 0o36), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1050 - 999) + chr(51) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\157' + chr(1424 - 1374) + chr(580 - 528) + '\062', 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1101111) + chr(49) + chr(0b110010) + chr(0b100101 + 0o21), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101001 + 0o6) + chr(157 - 104) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xee'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(100) + '\145')(chr(0b1110101) + '\164' + chr(0b1100110) + '\055' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def TK3pUdcXKU_h(EGyt1xfPT1P6, kJDRfRhcZHjS=(), M8EIoTs2GJXE=None, vPVvVtX29J_P=None):
try:
QmmgWUB13VCJ = (vFUG5mKXcvYG if vPVvVtX29J_P is None else vPVvVtX29J_P)(EGyt1xfPT1P6(*kJDRfRhcZHjS, **M8EIoTs2GJXE or {}))
gxjlYwak_aRq = ehT0Px3KOsy9('\x30' + '\157' + '\061', ord("\x08"))
except jLmadlzMdunT as GlnVAPeT6CUe:
QmmgWUB13VCJ = GlnVAPeT6CUe
gxjlYwak_aRq = ehT0Px3KOsy9(chr(0b110000) + chr(0b100100 + 0o113) + chr(2155 - 2107), 0o10)
return SvLZA5jiFvEx(QmmgWUB13VCJ, gxjlYwak_aRq)
|
quantopian/zipline
|
zipline/utils/cli.py
|
maybe_show_progress
|
def maybe_show_progress(it, show_progress, **kwargs):
"""Optionally show a progress bar for the given iterator.
Parameters
----------
it : iterable
The underlying iterator.
show_progress : bool
Should progress be shown.
**kwargs
Forwarded to the click progress bar.
Returns
-------
itercontext : context manager
A context manager whose enter is the actual iterator to use.
Examples
--------
.. code-block:: python
with maybe_show_progress([1, 2, 3], True) as ns:
for n in ns:
...
"""
if show_progress:
return click.progressbar(it, **kwargs)
# context manager that just return `it` when we enter it
return CallbackManager(lambda it=it: it)
|
python
|
def maybe_show_progress(it, show_progress, **kwargs):
"""Optionally show a progress bar for the given iterator.
Parameters
----------
it : iterable
The underlying iterator.
show_progress : bool
Should progress be shown.
**kwargs
Forwarded to the click progress bar.
Returns
-------
itercontext : context manager
A context manager whose enter is the actual iterator to use.
Examples
--------
.. code-block:: python
with maybe_show_progress([1, 2, 3], True) as ns:
for n in ns:
...
"""
if show_progress:
return click.progressbar(it, **kwargs)
# context manager that just return `it` when we enter it
return CallbackManager(lambda it=it: it)
|
[
"def",
"maybe_show_progress",
"(",
"it",
",",
"show_progress",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"show_progress",
":",
"return",
"click",
".",
"progressbar",
"(",
"it",
",",
"*",
"*",
"kwargs",
")",
"# context manager that just return `it` when we enter it",
"return",
"CallbackManager",
"(",
"lambda",
"it",
"=",
"it",
":",
"it",
")"
] |
Optionally show a progress bar for the given iterator.
Parameters
----------
it : iterable
The underlying iterator.
show_progress : bool
Should progress be shown.
**kwargs
Forwarded to the click progress bar.
Returns
-------
itercontext : context manager
A context manager whose enter is the actual iterator to use.
Examples
--------
.. code-block:: python
with maybe_show_progress([1, 2, 3], True) as ns:
for n in ns:
...
|
[
"Optionally",
"show",
"a",
"progress",
"bar",
"for",
"the",
"given",
"iterator",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/utils/cli.py#L7-L36
|
train
|
Optionally show a progress bar for the given iterator.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXj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lk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(564 - 516) + chr(8424 - 8313) + chr(0b110000 + 0o2) + chr(55) + '\x37', 52766 - 52758), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(12071 - 11960) + chr(55) + chr(0b101111 + 0o3), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(9473 - 9362) + '\063' + chr(0b10000 + 0o42) + chr(0b101000 + 0o13), 36529 - 36521), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + '\x31' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11948 - 11837) + chr(54) + chr(52), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(0b110000) + chr(0b100001 + 0o20), 57500 - 57492), ehT0Px3KOsy9('\060' + chr(8481 - 8370) + '\062' + chr(0b110010) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(54) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000001 + 0o56) + '\x32' + chr(1653 - 1601) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + chr(51) + '\x37' + '\061', 27010 - 27002), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100101 + 0o12) + '\x31' + chr(53) + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10111 + 0o130) + '\064' + chr(0b111 + 0o60), 0b1000), ehT0Px3KOsy9(chr(68 - 20) + chr(0b1101010 + 0o5) + chr(0b11 + 0o56) + chr(51) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(1579 - 1531) + chr(0b1101111) + chr(49) + chr(48) + chr(455 - 402), 0b1000), ehT0Px3KOsy9(chr(1245 - 1197) + chr(0b1000000 + 0o57) + '\x35' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(356 - 307) + '\062' + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(1422 - 1372) + '\066', 8423 - 8415), ehT0Px3KOsy9('\x30' + chr(2520 - 2409) + chr(2867 - 2812) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b111 + 0o150) + '\x32' + '\065' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(1542 - 1494) + chr(111) + chr(1055 - 1005) + chr(0b0 + 0o63) + chr(2591 - 2536), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\x6f' + '\063' + '\x37' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110101) + chr(1349 - 1294), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b0 + 0o157) + chr(51) + chr(52) + chr(0b11111 + 0o27), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + '\x37', 798 - 790), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\x32' + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\066' + '\063', 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\157' + '\061' + chr(1599 - 1545) + chr(59 - 6), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5899 - 5788) + chr(0b110011) + chr(0b1100 + 0o47) + chr(0b110010), 13517 - 13509), ehT0Px3KOsy9('\060' + chr(6121 - 6010) + '\x31' + '\x30' + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x34' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(2178 - 2128) + chr(50) + chr(2283 - 2230), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + '\x36' + chr(0b110 + 0o60), 8), ehT0Px3KOsy9(chr(1679 - 1631) + '\x6f' + '\x33' + '\x31' + chr(2397 - 2344), 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b100000 + 0o117) + chr(287 - 236) + '\065' + chr(211 - 156), 54047 - 54039), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b1 + 0o60) + '\x37' + '\065', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\061' + '\062' + '\x31', 20075 - 20067), ehT0Px3KOsy9(chr(1474 - 1426) + '\x6f' + chr(0b10 + 0o57) + '\061' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(1617 - 1569) + chr(1982 - 1871) + '\x31' + '\x30' + chr(0b110111), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b101001 + 0o106) + chr(0b110101) + '\x30', 29811 - 29803)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x91'), '\x64' + chr(0b101001 + 0o74) + '\143' + '\157' + chr(0b1100100) + chr(0b1100101))('\x75' + chr(10783 - 10667) + chr(0b11100 + 0o112) + chr(0b100000 + 0o15) + chr(1301 - 1245)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def EV62YNiiK8hq(SdOiQfoVLiMl, _rgtfo4EPgcH, **M8EIoTs2GJXE):
if _rgtfo4EPgcH:
return xafqLlk3kkUe(zsE8htsrFxS3, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcfH\xbc*F\xe4\xe7\xc5\xc5\x98\x1c'), '\144' + '\145' + '\143' + chr(111) + '\x64' + '\145')('\x75' + chr(116) + '\146' + chr(0b1010 + 0o43) + '\x38'))(SdOiQfoVLiMl, **M8EIoTs2GJXE)
return QK4aUuEfDhBb(lambda SdOiQfoVLiMl=SdOiQfoVLiMl: SdOiQfoVLiMl)
|
quantopian/zipline
|
zipline/__main__.py
|
main
|
def main(extension, strict_extensions, default_extension, x):
"""Top level zipline entry point.
"""
# install a logbook handler before performing any other operations
logbook.StderrHandler().push_application()
create_args(x, zipline.extension_args)
load_extensions(
default_extension,
extension,
strict_extensions,
os.environ,
)
|
python
|
def main(extension, strict_extensions, default_extension, x):
"""Top level zipline entry point.
"""
# install a logbook handler before performing any other operations
logbook.StderrHandler().push_application()
create_args(x, zipline.extension_args)
load_extensions(
default_extension,
extension,
strict_extensions,
os.environ,
)
|
[
"def",
"main",
"(",
"extension",
",",
"strict_extensions",
",",
"default_extension",
",",
"x",
")",
":",
"# install a logbook handler before performing any other operations",
"logbook",
".",
"StderrHandler",
"(",
")",
".",
"push_application",
"(",
")",
"create_args",
"(",
"x",
",",
"zipline",
".",
"extension_args",
")",
"load_extensions",
"(",
"default_extension",
",",
"extension",
",",
"strict_extensions",
",",
"os",
".",
"environ",
",",
")"
] |
Top level zipline entry point.
|
[
"Top",
"level",
"zipline",
"entry",
"point",
"."
] |
77ad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,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10 + 0o57) + chr(2003 - 1950) + '\x32', 38028 - 38020), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + '\067' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + chr(1905 - 1856) + chr(0b1001 + 0o51) + '\064', 47115 - 47107), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(0b110100) + '\065', 0o10), ehT0Px3KOsy9(chr(245 - 197) + chr(111) + chr(0b10110 + 0o33) + chr(0b100111 + 0o20) + chr(861 - 812), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1911 - 1861) + chr(0b10001 + 0o37) + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(0b100111 + 0o20) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\067' + chr(0b110010 + 0o0), 57735 - 57727), ehT0Px3KOsy9('\x30' + chr(4675 - 4564) + chr(0b110000 + 0o5) + chr(0b101 + 0o62), 10276 - 10268), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(111) + chr(0b110010) + chr(0b101111 + 0o3) + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1710 - 1661) + chr(51) + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + '\x35' + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + '\x33' + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(0b101101 + 0o3) + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + chr(11168 - 11057) + chr(1070 - 1015) + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + '\x33' + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\060' + chr(0b10011 + 0o42), 14758 - 14750), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\x31' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(1743 - 1695) + chr(111) + '\x35' + chr(53), 0b1000), ehT0Px3KOsy9(chr(2067 - 2019) + chr(111) + '\x32' + '\x34' + chr(0b110100), 31361 - 31353), ehT0Px3KOsy9('\x30' + '\x6f' + '\x37' + '\x31', 8), ehT0Px3KOsy9('\x30' + '\157' + chr(1672 - 1623) + chr(149 - 94) + chr(0b110001 + 0o4), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\065' + chr(0b101010 + 0o12), 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(111) + chr(0b110011) + chr(842 - 789), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(341 - 291) + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(1801 - 1748), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110000 + 0o2) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101010 + 0o13), 8), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101111) + '\x32' + chr(1445 - 1397) + chr(723 - 673), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(52) + '\064', 49520 - 49512), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(4098 - 3987) + chr(50) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + chr(1865 - 1754) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(1290 - 1242) + '\x6f' + '\x37' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1101111) + chr(0b110011) + chr(299 - 244) + chr(50), 8), ehT0Px3KOsy9(chr(803 - 755) + '\157' + chr(50) + '\060' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(0b10110 + 0o41) + chr(0b1010 + 0o53), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b11111 + 0o26) + '\x35', 8), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b10110 + 0o131) + chr(0b11110 + 0o24) + '\x36' + '\x35', 0b1000), ehT0Px3KOsy9(chr(1969 - 1921) + '\157' + '\x32' + '\x33' + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000011 + 0o54) + '\x31' + chr(0b100111 + 0o11) + '\060', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1100011 + 0o14) + '\065' + chr(530 - 482), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'D'), '\144' + chr(101) + '\x63' + '\157' + chr(7293 - 7193) + '\x65')('\165' + '\x74' + chr(360 - 258) + chr(45) + chr(1155 - 1099)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def PGNrezus7XpS(bJEQ7witqKOi, ubHGDWPyHO0w, NhaS4Fk8zOE0, OeWW0F1dBPRQ):
xafqLlk3kkUe(liMj70KqdnGu.StderrHandler(), xafqLlk3kkUe(SXOLrMavuUCe(b"\x1a\x8f'\xcd&\xe5\x0c\xcaC\xf99\xc8)+V\xb3"), '\x64' + chr(0b1100101) + chr(99) + chr(111) + '\144' + chr(0b1011110 + 0o7))(chr(1514 - 1397) + '\x74' + chr(102) + '\055' + chr(0b11011 + 0o35)))()
NXdTAnJq82yL(OeWW0F1dBPRQ, xafqLlk3kkUe(hAo2UukXn4o9, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f\x82 \xc0\x17\xf7\x15\xd5A\xcf;\xdb:1'), chr(2723 - 2623) + chr(101) + '\143' + chr(0b1101111) + chr(100) + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(45) + '\x38')))
TuTSDgCxtKIN(NhaS4Fk8zOE0, bJEQ7witqKOi, ubHGDWPyHO0w, xafqLlk3kkUe(oqhJDdMJfuwx, xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\xb4\x1f\x93I\xcf&\x8c\x18\xfe\x02\xeb'), chr(100) + chr(0b10000 + 0o125) + '\143' + chr(11168 - 11057) + chr(7416 - 7316) + chr(193 - 92))(chr(0b1110101) + chr(4420 - 4304) + chr(102) + chr(1821 - 1776) + chr(2173 - 2117))))
|
quantopian/zipline
|
zipline/__main__.py
|
ipython_only
|
def ipython_only(option):
"""Mark that an option should only be exposed in IPython.
Parameters
----------
option : decorator
A click.option decorator.
Returns
-------
ipython_only_dec : decorator
A decorator that correctly applies the argument even when not
using IPython mode.
"""
if __IPYTHON__:
return option
argname = extract_option_object(option).name
def d(f):
@wraps(f)
def _(*args, **kwargs):
kwargs[argname] = None
return f(*args, **kwargs)
return _
return d
|
python
|
def ipython_only(option):
"""Mark that an option should only be exposed in IPython.
Parameters
----------
option : decorator
A click.option decorator.
Returns
-------
ipython_only_dec : decorator
A decorator that correctly applies the argument even when not
using IPython mode.
"""
if __IPYTHON__:
return option
argname = extract_option_object(option).name
def d(f):
@wraps(f)
def _(*args, **kwargs):
kwargs[argname] = None
return f(*args, **kwargs)
return _
return d
|
[
"def",
"ipython_only",
"(",
"option",
")",
":",
"if",
"__IPYTHON__",
":",
"return",
"option",
"argname",
"=",
"extract_option_object",
"(",
"option",
")",
".",
"name",
"def",
"d",
"(",
"f",
")",
":",
"@",
"wraps",
"(",
"f",
")",
"def",
"_",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"argname",
"]",
"=",
"None",
"return",
"f",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"_",
"return",
"d"
] |
Mark that an option should only be exposed in IPython.
Parameters
----------
option : decorator
A click.option decorator.
Returns
-------
ipython_only_dec : decorator
A decorator that correctly applies the argument even when not
using IPython mode.
|
[
"Mark",
"that",
"an",
"option",
"should",
"only",
"be",
"exposed",
"in",
"IPython",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/__main__.py#L84-L109
|
train
|
Mark that an option should only be exposed in IPython mode.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,szn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M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1001111 + 0o40) + '\x34' + chr(1846 - 1791), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(52) + chr(1757 - 1706), 64131 - 64123), ehT0Px3KOsy9(chr(48) + chr(0b1000011 + 0o54) + '\x31' + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1722 - 1672) + chr(0b10 + 0o57) + '\x37', 60674 - 60666), ehT0Px3KOsy9('\060' + chr(0b1011 + 0o144) + chr(0b110010) + chr(54) + chr(83 - 33), 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\x6f' + chr(1985 - 1932), 0b1000), ehT0Px3KOsy9(chr(2127 - 2079) + chr(0b1101111) + chr(49) + chr(0b10010 + 0o45) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(6825 - 6714) + chr(0b100101 + 0o16) + chr(0b110101) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b101100 + 0o6) + chr(371 - 316), 35244 - 35236), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + '\x36' + chr(2304 - 2253), 0o10), ehT0Px3KOsy9(chr(1027 - 979) + '\157' + chr(846 - 797) + chr(48) + chr(0b10 + 0o61), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000000 + 0o57) + chr(0b110010) + chr(0b101010 + 0o6) + '\066', 35545 - 35537), ehT0Px3KOsy9('\x30' + chr(6517 - 6406) + chr(2658 - 2606), 53288 - 53280), ehT0Px3KOsy9('\x30' + chr(5763 - 5652) + chr(0b1011 + 0o46) + chr(0b110101) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(1903 - 1855) + '\x6f' + '\063', 0b1000), ehT0Px3KOsy9(chr(284 - 236) + '\x6f' + chr(86 - 37) + chr(0b110011) + chr(0b110001), 11903 - 11895), ehT0Px3KOsy9(chr(48) + '\157' + chr(1902 - 1853) + chr(55), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + '\x32' + chr(0b101011 + 0o7), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\157' + chr(51) + '\x30' + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + '\064' + chr(0b110100), 13631 - 13623), ehT0Px3KOsy9(chr(299 - 251) + '\157' + chr(0b100110 + 0o13) + chr(54), 27044 - 27036), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100100 + 0o16) + chr(50) + chr(0b11001 + 0o33), 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(111) + '\x32' + chr(202 - 149) + chr(2231 - 2182), 42859 - 42851), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b100100 + 0o113) + chr(2156 - 2102) + '\064', 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1101111) + '\x31' + chr(54), 8), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + chr(1548 - 1499) + '\060' + '\064', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(699 - 645) + '\060', 23016 - 23008), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + chr(1377 - 1326) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(1870 - 1822) + '\157' + chr(0b110001) + '\062' + '\060', 17352 - 17344), ehT0Px3KOsy9(chr(1956 - 1908) + '\157' + chr(0b110011) + chr(54) + chr(176 - 121), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(0b110011) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(10121 - 10010) + '\061' + '\063' + chr(0b110101 + 0o1), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(0b110101) + chr(922 - 873), 42256 - 42248), ehT0Px3KOsy9('\x30' + '\157' + chr(576 - 527) + chr(0b11001 + 0o27) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(1046 - 996) + '\066', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(256 - 207) + '\x37' + '\066', 37271 - 37263), ehT0Px3KOsy9(chr(48) + chr(4286 - 4175) + '\x32' + chr(0b101010 + 0o13) + '\061', 8), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\x6f' + '\062' + '\063' + '\x35', 0o10), ehT0Px3KOsy9(chr(462 - 414) + '\x6f' + chr(610 - 556) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(3717 - 3606) + '\062' + '\060' + chr(0b10111 + 0o34), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b111010 + 0o65) + '\065' + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\t'), '\x64' + chr(4928 - 4827) + chr(99) + chr(111) + '\144' + chr(101))('\x75' + chr(8690 - 8574) + chr(102) + chr(1198 - 1153) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def kV1OqChT1g9m(saXKyEQhzDvH):
if q4RBXPxWLhg0:
return saXKyEQhzDvH
ugZDRzWzTXdH = jNbxF7HTV5Be(saXKyEQhzDvH).AIvJRzLdDfgF
def pd3lxn9vqWxp(EGyt1xfPT1P6):
@cUOaMZfY2Ho1(EGyt1xfPT1P6)
def VNGQdHSFPrso(*kJDRfRhcZHjS, **M8EIoTs2GJXE):
M8EIoTs2GJXE[ugZDRzWzTXdH] = None
return EGyt1xfPT1P6(*kJDRfRhcZHjS, **M8EIoTs2GJXE)
return VNGQdHSFPrso
return pd3lxn9vqWxp
|
quantopian/zipline
|
zipline/__main__.py
|
run
|
def run(ctx,
algofile,
algotext,
define,
data_frequency,
capital_base,
bundle,
bundle_timestamp,
start,
end,
output,
trading_calendar,
print_algo,
metrics_set,
local_namespace,
blotter):
"""Run a backtest for the given algorithm.
"""
# check that the start and end dates are passed correctly
if start is None and end is None:
# check both at the same time to avoid the case where a user
# does not pass either of these and then passes the first only
# to be told they need to pass the second argument also
ctx.fail(
"must specify dates with '-s' / '--start' and '-e' / '--end'",
)
if start is None:
ctx.fail("must specify a start date with '-s' / '--start'")
if end is None:
ctx.fail("must specify an end date with '-e' / '--end'")
if (algotext is not None) == (algofile is not None):
ctx.fail(
"must specify exactly one of '-f' / '--algofile' or"
" '-t' / '--algotext'",
)
trading_calendar = get_calendar(trading_calendar)
perf = _run(
initialize=None,
handle_data=None,
before_trading_start=None,
analyze=None,
algofile=algofile,
algotext=algotext,
defines=define,
data_frequency=data_frequency,
capital_base=capital_base,
bundle=bundle,
bundle_timestamp=bundle_timestamp,
start=start,
end=end,
output=output,
trading_calendar=trading_calendar,
print_algo=print_algo,
metrics_set=metrics_set,
local_namespace=local_namespace,
environ=os.environ,
blotter=blotter,
benchmark_returns=None,
)
if output == '-':
click.echo(str(perf))
elif output != os.devnull: # make the zipline magic not write any data
perf.to_pickle(output)
return perf
|
python
|
def run(ctx,
algofile,
algotext,
define,
data_frequency,
capital_base,
bundle,
bundle_timestamp,
start,
end,
output,
trading_calendar,
print_algo,
metrics_set,
local_namespace,
blotter):
"""Run a backtest for the given algorithm.
"""
# check that the start and end dates are passed correctly
if start is None and end is None:
# check both at the same time to avoid the case where a user
# does not pass either of these and then passes the first only
# to be told they need to pass the second argument also
ctx.fail(
"must specify dates with '-s' / '--start' and '-e' / '--end'",
)
if start is None:
ctx.fail("must specify a start date with '-s' / '--start'")
if end is None:
ctx.fail("must specify an end date with '-e' / '--end'")
if (algotext is not None) == (algofile is not None):
ctx.fail(
"must specify exactly one of '-f' / '--algofile' or"
" '-t' / '--algotext'",
)
trading_calendar = get_calendar(trading_calendar)
perf = _run(
initialize=None,
handle_data=None,
before_trading_start=None,
analyze=None,
algofile=algofile,
algotext=algotext,
defines=define,
data_frequency=data_frequency,
capital_base=capital_base,
bundle=bundle,
bundle_timestamp=bundle_timestamp,
start=start,
end=end,
output=output,
trading_calendar=trading_calendar,
print_algo=print_algo,
metrics_set=metrics_set,
local_namespace=local_namespace,
environ=os.environ,
blotter=blotter,
benchmark_returns=None,
)
if output == '-':
click.echo(str(perf))
elif output != os.devnull: # make the zipline magic not write any data
perf.to_pickle(output)
return perf
|
[
"def",
"run",
"(",
"ctx",
",",
"algofile",
",",
"algotext",
",",
"define",
",",
"data_frequency",
",",
"capital_base",
",",
"bundle",
",",
"bundle_timestamp",
",",
"start",
",",
"end",
",",
"output",
",",
"trading_calendar",
",",
"print_algo",
",",
"metrics_set",
",",
"local_namespace",
",",
"blotter",
")",
":",
"# check that the start and end dates are passed correctly",
"if",
"start",
"is",
"None",
"and",
"end",
"is",
"None",
":",
"# check both at the same time to avoid the case where a user",
"# does not pass either of these and then passes the first only",
"# to be told they need to pass the second argument also",
"ctx",
".",
"fail",
"(",
"\"must specify dates with '-s' / '--start' and '-e' / '--end'\"",
",",
")",
"if",
"start",
"is",
"None",
":",
"ctx",
".",
"fail",
"(",
"\"must specify a start date with '-s' / '--start'\"",
")",
"if",
"end",
"is",
"None",
":",
"ctx",
".",
"fail",
"(",
"\"must specify an end date with '-e' / '--end'\"",
")",
"if",
"(",
"algotext",
"is",
"not",
"None",
")",
"==",
"(",
"algofile",
"is",
"not",
"None",
")",
":",
"ctx",
".",
"fail",
"(",
"\"must specify exactly one of '-f' / '--algofile' or\"",
"\" '-t' / '--algotext'\"",
",",
")",
"trading_calendar",
"=",
"get_calendar",
"(",
"trading_calendar",
")",
"perf",
"=",
"_run",
"(",
"initialize",
"=",
"None",
",",
"handle_data",
"=",
"None",
",",
"before_trading_start",
"=",
"None",
",",
"analyze",
"=",
"None",
",",
"algofile",
"=",
"algofile",
",",
"algotext",
"=",
"algotext",
",",
"defines",
"=",
"define",
",",
"data_frequency",
"=",
"data_frequency",
",",
"capital_base",
"=",
"capital_base",
",",
"bundle",
"=",
"bundle",
",",
"bundle_timestamp",
"=",
"bundle_timestamp",
",",
"start",
"=",
"start",
",",
"end",
"=",
"end",
",",
"output",
"=",
"output",
",",
"trading_calendar",
"=",
"trading_calendar",
",",
"print_algo",
"=",
"print_algo",
",",
"metrics_set",
"=",
"metrics_set",
",",
"local_namespace",
"=",
"local_namespace",
",",
"environ",
"=",
"os",
".",
"environ",
",",
"blotter",
"=",
"blotter",
",",
"benchmark_returns",
"=",
"None",
",",
")",
"if",
"output",
"==",
"'-'",
":",
"click",
".",
"echo",
"(",
"str",
"(",
"perf",
")",
")",
"elif",
"output",
"!=",
"os",
".",
"devnull",
":",
"# make the zipline magic not write any data",
"perf",
".",
"to_pickle",
"(",
"output",
")",
"return",
"perf"
] |
Run a backtest for the given algorithm.
|
[
"Run",
"a",
"backtest",
"for",
"the",
"given",
"algorithm",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/__main__.py#L216-L284
|
train
|
Run a backtest for the given algorithm.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv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Dw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b100001 + 0o20) + '\064' + chr(1400 - 1346), 16008 - 16000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(0b110011), 42442 - 42434), ehT0Px3KOsy9(chr(0b110000) + chr(8552 - 8441) + '\x31' + '\x35' + chr(0b10 + 0o62), 0o10), ehT0Px3KOsy9(chr(48) + chr(4860 - 4749) + chr(1598 - 1547) + '\x37' + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + chr(0b10001 + 0o42) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(179 - 130) + '\067' + '\065', 0o10), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b10000 + 0o137) + chr(0b100010 + 0o17) + chr(0b101001 + 0o7) + '\x32', 0b1000), ehT0Px3KOsy9(chr(424 - 376) + '\x6f' + chr(1626 - 1576) + chr(1946 - 1892) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x35' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11100 + 0o27) + '\063' + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(49) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(5387 - 5276) + '\062' + chr(1187 - 1132) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + '\x33' + chr(0b11 + 0o61), 0b1000), ehT0Px3KOsy9(chr(699 - 651) + '\x6f' + chr(51) + chr(0b110110) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(2128 - 2074) + chr(0b0 + 0o61), 0b1000), ehT0Px3KOsy9(chr(1992 - 1944) + chr(111) + chr(50) + chr(54) + chr(202 - 152), ord("\x08")), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(10617 - 10506) + '\x31' + '\067' + chr(53), 8), ehT0Px3KOsy9(chr(0b110000) + chr(10406 - 10295) + chr(50) + chr(0b100 + 0o63) + chr(0b101110 + 0o5), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(1299 - 1249) + '\x31', 21418 - 21410), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + '\062' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101 + 0o54) + chr(0b110100) + chr(0b11010 + 0o27), ord("\x08")), ehT0Px3KOsy9(chr(543 - 495) + '\157' + chr(0b1000 + 0o53) + '\062' + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(0b1100001 + 0o16) + chr(0b110011) + chr(0b110110) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2456 - 2406) + chr(52) + chr(0b10000 + 0o41), 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1100101 + 0o12) + '\x33' + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + chr(1919 - 1870) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(7683 - 7572) + '\x31' + '\x31', 1416 - 1408), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11011 + 0o26) + chr(0b110001) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(1380 - 1332) + chr(0b1101111) + '\x32' + chr(0b110001) + chr(0b110010 + 0o0), 62478 - 62470), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(4295 - 4184) + chr(0b110011) + chr(0b110011) + chr(0b1011 + 0o46), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + '\067' + '\x33', 8), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(704 - 593) + chr(2870 - 2815) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1100110 + 0o11) + '\063' + chr(0b110111) + chr(76 - 22), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b100100 + 0o113) + '\062' + chr(55) + chr(0b11110 + 0o26), 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101111) + chr(160 - 109) + '\060' + chr(0b11 + 0o55), 17750 - 17742), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(0b11011 + 0o31) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(51) + chr(203 - 150), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + '\x36' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(9979 - 9868) + chr(0b101011 + 0o10) + chr(51) + chr(727 - 675), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(3413 - 3302) + chr(0b110001) + '\x35' + chr(0b110100), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + '\x35' + chr(0b101101 + 0o3), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'H'), chr(0b100011 + 0o101) + chr(0b1001010 + 0o33) + '\x63' + '\157' + chr(100) + chr(101))('\x75' + chr(11941 - 11825) + chr(8787 - 8685) + chr(1302 - 1257) + chr(1687 - 1631)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def sgt5BU61bwZ2(oM3jLo753XfX, NnQHX5fD1Zem, rbX9ASHzRG83, LFEwb9Ri0OTx, bXS4MokNqKbm, kbRhDi9e7qqO, BdOvlW9oyNT1, PgtClxoRs7TB, avRbFsnfJxQj, whWDZq5_lP01, e1jVqMSBZ01Y, GUE1BY_7JDnn, F5yvBDS8VEtU, UqUxZ3isRi_J, N0I__FlILn33, WcJlIx2C2pWn):
if avRbFsnfJxQj is None and whWDZq5_lP01 is None:
xafqLlk3kkUe(oM3jLo753XfX, xafqLlk3kkUe(SXOLrMavuUCe(b'\x00r\x05\x93'), '\x64' + '\x65' + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(101))('\x75' + chr(0b1000010 + 0o62) + chr(102) + chr(45) + chr(3001 - 2945)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x0bf\x1f\x8b~\x0e2\xd3M\xb1\xab\xc0|\x94\xd0\xc6\x18\xc8\xb1"\x08\xa6\x9f\x81=ezh\xaa\xf6\x9b\x1a\xd3\x91\xb3\x10\xbc\x81\xa8KFr\x02\x9b~Zo\xd3\t\xf8\xe2\x99{\xdd\x9c\xd7\x13\xdf\xb6'), chr(0b1100100) + chr(9045 - 8944) + '\x63' + '\157' + chr(100) + chr(3936 - 3835))('\165' + '\x74' + chr(102) + '\055' + chr(56)))
if avRbFsnfJxQj is None:
xafqLlk3kkUe(oM3jLo753XfX, xafqLlk3kkUe(SXOLrMavuUCe(b'\x00r\x05\x93'), '\x64' + chr(0b1100101) + chr(99) + chr(0b1101111) + '\144' + '\145')(chr(0b1110101) + chr(11939 - 11823) + chr(0b1100110) + chr(381 - 336) + chr(0b11000 + 0o40)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x0bf\x1f\x8b~\x0e2\xd3M\xb1\xab\xc0|\x91\x91\xc1\t\xda\xe3!A\xb6\x96\xd5\x7fh~&\xfe\xb1\x9b\x1a\xd3\xcf\xe7D\xf2\xd3\xfbAK`\x18\x9e,\te'), '\144' + chr(0b111111 + 0o46) + '\143' + chr(0b101101 + 0o102) + chr(0b110000 + 0o64) + chr(2275 - 2174))('\x75' + '\164' + '\146' + chr(1396 - 1351) + chr(1596 - 1540)))
if whWDZq5_lP01 is None:
xafqLlk3kkUe(oM3jLo753XfX, xafqLlk3kkUe(SXOLrMavuUCe(b'\x00r\x05\x93'), '\x64' + chr(101) + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(0b11001 + 0o114))('\x75' + chr(5256 - 5140) + chr(0b100 + 0o142) + '\055' + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x0bf\x1f\x8b~\x0e2\xd3M\xb1\xab\xc0|\x91\xdf\x92\x18\xd5\xf5u\x05\xb3\x83\xc4:?`;\xe2\xf9\x9c\x10\x9b\x9b\xe0K\xfd\xd4\xf1A\x03}\x08\xd8'), chr(100) + chr(1492 - 1391) + chr(99) + chr(0b1100010 + 0o15) + chr(0b1100001 + 0o3) + chr(0b1100101))(chr(8594 - 8477) + chr(116) + chr(0b1100110) + chr(0b101000 + 0o5) + '\070'))
if (rbX9ASHzRG83 is not None) == (NnQHX5fD1Zem is not None):
xafqLlk3kkUe(oM3jLo753XfX, xafqLlk3kkUe(SXOLrMavuUCe(b'\x00r\x05\x93'), '\x64' + chr(0b111010 + 0o53) + '\x63' + '\x6f' + chr(8040 - 7940) + chr(0b1100101))('\165' + chr(0b111 + 0o155) + chr(0b1100110) + chr(0b101101) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b"\x0bf\x1f\x8b~\x0e2\xd3M\xb1\xab\xc0|\x95\xc9\xd3\x1e\xcf\xfd,A\xbd\x99\xc4:'oo\xad\xf4\xdd\x1a\xde\x93\xe0C\xf0\xde\xbd\x00\x01|\n\x962\x18e\x96A\xaa\xed\x9eq\x84\x96\x92R\x9b\xb6xL\xb3\x9b\xc6u<l7\xfe\xfe"), chr(2845 - 2745) + chr(101) + chr(99) + '\x6f' + chr(100) + '\x65')('\x75' + chr(116) + chr(0b11011 + 0o113) + chr(0b101101) + chr(56)))
GUE1BY_7JDnn = qV4fO1AoRtpp(GUE1BY_7JDnn)
FDrs8ZfAkDxp = xnaCGCEHQH3F(initialize=None, handle_data=None, before_trading_start=None, analyze=None, algofile=NnQHX5fD1Zem, algotext=rbX9ASHzRG83, defines=LFEwb9Ri0OTx, data_frequency=bXS4MokNqKbm, capital_base=kbRhDi9e7qqO, bundle=BdOvlW9oyNT1, bundle_timestamp=PgtClxoRs7TB, start=avRbFsnfJxQj, end=whWDZq5_lP01, output=e1jVqMSBZ01Y, trading_calendar=GUE1BY_7JDnn, print_algo=F5yvBDS8VEtU, metrics_set=UqUxZ3isRi_J, local_namespace=N0I__FlILn33, environ=oqhJDdMJfuwx.rNK60KZ67nXB, blotter=WcJlIx2C2pWn, benchmark_returns=None)
if e1jVqMSBZ01Y == xafqLlk3kkUe(SXOLrMavuUCe(b'K'), chr(0b101 + 0o137) + chr(3271 - 3170) + chr(0b1011100 + 0o7) + '\157' + chr(0b1100100) + chr(0b1100101))('\x75' + chr(9252 - 9136) + chr(102) + chr(45) + chr(1098 - 1042)):
xafqLlk3kkUe(zsE8htsrFxS3, xafqLlk3kkUe(SXOLrMavuUCe(b' ~Z\xaf\x01H0\xdd]\xb7\x8e\xf1'), chr(100) + chr(0b1100101) + '\x63' + '\157' + '\144' + chr(101))(chr(2198 - 2081) + '\x74' + '\x66' + '\055' + chr(1050 - 994)))(M8_cKLkHVB2V(FDrs8ZfAkDxp))
elif e1jVqMSBZ01Y != xafqLlk3kkUe(oqhJDdMJfuwx, xafqLlk3kkUe(SXOLrMavuUCe(b'\x02v\x1a\x91+\x11.'), '\x64' + '\145' + chr(0b1010000 + 0o23) + '\157' + chr(100) + '\x65')('\x75' + chr(0b100010 + 0o122) + '\146' + chr(0b101101) + chr(0b111000))):
xafqLlk3kkUe(FDrs8ZfAkDxp, xafqLlk3kkUe(SXOLrMavuUCe(b'\x12|3\x8f7\x1e)\xdaK'), '\x64' + chr(101) + chr(1317 - 1218) + chr(0b1100011 + 0o14) + chr(0b1100100) + chr(8925 - 8824))('\x75' + '\x74' + chr(0b11001 + 0o115) + chr(45) + chr(0b11111 + 0o31)))(e1jVqMSBZ01Y)
return FDrs8ZfAkDxp
|
quantopian/zipline
|
zipline/__main__.py
|
zipline_magic
|
def zipline_magic(line, cell=None):
"""The zipline IPython cell magic.
"""
load_extensions(
default=True,
extensions=[],
strict=True,
environ=os.environ,
)
try:
return run.main(
# put our overrides at the start of the parameter list so that
# users may pass values with higher precedence
[
'--algotext', cell,
'--output', os.devnull, # don't write the results by default
] + ([
# these options are set when running in line magic mode
# set a non None algo text to use the ipython user_ns
'--algotext', '',
'--local-namespace',
] if cell is None else []) + line.split(),
'%s%%zipline' % ((cell or '') and '%'),
# don't use system exit and propogate errors to the caller
standalone_mode=False,
)
except SystemExit as e:
# https://github.com/mitsuhiko/click/pull/533
# even in standalone_mode=False `--help` really wants to kill us ;_;
if e.code:
raise ValueError('main returned non-zero status code: %d' % e.code)
|
python
|
def zipline_magic(line, cell=None):
"""The zipline IPython cell magic.
"""
load_extensions(
default=True,
extensions=[],
strict=True,
environ=os.environ,
)
try:
return run.main(
# put our overrides at the start of the parameter list so that
# users may pass values with higher precedence
[
'--algotext', cell,
'--output', os.devnull, # don't write the results by default
] + ([
# these options are set when running in line magic mode
# set a non None algo text to use the ipython user_ns
'--algotext', '',
'--local-namespace',
] if cell is None else []) + line.split(),
'%s%%zipline' % ((cell or '') and '%'),
# don't use system exit and propogate errors to the caller
standalone_mode=False,
)
except SystemExit as e:
# https://github.com/mitsuhiko/click/pull/533
# even in standalone_mode=False `--help` really wants to kill us ;_;
if e.code:
raise ValueError('main returned non-zero status code: %d' % e.code)
|
[
"def",
"zipline_magic",
"(",
"line",
",",
"cell",
"=",
"None",
")",
":",
"load_extensions",
"(",
"default",
"=",
"True",
",",
"extensions",
"=",
"[",
"]",
",",
"strict",
"=",
"True",
",",
"environ",
"=",
"os",
".",
"environ",
",",
")",
"try",
":",
"return",
"run",
".",
"main",
"(",
"# put our overrides at the start of the parameter list so that",
"# users may pass values with higher precedence",
"[",
"'--algotext'",
",",
"cell",
",",
"'--output'",
",",
"os",
".",
"devnull",
",",
"# don't write the results by default",
"]",
"+",
"(",
"[",
"# these options are set when running in line magic mode",
"# set a non None algo text to use the ipython user_ns",
"'--algotext'",
",",
"''",
",",
"'--local-namespace'",
",",
"]",
"if",
"cell",
"is",
"None",
"else",
"[",
"]",
")",
"+",
"line",
".",
"split",
"(",
")",
",",
"'%s%%zipline'",
"%",
"(",
"(",
"cell",
"or",
"''",
")",
"and",
"'%'",
")",
",",
"# don't use system exit and propogate errors to the caller",
"standalone_mode",
"=",
"False",
",",
")",
"except",
"SystemExit",
"as",
"e",
":",
"# https://github.com/mitsuhiko/click/pull/533",
"# even in standalone_mode=False `--help` really wants to kill us ;_;",
"if",
"e",
".",
"code",
":",
"raise",
"ValueError",
"(",
"'main returned non-zero status code: %d'",
"%",
"e",
".",
"code",
")"
] |
The zipline IPython cell magic.
|
[
"The",
"zipline",
"IPython",
"cell",
"magic",
"."
] |
77ad15e6dc4c1cbcdc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ji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(7038 - 6927) + chr(0b110011) + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(52) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1133 - 1081) + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b110111) + chr(0b110001), 24573 - 24565), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(0b0 + 0o64) + '\061', 10062 - 10054), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(0b1001 + 0o51) + chr(0b110101), 47420 - 47412), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100111 + 0o14) + '\063' + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + chr(10913 - 10802) + chr(0b110010) + chr(55) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(1085 - 1037) + chr(0b1010111 + 0o30) + chr(49) + chr(0b110000) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(696 - 648) + chr(0b1101111) + chr(0b11000 + 0o33) + chr(53) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(0b110111) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1010001 + 0o36) + chr(0b110001) + '\065' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\157' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + '\061' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + '\066' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(1724 - 1676) + '\x6f' + '\064' + chr(2245 - 2193), 39547 - 39539), ehT0Px3KOsy9(chr(1398 - 1350) + chr(111) + '\x33' + '\x37' + '\x32', 39605 - 39597), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\x6f' + '\x32' + chr(2591 - 2538) + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1001010 + 0o45) + '\062' + chr(51) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(111) + chr(1697 - 1648) + chr(0b110111) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + '\x33' + chr(0b100111 + 0o11) + '\061', 0o10), ehT0Px3KOsy9(chr(398 - 350) + chr(0b1101111) + '\062' + chr(50) + '\x36', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(54) + chr(1354 - 1305), 63415 - 63407), ehT0Px3KOsy9(chr(48) + chr(1258 - 1147) + '\x33' + '\061' + chr(2350 - 2300), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001 + 0o2) + chr(0b110001), 29108 - 29100), ehT0Px3KOsy9('\060' + '\157' + '\061' + '\x32' + '\x31', 0o10), ehT0Px3KOsy9('\x30' + chr(0b110001 + 0o76) + chr(1011 - 960) + '\066' + chr(0b100110 + 0o16), 47122 - 47114), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(573 - 524) + chr(0b110010) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b110111) + chr(414 - 364), 8405 - 8397), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10 + 0o61) + chr(0b110111) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(1081 - 1033) + chr(7127 - 7016) + chr(0b111 + 0o52) + '\065' + '\067', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + '\x30' + chr(0b10000 + 0o41), 8), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + chr(1382 - 1332) + chr(0b110101) + chr(624 - 572), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100110 + 0o15) + '\060' + chr(0b10010 + 0o45), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1010001 + 0o36) + chr(0b110011) + chr(49) + chr(0b10011 + 0o40), 0o10), ehT0Px3KOsy9('\060' + chr(0b1011110 + 0o21) + '\062' + chr(0b10101 + 0o40) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b100010 + 0o115) + chr(0b10110 + 0o35) + chr(48) + chr(1240 - 1190), ord("\x08")), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b10010 + 0o135) + '\062' + '\061' + chr(50), 16128 - 16120), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(0b110 + 0o56) + chr(489 - 438), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(53) + chr(0b110000), 39466 - 39458)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'5'), chr(0b1100100) + '\x65' + chr(99) + chr(111) + chr(9733 - 9633) + '\145')(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b1110 + 0o37) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def wJ8kNpkvIIMB(LycYkDpyelF6, XQrM8eZytga5=None):
TuTSDgCxtKIN(default=ehT0Px3KOsy9(chr(48) + '\x6f' + '\061', 19643 - 19635), extensions=[], strict=ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(111) + chr(386 - 337), 8), environ=xafqLlk3kkUe(oqhJDdMJfuwx, xafqLlk3kkUe(SXOLrMavuUCe(b'i(i\x8f\xd1\x9e\x85\x8es\x85!.'), chr(0b1100100) + chr(0b1011010 + 0o13) + chr(0b1011111 + 0o4) + '\157' + chr(6721 - 6621) + chr(101))('\x75' + chr(0b1010111 + 0o35) + chr(0b11000 + 0o116) + chr(0b100010 + 0o13) + chr(0b100100 + 0o24))))
try:
return xafqLlk3kkUe(sgt5BU61bwZ2, xafqLlk3kkUe(SXOLrMavuUCe(b'v\x07K\xd7'), '\144' + chr(101) + chr(0b1100011) + chr(111) + chr(2562 - 2462) + chr(0b111001 + 0o54))('\x75' + chr(0b1110100) + chr(0b11000 + 0o116) + chr(1931 - 1886) + '\x38'))([xafqLlk3kkUe(SXOLrMavuUCe(b'6KC\xd5\x86\xba\xab\xdd<\x9f'), chr(0b1000000 + 0o44) + '\145' + chr(0b1100011) + chr(6989 - 6878) + chr(0b1100100) + chr(0b1010001 + 0o24))(chr(117) + chr(3791 - 3675) + chr(0b1100110) + chr(0b101101) + chr(56)), XQrM8eZytga5, xafqLlk3kkUe(SXOLrMavuUCe(b'6KM\xcc\x95\xa5\xaa\xcc'), chr(7961 - 7861) + '\145' + chr(0b1100011) + chr(0b110010 + 0o75) + '\x64' + chr(0b1100101))(chr(117) + '\x74' + '\x66' + '\055' + '\070'), xafqLlk3kkUe(oqhJDdMJfuwx, xafqLlk3kkUe(SXOLrMavuUCe(b'\x7f\x03T\xd7\x94\xb9\xb3'), chr(100) + chr(1627 - 1526) + chr(0b10011 + 0o120) + chr(0b110001 + 0o76) + chr(0b1111 + 0o125) + '\x65')(chr(0b1110101) + chr(13260 - 13144) + '\146' + '\055' + chr(0b11010 + 0o36)))] + ([xafqLlk3kkUe(SXOLrMavuUCe(b'6KC\xd5\x86\xba\xab\xdd<\x9f'), '\x64' + '\145' + chr(0b1100 + 0o127) + chr(8214 - 8103) + '\x64' + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b110001 + 0o65) + '\055' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b''), '\x64' + chr(0b1011 + 0o132) + chr(99) + '\x6f' + chr(0b1011100 + 0o10) + '\x65')(chr(0b1110101) + '\164' + '\146' + chr(0b101101) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'6KN\xd6\x82\xb4\xb3\x95*\x8a\x14\tw8\x12G\x9f'), '\x64' + '\x65' + chr(0b1001011 + 0o30) + '\157' + '\144' + '\x65')(chr(0b101011 + 0o112) + chr(5068 - 4952) + chr(7263 - 7161) + chr(0b100 + 0o51) + chr(97 - 41))] if XQrM8eZytga5 is None else []) + xafqLlk3kkUe(LycYkDpyelF6, xafqLlk3kkUe(SXOLrMavuUCe(b'h\x16N\xd0\x95'), '\144' + chr(0b101101 + 0o70) + chr(99) + chr(0b1101111) + chr(0b1001111 + 0o25) + '\x65')(chr(117) + '\x74' + chr(102) + '\x2d' + chr(1540 - 1484)))(), xafqLlk3kkUe(SXOLrMavuUCe(b'>\x15\x07\x9c\x9b\xbc\xaf\xd4-\x85\x1c'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(111) + chr(0b100011 + 0o101) + chr(0b1001101 + 0o30))(chr(0b101110 + 0o107) + '\164' + chr(0b101001 + 0o75) + chr(0b100011 + 0o12) + '\070') % ((XQrM8eZytga5 or xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b1010010 + 0o22) + chr(0b1000 + 0o135) + chr(0b101001 + 0o72) + '\157' + chr(0b100011 + 0o101) + chr(0b111001 + 0o54))(chr(0b101 + 0o160) + '\x74' + chr(0b1001100 + 0o32) + chr(0b101101) + chr(56))) and xafqLlk3kkUe(SXOLrMavuUCe(b'>'), '\x64' + chr(0b1001001 + 0o34) + chr(0b1100011) + chr(6342 - 6231) + chr(0b1100100) + chr(0b111010 + 0o53))(chr(0b101 + 0o160) + '\164' + '\x66' + chr(1449 - 1404) + chr(1174 - 1118))), standalone_mode=ehT0Px3KOsy9('\060' + chr(0b1011010 + 0o25) + chr(0b101100 + 0o4), ord("\x08")))
except pz9FlfzsWoy1 as GlnVAPeT6CUe:
if xafqLlk3kkUe(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'A1p\xf7\xa6\xad\x85\x8b\x16\xdd@\x15'), chr(100) + chr(3792 - 3691) + '\143' + '\x6f' + '\144' + chr(101))('\165' + chr(0b11110 + 0o126) + chr(0b1100110) + '\055' + '\x38')):
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'v\x07K\xd7\xc1\xa7\xba\xcc1\x99\x17\t`h\x1dK\x94\x84\xe6\x1e\xb3\xf9\xd1\xb9cx%\x81#Z\x9c\x00\xa5\xc9\xfd\xeb\x8b\xa6'), chr(0b1100100) + chr(101) + '\143' + chr(8781 - 8670) + '\x64' + '\145')('\165' + chr(116) + chr(5712 - 5610) + chr(0b10000 + 0o35) + '\x38') % xafqLlk3kkUe(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'A1p\xf7\xa6\xad\x85\x8b\x16\xdd@\x15'), chr(0b1100100) + chr(101) + chr(0b1001011 + 0o30) + '\x6f' + '\144' + chr(2737 - 2636))('\165' + chr(0b1110011 + 0o1) + chr(7328 - 7226) + chr(0b101101) + '\070')))
|
quantopian/zipline
|
zipline/__main__.py
|
ingest
|
def ingest(bundle, assets_version, show_progress):
"""Ingest the data for the given bundle.
"""
bundles_module.ingest(
bundle,
os.environ,
pd.Timestamp.utcnow(),
assets_version,
show_progress,
)
|
python
|
def ingest(bundle, assets_version, show_progress):
"""Ingest the data for the given bundle.
"""
bundles_module.ingest(
bundle,
os.environ,
pd.Timestamp.utcnow(),
assets_version,
show_progress,
)
|
[
"def",
"ingest",
"(",
"bundle",
",",
"assets_version",
",",
"show_progress",
")",
":",
"bundles_module",
".",
"ingest",
"(",
"bundle",
",",
"os",
".",
"environ",
",",
"pd",
".",
"Timestamp",
".",
"utcnow",
"(",
")",
",",
"assets_version",
",",
"show_progress",
",",
")"
] |
Ingest the data for the given bundle.
|
[
"Ingest",
"the",
"data",
"for",
"the",
"given",
"bundle",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/__main__.py#L340-L349
|
train
|
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hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(1776 - 1665) + chr(0b110001) + chr(0b101110 + 0o4) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(0b110011) + chr(0b110110 + 0o1), 0o10), ehT0Px3KOsy9(chr(2299 - 2251) + chr(451 - 340) + '\x32' + chr(49) + chr(55), 0b1000), ehT0Px3KOsy9(chr(2275 - 2227) + chr(0b111010 + 0o65) + '\062', 3689 - 3681), ehT0Px3KOsy9('\x30' + chr(111) + chr(1280 - 1231) + '\064' + chr(0b10 + 0o64), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100101 + 0o16) + '\x32' + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(0b110010) + chr(1704 - 1654), 8), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1101111) + chr(1040 - 986) + chr(0b110101 + 0o0), 8992 - 8984), ehT0Px3KOsy9(chr(1474 - 1426) + '\x6f' + chr(861 - 810) + chr(53) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(7863 - 7752) + '\065' + chr(2607 - 2554), ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(0b10011 + 0o40) + '\060' + chr(0b10 + 0o61), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(7904 - 7793) + chr(0b11110 + 0o27) + chr(0b110000), 2814 - 2806), ehT0Px3KOsy9('\060' + '\x6f' + chr(243 - 194) + chr(0b110110) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b100011 + 0o17) + '\062', 8), ehT0Px3KOsy9(chr(116 - 68) + '\157' + chr(50) + chr(0b100011 + 0o24) + chr(2242 - 2190), 57299 - 57291), ehT0Px3KOsy9(chr(48) + chr(0b1101010 + 0o5) + '\061' + chr(0b110010), 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b11100 + 0o31) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(1508 - 1460) + chr(0b1101111) + '\061' + chr(810 - 756) + chr(0b1110 + 0o51), 8), ehT0Px3KOsy9(chr(48) + chr(0b1011 + 0o144) + chr(2194 - 2144) + chr(54) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b111111 + 0o60) + chr(1225 - 1176) + chr(0b110010) + chr(0b11000 + 0o36), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(0b110001) + chr(0b111 + 0o52), 39543 - 39535), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b10010 + 0o43) + '\066', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\066' + chr(54), 46186 - 46178), ehT0Px3KOsy9('\x30' + chr(0b1010101 + 0o32) + '\x33' + '\067' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(1966 - 1855) + chr(49) + chr(54) + '\x30', 0b1000), ehT0Px3KOsy9(chr(1444 - 1396) + chr(111) + '\x32' + chr(49) + '\060', 26023 - 26015), ehT0Px3KOsy9('\060' + chr(6736 - 6625) + '\x35' + '\x36', 58820 - 58812), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b10101 + 0o132) + chr(0b110011) + chr(182 - 130) + chr(0b11110 + 0o25), 0b1000), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b101000 + 0o107) + chr(1849 - 1800) + chr(0b110101) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1110 + 0o141) + '\063' + chr(0b10110 + 0o35) + chr(0b111 + 0o53), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(0b1000000 + 0o57) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110100) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(0b1010111 + 0o30) + '\062' + chr(2562 - 2508) + '\063', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1011110 + 0o21) + chr(0b10101 + 0o42) + '\065', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(50), 8), ehT0Px3KOsy9(chr(1217 - 1169) + '\157' + '\064' + '\x30', 48523 - 48515), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(0b110001 + 0o4) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + '\x31' + chr(53) + chr(0b10011 + 0o42), 35036 - 35028)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1010 + 0o145) + '\065' + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'$'), '\x64' + chr(101) + '\x63' + '\157' + '\144' + chr(0b111110 + 0o47))(chr(117) + '\164' + chr(0b1100110) + '\055' + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def L7s2CXx4LJem(BdOvlW9oyNT1, L593SNxn8hOM, _rgtfo4EPgcH):
xafqLlk3kkUe(tvfwEghQEIfh, xafqLlk3kkUe(SXOLrMavuUCe(b'Ff\xac\xbdA>\xaa\xe6y\xa4H\xae'), chr(0b110011 + 0o61) + '\145' + '\143' + '\157' + chr(9364 - 9264) + chr(0b1100101))(chr(117) + chr(13193 - 13077) + chr(102) + '\x2d' + '\x38'))(BdOvlW9oyNT1, xafqLlk3kkUe(oqhJDdMJfuwx, xafqLlk3kkUe(SXOLrMavuUCe(b'x\x1f\x94\xb92-\x88\xe4\x02\x80u\x81'), chr(3253 - 3153) + chr(0b1100101) + '\143' + chr(111) + chr(0b100010 + 0o102) + chr(0b110100 + 0o61))('\165' + '\164' + chr(0b1100110) + '\x2d' + chr(0b11100 + 0o34))), xafqLlk3kkUe(dubtF9GfzOdC.Timestamp, xafqLlk3kkUe(SXOLrMavuUCe(b'\x7f%\xbc\xe1m\x11'), '\x64' + '\x65' + chr(832 - 733) + '\x6f' + chr(100) + chr(0b1100101))(chr(10032 - 9915) + chr(0b1110100) + chr(0b110 + 0o140) + chr(0b101011 + 0o2) + chr(3105 - 3049)))(), L593SNxn8hOM, _rgtfo4EPgcH)
|
quantopian/zipline
|
zipline/__main__.py
|
clean
|
def clean(bundle, before, after, keep_last):
"""Clean up data downloaded with the ingest command.
"""
bundles_module.clean(
bundle,
before,
after,
keep_last,
)
|
python
|
def clean(bundle, before, after, keep_last):
"""Clean up data downloaded with the ingest command.
"""
bundles_module.clean(
bundle,
before,
after,
keep_last,
)
|
[
"def",
"clean",
"(",
"bundle",
",",
"before",
",",
"after",
",",
"keep_last",
")",
":",
"bundles_module",
".",
"clean",
"(",
"bundle",
",",
"before",
",",
"after",
",",
"keep_last",
",",
")"
] |
Clean up data downloaded with the ingest command.
|
[
"Clean",
"up",
"data",
"downloaded",
"with",
"the",
"ingest",
"command",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/__main__.py#L383-L391
|
train
|
Clean up data downloaded with the ingest command.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v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ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(55) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001000 + 0o47) + chr(0b110010) + '\062' + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101010 + 0o5) + chr(49) + chr(52) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + '\060' + chr(0b110101), 21601 - 21593), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2444 - 2393) + '\061' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(8025 - 7914) + chr(0b11000 + 0o31) + chr(2514 - 2463) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(50) + chr(0b100011 + 0o15), 0o10), ehT0Px3KOsy9(chr(1197 - 1149) + chr(8569 - 8458) + '\x33' + chr(52) + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(2081 - 1970) + chr(0b110010) + chr(55) + chr(0b10 + 0o62), 21673 - 21665), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b11101 + 0o32), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1110 + 0o45) + chr(0b110011) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + '\063' + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(2039 - 1987) + chr(526 - 477), 0o10), ehT0Px3KOsy9('\060' + chr(501 - 390) + chr(1130 - 1080) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(6631 - 6520) + chr(50) + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(0b11000 + 0o34) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + '\061' + chr(1772 - 1718) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + '\060' + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(0b110001) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(6273 - 6162) + chr(2458 - 2405) + chr(50), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(0b101100 + 0o10) + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(0b1101 + 0o50) + chr(0b111 + 0o53), ord("\x08")), ehT0Px3KOsy9(chr(668 - 620) + chr(0b10010 + 0o135) + '\x34' + chr(0b101 + 0o60), ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1011 + 0o144) + chr(0b110010 + 0o0) + chr(1684 - 1634) + chr(0b10110 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(2116 - 2068) + '\157' + '\062' + '\063' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + chr(53) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + '\061' + chr(0b10110 + 0o41) + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + '\x30' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(1985 - 1937) + chr(111) + chr(2137 - 2087) + '\x35' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(617 - 567) + chr(352 - 302) + chr(0b110 + 0o54), 8), ehT0Px3KOsy9(chr(2163 - 2115) + chr(11955 - 11844) + chr(0b11000 + 0o31) + '\x35' + chr(0b10100 + 0o35), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x37' + '\x32', 0o10), ehT0Px3KOsy9(chr(1952 - 1904) + chr(0b1101111) + chr(0b110001) + '\x30', 20211 - 20203), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + '\061' + '\x32', 8), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(519 - 467) + '\x35', 33672 - 33664), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(0b11101 + 0o23) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + '\066', 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101101 + 0o5) + '\063' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(626 - 578) + '\x6f' + chr(50) + chr(2329 - 2279) + chr(0b110 + 0o57), 55356 - 55348)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + '\065' + chr(0b1001 + 0o47), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x94'), '\144' + chr(101) + chr(99) + '\157' + chr(0b101001 + 0o73) + chr(0b1100101))(chr(350 - 233) + chr(0b1011001 + 0o33) + chr(102) + chr(0b101101) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def pFP9VDRQF23q(BdOvlW9oyNT1, SYBWeRDQQk_b, yUiKpR0j07vX, H6zra5sLycUI):
xafqLlk3kkUe(tvfwEghQEIfh, xafqLlk3kkUe(SXOLrMavuUCe(b'\xca\xd56\xfcW\x8b\x08\x81\xa0\x8e<\xac'), chr(100) + chr(101) + chr(8125 - 8026) + chr(0b1101111) + '\144' + '\145')(chr(0b1110101) + '\x74' + chr(3452 - 3350) + '\055' + chr(56)))(BdOvlW9oyNT1, SYBWeRDQQk_b, yUiKpR0j07vX, H6zra5sLycUI)
|
quantopian/zipline
|
zipline/__main__.py
|
bundles
|
def bundles():
"""List all of the available data bundles.
"""
for bundle in sorted(bundles_module.bundles.keys()):
if bundle.startswith('.'):
# hide the test data
continue
try:
ingestions = list(
map(text_type, bundles_module.ingestions_for_bundle(bundle))
)
except OSError as e:
if e.errno != errno.ENOENT:
raise
ingestions = []
# If we got no ingestions, either because the directory didn't exist or
# because there were no entries, print a single message indicating that
# no ingestions have yet been made.
for timestamp in ingestions or ["<no ingestions>"]:
click.echo("%s %s" % (bundle, timestamp))
|
python
|
def bundles():
"""List all of the available data bundles.
"""
for bundle in sorted(bundles_module.bundles.keys()):
if bundle.startswith('.'):
# hide the test data
continue
try:
ingestions = list(
map(text_type, bundles_module.ingestions_for_bundle(bundle))
)
except OSError as e:
if e.errno != errno.ENOENT:
raise
ingestions = []
# If we got no ingestions, either because the directory didn't exist or
# because there were no entries, print a single message indicating that
# no ingestions have yet been made.
for timestamp in ingestions or ["<no ingestions>"]:
click.echo("%s %s" % (bundle, timestamp))
|
[
"def",
"bundles",
"(",
")",
":",
"for",
"bundle",
"in",
"sorted",
"(",
"bundles_module",
".",
"bundles",
".",
"keys",
"(",
")",
")",
":",
"if",
"bundle",
".",
"startswith",
"(",
"'.'",
")",
":",
"# hide the test data",
"continue",
"try",
":",
"ingestions",
"=",
"list",
"(",
"map",
"(",
"text_type",
",",
"bundles_module",
".",
"ingestions_for_bundle",
"(",
"bundle",
")",
")",
")",
"except",
"OSError",
"as",
"e",
":",
"if",
"e",
".",
"errno",
"!=",
"errno",
".",
"ENOENT",
":",
"raise",
"ingestions",
"=",
"[",
"]",
"# If we got no ingestions, either because the directory didn't exist or",
"# because there were no entries, print a single message indicating that",
"# no ingestions have yet been made.",
"for",
"timestamp",
"in",
"ingestions",
"or",
"[",
"\"<no ingestions>\"",
"]",
":",
"click",
".",
"echo",
"(",
"\"%s %s\"",
"%",
"(",
"bundle",
",",
"timestamp",
")",
")"
] |
List all of the available data bundles.
|
[
"List",
"all",
"of",
"the",
"available",
"data",
"bundles",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/__main__.py#L395-L415
|
train
|
List all of the available data bundles.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEX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,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b111110 + 0o61) + '\063' + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b0 + 0o157) + '\066' + '\067', 13621 - 13613), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(2051 - 2003) + '\157' + chr(50) + '\x30' + chr(52), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(55), 0b1000), ehT0Px3KOsy9(chr(198 - 150) + chr(11206 - 11095) + '\x32' + chr(48) + chr(912 - 864), 0o10), ehT0Px3KOsy9(chr(48) + chr(11506 - 11395) + '\x33' + chr(51) + chr(0b101011 + 0o14), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(54) + chr(0b110000), 44220 - 44212), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(0b10100 + 0o42) + chr(0b11100 + 0o27), ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(2284 - 2173) + '\061' + chr(0b101011 + 0o13) + chr(0b11111 + 0o27), 0o10), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\x6f' + chr(612 - 562) + '\x35' + chr(55), 24526 - 24518), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011 + 0o144) + '\061' + '\x34' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + chr(0b11110 + 0o23) + chr(0b10000 + 0o43) + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(1745 - 1697) + '\063', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\063' + '\x36' + chr(1251 - 1201), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(10579 - 10468) + chr(1180 - 1129) + chr(0b110000 + 0o0) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(8741 - 8630) + chr(49) + '\x35' + chr(825 - 770), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11000 + 0o32) + chr(0b11 + 0o62) + chr(48), 5674 - 5666), ehT0Px3KOsy9(chr(48) + chr(11424 - 11313) + chr(54) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b100 + 0o153) + chr(50) + chr(54) + chr(982 - 930), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(0b110101) + chr(0b11000 + 0o30), 0b1000), ehT0Px3KOsy9('\060' + chr(7674 - 7563) + chr(49) + '\067' + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(8804 - 8693) + '\062' + '\x31' + chr(52), 51841 - 51833), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + '\x33' + chr(945 - 891), 8975 - 8967), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x34' + chr(0b10001 + 0o44), 0b1000), ehT0Px3KOsy9(chr(841 - 793) + '\157' + chr(0b10110 + 0o34) + '\063' + chr(51), 0b1000), ehT0Px3KOsy9(chr(1245 - 1197) + chr(0b1101111) + '\062' + chr(53) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101110 + 0o1) + '\062' + chr(0b1000 + 0o55) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x36' + chr(0b10111 + 0o35), 842 - 834), ehT0Px3KOsy9(chr(1251 - 1203) + chr(4119 - 4008) + '\x32' + chr(50) + '\064', 64190 - 64182), ehT0Px3KOsy9('\060' + chr(111) + '\x36' + chr(0b110111), 8), ehT0Px3KOsy9('\x30' + chr(0b1000111 + 0o50) + chr(49) + chr(0b110110) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + chr(0b110001 + 0o2) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + '\x31' + chr(0b110111) + chr(0b110 + 0o61), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b11011 + 0o30) + chr(518 - 465), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(979 - 929) + chr(53), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + '\065' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(111) + chr(0b1110 + 0o45) + '\x34' + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(0b101101 + 0o12) + chr(369 - 320), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(0b10101 + 0o34) + chr(1010 - 956), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101010 + 0o13) + chr(325 - 277), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'0'), '\144' + chr(8980 - 8879) + chr(0b1100011) + chr(111) + chr(9725 - 9625) + '\145')('\x75' + '\164' + chr(0b1100110) + '\x2d' + chr(0b11111 + 0o31)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def e6TIGpvOn5Jf():
for BdOvlW9oyNT1 in vUlqIvNSaRMa(xafqLlk3kkUe(tvfwEghQEIfh.bundles, xafqLlk3kkUe(SXOLrMavuUCe(b'uR\x7f\xf7'), chr(2626 - 2526) + chr(482 - 381) + chr(99) + '\157' + chr(100) + chr(0b1100001 + 0o4))(chr(0b1110101) + chr(116) + '\x66' + chr(45) + '\070'))()):
if xafqLlk3kkUe(BdOvlW9oyNT1, xafqLlk3kkUe(SXOLrMavuUCe(b'mCg\xf6s\xf3\xa8\x19\xc7\x1e'), '\x64' + '\145' + chr(0b1011 + 0o130) + '\157' + chr(1266 - 1166) + chr(4576 - 4475))(chr(4706 - 4589) + '\164' + chr(102) + '\x2d' + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'0'), chr(0b1100100) + '\x65' + chr(0b111000 + 0o53) + '\157' + chr(8567 - 8467) + chr(101))(chr(0b101010 + 0o113) + chr(6681 - 6565) + chr(0b1100110) + '\055' + chr(56))):
continue
try:
dot0HU17QT1e = YyaZ4tpXu4lf(abA97kOQKaLo(q1MiJcALIjIZ, tvfwEghQEIfh.ingestions_for_bundle(BdOvlW9oyNT1)))
except KlPSljPzIJ_u as GlnVAPeT6CUe:
if xafqLlk3kkUe(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'r||\xb1Q\xe8\xb1\x13\xfe\x1c\xe8\x05'), chr(0b1100100) + '\x65' + '\x63' + chr(7153 - 7042) + chr(0b1100100) + chr(101))(chr(0b11110 + 0o127) + chr(116) + chr(102) + chr(0b101101) + chr(0b100101 + 0o23))) != xafqLlk3kkUe(lKz5VhncMjGe, xafqLlk3kkUe(SXOLrMavuUCe(b'[yI\xc1I\xd4'), chr(0b1100100) + '\145' + chr(0b10101 + 0o116) + chr(0b10111 + 0o130) + '\144' + '\x65')(chr(0b1110101) + chr(116) + '\146' + '\055' + chr(56))):
raise
dot0HU17QT1e = []
for SgRbwnqVfFz7 in dot0HU17QT1e or [xafqLlk3kkUe(SXOLrMavuUCe(b'"Yi\xa4n\xee\xb8\x15\xc0\x02\xc6\x0f20\xcc'), '\144' + '\x65' + chr(1555 - 1456) + '\x6f' + chr(0b1100100) + chr(1189 - 1088))('\165' + chr(3457 - 3341) + chr(2767 - 2665) + '\055' + '\x38')]:
xafqLlk3kkUe(zsE8htsrFxS3, xafqLlk3kkUe(SXOLrMavuUCe(b'XZ0\xd4X\xb5\xad\x1b\xc0\x19\xec('), '\x64' + chr(0b10111 + 0o116) + '\143' + chr(0b1000 + 0o147) + chr(0b100100 + 0o100) + chr(0b1100101))('\165' + chr(3323 - 3207) + chr(0b1100110) + chr(1788 - 1743) + chr(0b100110 + 0o22)))(xafqLlk3kkUe(SXOLrMavuUCe(b';D&\xa1t'), chr(100) + chr(101) + '\143' + '\157' + chr(100) + chr(0b100 + 0o141))(chr(0b1101000 + 0o15) + chr(116) + chr(0b1100110) + chr(0b1111 + 0o36) + '\x38') % (BdOvlW9oyNT1, SgRbwnqVfFz7))
|
quantopian/zipline
|
zipline/pipeline/filters/filter.py
|
binary_operator
|
def binary_operator(op):
"""
Factory function for making binary operator methods on a Filter subclass.
Returns a function "binary_operator" suitable for implementing functions
like __and__ or __or__.
"""
# When combining a Filter with a NumericalExpression, we use this
# attrgetter instance to defer to the commuted interpretation of the
# NumericalExpression operator.
commuted_method_getter = attrgetter(method_name_for_op(op, commute=True))
def binary_operator(self, other):
if isinstance(self, NumericalExpression):
self_expr, other_expr, new_inputs = self.build_binary_op(
op, other,
)
return NumExprFilter.create(
"({left}) {op} ({right})".format(
left=self_expr,
op=op,
right=other_expr,
),
new_inputs,
)
elif isinstance(other, NumericalExpression):
# NumericalExpression overrides numerical ops to correctly handle
# merging of inputs. Look up and call the appropriate
# right-binding operator with ourself as the input.
return commuted_method_getter(other)(self)
elif isinstance(other, Term):
if other.dtype != bool_dtype:
raise BadBinaryOperator(op, self, other)
if self is other:
return NumExprFilter.create(
"x_0 {op} x_0".format(op=op),
(self,),
)
return NumExprFilter.create(
"x_0 {op} x_1".format(op=op),
(self, other),
)
elif isinstance(other, int): # Note that this is true for bool as well
return NumExprFilter.create(
"x_0 {op} {constant}".format(op=op, constant=int(other)),
binds=(self,),
)
raise BadBinaryOperator(op, self, other)
binary_operator.__doc__ = "Binary Operator: '%s'" % op
return binary_operator
|
python
|
def binary_operator(op):
"""
Factory function for making binary operator methods on a Filter subclass.
Returns a function "binary_operator" suitable for implementing functions
like __and__ or __or__.
"""
# When combining a Filter with a NumericalExpression, we use this
# attrgetter instance to defer to the commuted interpretation of the
# NumericalExpression operator.
commuted_method_getter = attrgetter(method_name_for_op(op, commute=True))
def binary_operator(self, other):
if isinstance(self, NumericalExpression):
self_expr, other_expr, new_inputs = self.build_binary_op(
op, other,
)
return NumExprFilter.create(
"({left}) {op} ({right})".format(
left=self_expr,
op=op,
right=other_expr,
),
new_inputs,
)
elif isinstance(other, NumericalExpression):
# NumericalExpression overrides numerical ops to correctly handle
# merging of inputs. Look up and call the appropriate
# right-binding operator with ourself as the input.
return commuted_method_getter(other)(self)
elif isinstance(other, Term):
if other.dtype != bool_dtype:
raise BadBinaryOperator(op, self, other)
if self is other:
return NumExprFilter.create(
"x_0 {op} x_0".format(op=op),
(self,),
)
return NumExprFilter.create(
"x_0 {op} x_1".format(op=op),
(self, other),
)
elif isinstance(other, int): # Note that this is true for bool as well
return NumExprFilter.create(
"x_0 {op} {constant}".format(op=op, constant=int(other)),
binds=(self,),
)
raise BadBinaryOperator(op, self, other)
binary_operator.__doc__ = "Binary Operator: '%s'" % op
return binary_operator
|
[
"def",
"binary_operator",
"(",
"op",
")",
":",
"# When combining a Filter with a NumericalExpression, we use this",
"# attrgetter instance to defer to the commuted interpretation of the",
"# NumericalExpression operator.",
"commuted_method_getter",
"=",
"attrgetter",
"(",
"method_name_for_op",
"(",
"op",
",",
"commute",
"=",
"True",
")",
")",
"def",
"binary_operator",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"self",
",",
"NumericalExpression",
")",
":",
"self_expr",
",",
"other_expr",
",",
"new_inputs",
"=",
"self",
".",
"build_binary_op",
"(",
"op",
",",
"other",
",",
")",
"return",
"NumExprFilter",
".",
"create",
"(",
"\"({left}) {op} ({right})\"",
".",
"format",
"(",
"left",
"=",
"self_expr",
",",
"op",
"=",
"op",
",",
"right",
"=",
"other_expr",
",",
")",
",",
"new_inputs",
",",
")",
"elif",
"isinstance",
"(",
"other",
",",
"NumericalExpression",
")",
":",
"# NumericalExpression overrides numerical ops to correctly handle",
"# merging of inputs. Look up and call the appropriate",
"# right-binding operator with ourself as the input.",
"return",
"commuted_method_getter",
"(",
"other",
")",
"(",
"self",
")",
"elif",
"isinstance",
"(",
"other",
",",
"Term",
")",
":",
"if",
"other",
".",
"dtype",
"!=",
"bool_dtype",
":",
"raise",
"BadBinaryOperator",
"(",
"op",
",",
"self",
",",
"other",
")",
"if",
"self",
"is",
"other",
":",
"return",
"NumExprFilter",
".",
"create",
"(",
"\"x_0 {op} x_0\"",
".",
"format",
"(",
"op",
"=",
"op",
")",
",",
"(",
"self",
",",
")",
",",
")",
"return",
"NumExprFilter",
".",
"create",
"(",
"\"x_0 {op} x_1\"",
".",
"format",
"(",
"op",
"=",
"op",
")",
",",
"(",
"self",
",",
"other",
")",
",",
")",
"elif",
"isinstance",
"(",
"other",
",",
"int",
")",
":",
"# Note that this is true for bool as well",
"return",
"NumExprFilter",
".",
"create",
"(",
"\"x_0 {op} {constant}\"",
".",
"format",
"(",
"op",
"=",
"op",
",",
"constant",
"=",
"int",
"(",
"other",
")",
")",
",",
"binds",
"=",
"(",
"self",
",",
")",
",",
")",
"raise",
"BadBinaryOperator",
"(",
"op",
",",
"self",
",",
"other",
")",
"binary_operator",
".",
"__doc__",
"=",
"\"Binary Operator: '%s'\"",
"%",
"op",
"return",
"binary_operator"
] |
Factory function for making binary operator methods on a Filter subclass.
Returns a function "binary_operator" suitable for implementing functions
like __and__ or __or__.
|
[
"Factory",
"function",
"for",
"making",
"binary",
"operator",
"methods",
"on",
"a",
"Filter",
"subclass",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/filters/filter.py#L62-L112
|
train
|
Returns a function that can be used to make a binary operator on a filter subclass.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz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zGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2000 - 1949) + chr(52) + chr(2596 - 2544), ord("\x08")), ehT0Px3KOsy9(chr(1505 - 1457) + chr(6266 - 6155) + chr(49) + '\061' + chr(52), 62132 - 62124), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(0b100000 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(0b100000 + 0o24) + chr(0b110011), 49724 - 49716), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1 + 0o62) + '\x34', 0b1000), ehT0Px3KOsy9(chr(2161 - 2113) + chr(367 - 256) + chr(0b11010 + 0o30) + '\066' + chr(1107 - 1052), 22186 - 22178), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10100 + 0o37) + chr(53) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(5866 - 5755) + chr(0b1 + 0o64) + chr(0b11011 + 0o26), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1088 - 1036) + chr(0b11111 + 0o26), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\062' + '\x33' + '\x32', 0o10), ehT0Px3KOsy9(chr(1083 - 1035) + '\157' + chr(0b101 + 0o54) + chr(0b10101 + 0o36) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + chr(10320 - 10209) + chr(0b11011 + 0o30) + chr(2067 - 2016) + chr(0b10100 + 0o35), 0b1000), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\157' + '\062' + '\x31' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1100 + 0o143) + chr(0b110010) + '\x30', 0o10), ehT0Px3KOsy9(chr(1177 - 1129) + chr(111) + '\x31' + chr(2574 - 2523) + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1851 - 1801) + chr(48) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(1808 - 1760) + '\x6f' + chr(0b100011 + 0o15), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1001011 + 0o44) + chr(1464 - 1413) + '\064' + '\x30', 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(111) + chr(0b110010) + chr(0b11100 + 0o25) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(702 - 654) + chr(0b100010 + 0o115) + '\061' + '\064' + chr(444 - 396), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1466 - 1415) + '\064' + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b10111 + 0o32) + '\x37' + chr(0b10 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(0b101000 + 0o17) + '\064', 0b1000), ehT0Px3KOsy9(chr(437 - 389) + '\x6f' + '\x33' + '\x33' + chr(1506 - 1455), 22230 - 22222), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + '\066' + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b110011 + 0o74) + '\x33' + chr(1578 - 1526) + chr(50), 29431 - 29423), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + chr(424 - 370) + chr(53), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + '\x36' + chr(2295 - 2243), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(0b110010 + 0o0) + '\x31', 54702 - 54694), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\065' + '\x34', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(0b110000) + '\061', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(48) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(661 - 613) + '\157' + '\063' + chr(0b110000) + '\067', 0b1000), ehT0Px3KOsy9(chr(1457 - 1409) + '\157' + chr(0b110011) + chr(48) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100111 + 0o10) + chr(49) + '\x33' + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(3421 - 3310) + '\065' + '\060', 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\157' + '\x31' + chr(2359 - 2308) + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(6910 - 6799) + chr(1695 - 1646) + chr(2480 - 2430) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(0b110 + 0o60) + '\x37', 16846 - 16838), ehT0Px3KOsy9(chr(1291 - 1243) + chr(1708 - 1597) + '\x31' + '\x32' + '\065', 41708 - 41700)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110101) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xca'), chr(0b100001 + 0o103) + chr(0b1001101 + 0o30) + chr(1990 - 1891) + chr(0b1101111) + chr(0b1010000 + 0o24) + chr(5755 - 5654))(chr(117) + chr(116) + chr(102) + '\055' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def CUzngcSXFl8v(C8dAr6Ujq2Tn):
fxpAmr6Wdbgl = rlJwIST4CBV1(AndnJZGtKuQi(C8dAr6Ujq2Tn, commute=ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\x6f' + '\061', ord("\x08"))))
def CUzngcSXFl8v(oVre8I6UXc3b, KK0ERS7DqYrY):
if PlSM16l2KDPD(oVre8I6UXc3b, dgwXlm5cakKw):
(kNhlqnMhYXCB, _zY3sbqLHto9, _kVftqoKhv4s) = oVre8I6UXc3b.build_binary_op(C8dAr6Ujq2Tn, KK0ERS7DqYrY)
return xafqLlk3kkUe(TD_Kp8gv_LT7, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9e\x14d[t\xfc\x98`\x13\xf81\x95'), chr(0b1100100) + chr(1058 - 957) + chr(99) + '\157' + chr(6848 - 6748) + chr(8348 - 8247))('\x75' + chr(0b1110100) + '\x66' + chr(45) + chr(0b110111 + 0o1)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xcc7e\x06z\xc3\x95\x00\x05\xe13\xa9\xf20p\xfbr\x89\xef\x08\x95\x04U'), chr(0b1100100) + chr(0b1011 + 0o132) + chr(0b11000 + 0o113) + chr(111) + '\x64' + chr(0b11010 + 0o113))(chr(4627 - 4510) + '\x74' + chr(0b11000 + 0o116) + chr(825 - 780) + chr(259 - 203)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2x{\x0cT\xd6\xbb\x1au\xea9\xb3'), '\x64' + '\x65' + '\143' + chr(0b100 + 0o153) + chr(0b1100100) + chr(4692 - 4591))(chr(117) + chr(3998 - 3882) + '\146' + '\x2d' + chr(0b1011 + 0o55)))(left=kNhlqnMhYXCB, op=C8dAr6Ujq2Tn, right=_zY3sbqLHto9), _kVftqoKhv4s)
elif PlSM16l2KDPD(KK0ERS7DqYrY, dgwXlm5cakKw):
return fxpAmr6Wdbgl(KK0ERS7DqYrY)(oVre8I6UXc3b)
elif PlSM16l2KDPD(KK0ERS7DqYrY, FYcYjPCXGlKG):
if xafqLlk3kkUe(KK0ERS7DqYrY, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e\x1f_ZU\xfc\x86LH\xd2k\x92'), '\144' + chr(0b1100101) + chr(99) + '\157' + chr(4366 - 4266) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b110110 + 0o60) + chr(513 - 468) + chr(2312 - 2256))) != RxCWrR7Zbq1B:
raise g_OwtHWi2Aiy(C8dAr6Ujq2Tn, oVre8I6UXc3b, KK0ERS7DqYrY)
if oVre8I6UXc3b is KK0ERS7DqYrY:
return xafqLlk3kkUe(TD_Kp8gv_LT7, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9e\x14d[t\xfc\x98`\x13\xf81\x95'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(111) + '\x64' + chr(8161 - 8060))(chr(0b1001100 + 0o51) + chr(9323 - 9207) + chr(0b1100110) + chr(169 - 124) + chr(0b110001 + 0o7)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x9c\x139Cg\xd8\x98T\x05\xe2\x03\xe9'), chr(0b1100100) + chr(0b1100101) + chr(4766 - 4667) + chr(0b1101111) + chr(3597 - 3497) + chr(0b101110 + 0o67))(chr(11537 - 11420) + chr(0b1110100) + '\146' + chr(45) + chr(1702 - 1646)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2x{\x0cT\xd6\xbb\x1au\xea9\xb3'), chr(0b1001101 + 0o27) + '\x65' + '\143' + chr(111) + '\x64' + chr(0b1010110 + 0o17))('\x75' + chr(116) + chr(8586 - 8484) + chr(45) + '\070'))(op=C8dAr6Ujq2Tn), (oVre8I6UXc3b,))
return xafqLlk3kkUe(TD_Kp8gv_LT7, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9e\x14d[t\xfc\x98`\x13\xf81\x95'), chr(100) + chr(101) + chr(99) + chr(0b1101111) + chr(0b111 + 0o135) + chr(2208 - 2107))(chr(0b110111 + 0o76) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(56)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x9c\x139Cg\xd8\x98T\x05\xe2\x03\xe8'), '\144' + '\x65' + chr(2350 - 2251) + chr(0b111110 + 0o61) + chr(100) + chr(0b1100101))(chr(0b101100 + 0o111) + chr(0b1000101 + 0o57) + '\146' + chr(0b101101) + chr(780 - 724)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2x{\x0cT\xd6\xbb\x1au\xea9\xb3'), chr(3264 - 3164) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(0b110101 + 0o57) + '\x65')('\x75' + chr(0b1110100) + '\146' + chr(1825 - 1780) + chr(1084 - 1028)))(op=C8dAr6Ujq2Tn), (oVre8I6UXc3b, KK0ERS7DqYrY))
elif PlSM16l2KDPD(KK0ERS7DqYrY, ehT0Px3KOsy9):
return xafqLlk3kkUe(TD_Kp8gv_LT7, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9e\x14d[t\xfc\x98`\x13\xf81\x95'), chr(2346 - 2246) + chr(101) + chr(0b1100011) + '\x6f' + '\x64' + chr(1354 - 1253))(chr(0b1110101) + chr(0b101000 + 0o114) + chr(0b1000101 + 0o41) + chr(0b101101) + '\x38'))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x9c\x139Cg\xd8\x98T\x05\xe1?\xb6\xe1c,\xe1n\x94\xf5'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\x6f' + '\144' + chr(8098 - 7997))(chr(0b1000101 + 0o60) + chr(0b1110100) + chr(102) + chr(916 - 871) + chr(642 - 586)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2x{\x0cT\xd6\xbb\x1au\xea9\xb3'), chr(0b1100100) + chr(9786 - 9685) + chr(9238 - 9139) + '\157' + '\x64' + '\x65')(chr(0b1110101 + 0o0) + chr(2215 - 2099) + '\x66' + chr(0b100101 + 0o10) + '\x38'))(op=C8dAr6Ujq2Tn, constant=ehT0Px3KOsy9(KK0ERS7DqYrY)), binds=(oVre8I6UXc3b,))
raise g_OwtHWi2Aiy(C8dAr6Ujq2Tn, oVre8I6UXc3b, KK0ERS7DqYrY)
CUzngcSXFl8v.OZYzwAeSQh7N = xafqLlk3kkUe(SXOLrMavuUCe(b'\xa6%g\x02n\xce\xc8fU\xff.\xb8\xfb\x7f*\xba \xc7\xad\x13\xc6'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(0b1011 + 0o144) + chr(100) + chr(101))('\x75' + '\164' + '\146' + chr(0b1101 + 0o40) + chr(56)) % C8dAr6Ujq2Tn
return CUzngcSXFl8v
|
quantopian/zipline
|
zipline/pipeline/filters/filter.py
|
unary_operator
|
def unary_operator(op):
"""
Factory function for making unary operator methods for Filters.
"""
valid_ops = {'~'}
if op not in valid_ops:
raise ValueError("Invalid unary operator %s." % op)
def unary_operator(self):
# This can't be hoisted up a scope because the types returned by
# unary_op_return_type aren't defined when the top-level function is
# invoked.
if isinstance(self, NumericalExpression):
return NumExprFilter.create(
"{op}({expr})".format(op=op, expr=self._expr),
self.inputs,
)
else:
return NumExprFilter.create("{op}x_0".format(op=op), (self,))
unary_operator.__doc__ = "Unary Operator: '%s'" % op
return unary_operator
|
python
|
def unary_operator(op):
"""
Factory function for making unary operator methods for Filters.
"""
valid_ops = {'~'}
if op not in valid_ops:
raise ValueError("Invalid unary operator %s." % op)
def unary_operator(self):
# This can't be hoisted up a scope because the types returned by
# unary_op_return_type aren't defined when the top-level function is
# invoked.
if isinstance(self, NumericalExpression):
return NumExprFilter.create(
"{op}({expr})".format(op=op, expr=self._expr),
self.inputs,
)
else:
return NumExprFilter.create("{op}x_0".format(op=op), (self,))
unary_operator.__doc__ = "Unary Operator: '%s'" % op
return unary_operator
|
[
"def",
"unary_operator",
"(",
"op",
")",
":",
"valid_ops",
"=",
"{",
"'~'",
"}",
"if",
"op",
"not",
"in",
"valid_ops",
":",
"raise",
"ValueError",
"(",
"\"Invalid unary operator %s.\"",
"%",
"op",
")",
"def",
"unary_operator",
"(",
"self",
")",
":",
"# This can't be hoisted up a scope because the types returned by",
"# unary_op_return_type aren't defined when the top-level function is",
"# invoked.",
"if",
"isinstance",
"(",
"self",
",",
"NumericalExpression",
")",
":",
"return",
"NumExprFilter",
".",
"create",
"(",
"\"{op}({expr})\"",
".",
"format",
"(",
"op",
"=",
"op",
",",
"expr",
"=",
"self",
".",
"_expr",
")",
",",
"self",
".",
"inputs",
",",
")",
"else",
":",
"return",
"NumExprFilter",
".",
"create",
"(",
"\"{op}x_0\"",
".",
"format",
"(",
"op",
"=",
"op",
")",
",",
"(",
"self",
",",
")",
")",
"unary_operator",
".",
"__doc__",
"=",
"\"Unary Operator: '%s'\"",
"%",
"op",
"return",
"unary_operator"
] |
Factory function for making unary operator methods for Filters.
|
[
"Factory",
"function",
"for",
"making",
"unary",
"operator",
"methods",
"for",
"Filters",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/filters/filter.py#L115-L136
|
train
|
Returns a factory function for making unary operator methods for Filters.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u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c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1100011 + 0o14) + chr(0b110011) + '\060' + chr(0b110011), 25996 - 25988), ehT0Px3KOsy9(chr(1425 - 1377) + '\157' + chr(2195 - 2143) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(890 - 841) + chr(0b110100) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(111) + chr(959 - 909) + '\063' + chr(0b1101 + 0o46), 18264 - 18256), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + '\065' + chr(1265 - 1210), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(111) + '\063' + '\x37', 0b1000), ehT0Px3KOsy9(chr(320 - 272) + chr(8797 - 8686) + chr(50) + '\x35' + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\062', 26791 - 26783), ehT0Px3KOsy9('\060' + chr(7481 - 7370) + chr(0b110001) + chr(703 - 654) + chr(1417 - 1363), 0b1000), ehT0Px3KOsy9('\060' + chr(4025 - 3914) + chr(0b110011) + chr(1580 - 1531) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b111100 + 0o63) + chr(0b110 + 0o55) + '\x31' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(1541 - 1493) + chr(0b1101111) + chr(50) + chr(50) + chr(2266 - 2217), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(479 - 431), 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(11053 - 10942) + chr(49) + chr(2545 - 2491) + chr(2197 - 2147), 0b1000), ehT0Px3KOsy9('\060' + chr(6088 - 5977) + chr(0b1011 + 0o47) + chr(665 - 616) + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1000 + 0o53) + '\x31' + chr(55), 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(587 - 476) + '\067' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\x6f' + '\x33' + '\066' + chr(0b101011 + 0o5), ord("\x08")), ehT0Px3KOsy9(chr(2209 - 2161) + chr(0b111110 + 0o61) + chr(50) + chr(0b110110) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(928 - 880) + '\x6f' + chr(0b101111 + 0o3) + '\066' + chr(0b10010 + 0o40), 0o10), ehT0Px3KOsy9(chr(48) + chr(6328 - 6217) + chr(408 - 358) + chr(51) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011111 + 0o20) + chr(49) + '\066' + chr(0b110010), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(2679 - 2626) + '\064', 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + chr(1165 - 1113) + chr(0b10001 + 0o45), 28927 - 28919), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101110 + 0o5) + chr(0b110001) + chr(1830 - 1782), 0b1000), ehT0Px3KOsy9(chr(785 - 737) + '\157' + '\061' + chr(50) + chr(155 - 107), 0b1000), ehT0Px3KOsy9(chr(669 - 621) + chr(111) + chr(2099 - 2048) + chr(0b1000 + 0o51) + '\x30', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(838 - 789) + chr(51) + chr(53), 42771 - 42763), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + '\064' + chr(0b110010), 7586 - 7578), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11010 + 0o31) + '\x36' + chr(0b110010), 40253 - 40245), ehT0Px3KOsy9('\x30' + chr(6763 - 6652) + chr(0b1001 + 0o51) + chr(48) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(1197 - 1149) + '\157' + '\x33' + '\x34', 37955 - 37947), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2310 - 2257) + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(335 - 282) + chr(1692 - 1643), 27651 - 27643), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10000 + 0o41) + chr(49) + '\061', 48427 - 48419), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(50) + chr(0b11111 + 0o24) + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + chr(6576 - 6465) + chr(51) + chr(0b110000) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(2979 - 2868) + '\062' + '\062', 8), ehT0Px3KOsy9(chr(0b110000) + chr(11910 - 11799) + '\x31' + chr(55) + '\062', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1010000 + 0o37) + '\x31' + '\x36' + chr(0b110101), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + chr(0b110100 + 0o1) + chr(335 - 287), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xed'), '\144' + '\145' + chr(99) + chr(0b101101 + 0o102) + '\x64' + chr(0b1100101))('\165' + chr(230 - 114) + chr(0b1100110) + '\x2d' + chr(1896 - 1840)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def wyqWKv7PreE9(C8dAr6Ujq2Tn):
ORlJCFRv6Nqd = {xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd'), chr(100) + chr(101) + chr(0b1100011) + chr(0b1101111) + '\144' + chr(101))('\165' + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b111000))}
if C8dAr6Ujq2Tn not in ORlJCFRv6Nqd:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8aO\x15\xfa\x83v\xca2;\xa2\xaf\xe3yR\xe2\xbf^\x82\xd4\xc6\xf3\x00L\x03\xbb~'), '\144' + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(8150 - 8050) + chr(6458 - 6357))(chr(117) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b111000)) % C8dAr6Ujq2Tn)
def wyqWKv7PreE9(oVre8I6UXc3b):
if PlSM16l2KDPD(oVre8I6UXc3b, dgwXlm5cakKw):
return xafqLlk3kkUe(TD_Kp8gv_LT7, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9y\x0e\xa3\x87T\xde[x\xae\xa3\xdd'), '\144' + '\x65' + chr(6455 - 6356) + chr(9133 - 9022) + chr(2257 - 2157) + chr(101))(chr(0b1110101) + chr(116) + '\x66' + chr(45) + chr(0b111000)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8N\x13\xe6\xc7d\xcbj>\xbe\xb3\xb8'), '\144' + chr(0b1100101) + chr(0b1010101 + 0o16) + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(0b1100100 + 0o21) + chr(0b1110100) + chr(102) + chr(45) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x95\x15\x11\xf4\xa7~\xfd!\x1e\xbc\xab\xfb'), '\x64' + '\x65' + chr(0b1100011) + chr(9141 - 9030) + chr(0b1101 + 0o127) + chr(0b1000001 + 0o44))(chr(0b1011100 + 0o31) + chr(2179 - 2063) + chr(0b100 + 0o142) + chr(45) + chr(56)))(op=C8dAr6Ujq2Tn, expr=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9cD\x1b\xeb\x9d'), chr(9364 - 9264) + '\x65' + chr(2593 - 2494) + chr(1916 - 1805) + chr(100) + chr(101))(chr(117) + '\x74' + chr(0b100 + 0o142) + chr(45) + chr(2675 - 2619)))), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb5y\x0c\xee\x9fz\xde_:\x8f\x96\xc4'), chr(100) + chr(0b10110 + 0o117) + '\x63' + chr(2931 - 2820) + '\144' + chr(101))(chr(117) + chr(0b1100110 + 0o16) + chr(2761 - 2659) + '\x2d' + chr(0b111000))))
else:
return xafqLlk3kkUe(TD_Kp8gv_LT7, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9y\x0e\xa3\x87T\xde[x\xae\xa3\xdd'), chr(100) + chr(0b1100101) + chr(99) + chr(111) + chr(0b11111 + 0o105) + chr(0b11 + 0o142))('\x75' + chr(0b1110100) + '\146' + chr(860 - 815) + '\070'))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8N\x13\xe6\x97@\x9e'), '\144' + '\145' + '\143' + '\x6f' + '\144' + chr(0b1001011 + 0o32))(chr(6215 - 6098) + chr(0b101010 + 0o112) + chr(5638 - 5536) + chr(0b1111 + 0o36) + chr(1912 - 1856)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x95\x15\x11\xf4\xa7~\xfd!\x1e\xbc\xab\xfb'), chr(100) + chr(8237 - 8136) + '\143' + chr(0b1101111) + chr(8421 - 8321) + chr(0b11100 + 0o111))('\x75' + '\x74' + chr(102) + chr(0b10110 + 0o27) + '\x38'))(op=C8dAr6Ujq2Tn), (oVre8I6UXc3b,))
wyqWKv7PreE9.OZYzwAeSQh7N = xafqLlk3kkUe(SXOLrMavuUCe(b'\x96O\x02\xe9\x96?\xe1b+\xbe\xaf\xe5o\x00\xb7\xef\x1c\xd5\xc6\x95'), chr(0b1100100) + chr(101) + chr(99) + chr(0b1101111) + chr(8772 - 8672) + chr(0b1100101))('\x75' + chr(116) + '\x66' + '\055' + chr(56)) % C8dAr6Ujq2Tn
return wyqWKv7PreE9
|
quantopian/zipline
|
zipline/pipeline/filters/filter.py
|
NumExprFilter.create
|
def create(cls, expr, binds):
"""
Helper for creating new NumExprFactors.
This is just a wrapper around NumericalExpression.__new__ that always
forwards `bool` as the dtype, since Filters can only be of boolean
dtype.
"""
return cls(expr=expr, binds=binds, dtype=bool_dtype)
|
python
|
def create(cls, expr, binds):
"""
Helper for creating new NumExprFactors.
This is just a wrapper around NumericalExpression.__new__ that always
forwards `bool` as the dtype, since Filters can only be of boolean
dtype.
"""
return cls(expr=expr, binds=binds, dtype=bool_dtype)
|
[
"def",
"create",
"(",
"cls",
",",
"expr",
",",
"binds",
")",
":",
"return",
"cls",
"(",
"expr",
"=",
"expr",
",",
"binds",
"=",
"binds",
",",
"dtype",
"=",
"bool_dtype",
")"
] |
Helper for creating new NumExprFactors.
This is just a wrapper around NumericalExpression.__new__ that always
forwards `bool` as the dtype, since Filters can only be of boolean
dtype.
|
[
"Helper",
"for",
"creating",
"new",
"NumExprFactors",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/filters/filter.py#L237-L245
|
train
|
Create a new instance of the correct class based on expr and binds.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJm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Rurm1zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(49), 57043 - 57035), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10001 + 0o41) + chr(0b11001 + 0o31), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2256 - 2207) + '\x33' + '\065', 51874 - 51866), ehT0Px3KOsy9(chr(0b110000) + chr(0b111000 + 0o67) + chr(0b11111 + 0o22) + chr(2206 - 2152) + chr(1402 - 1351), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1011000 + 0o27) + chr(0b100000 + 0o26) + chr(0b10100 + 0o34), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(517 - 466) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(0b110100) + '\061', 37979 - 37971), ehT0Px3KOsy9(chr(0b110000) + chr(2215 - 2104) + '\x31' + chr(0b100010 + 0o23) + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + '\060' + chr(0b110001 + 0o0), 0b1000), ehT0Px3KOsy9(chr(461 - 413) + '\157' + chr(0b110001) + chr(0b110101), 34605 - 34597), ehT0Px3KOsy9('\060' + chr(370 - 259) + '\063' + chr(890 - 838) + '\x32', 10257 - 10249), ehT0Px3KOsy9('\x30' + chr(6007 - 5896) + '\x34' + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + '\062' + '\x37', 39199 - 39191), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + chr(476 - 423) + chr(0b11110 + 0o26), ord("\x08")), ehT0Px3KOsy9(chr(51 - 3) + chr(0b110100 + 0o73) + chr(168 - 118) + '\x33' + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + '\x37' + chr(0b100101 + 0o20), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000010 + 0o55) + chr(0b10 + 0o60) + '\060' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(1010 - 962) + chr(3000 - 2889) + '\x33' + '\x36' + chr(55), 0o10), ehT0Px3KOsy9(chr(1088 - 1040) + chr(0b1101111) + '\061' + chr(51) + chr(0b101110 + 0o6), 60746 - 60738), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + chr(50) + '\060' + chr(0b11000 + 0o36), 0o10), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1010000 + 0o37) + chr(0b11010 + 0o31) + chr(2445 - 2395) + '\x37', 8), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(111) + chr(51) + '\067' + '\062', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(53) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b111 + 0o52) + chr(55) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + chr(51) + chr(0b110011) + chr(55), 0b1000), ehT0Px3KOsy9(chr(1034 - 986) + chr(0b10001 + 0o136) + chr(1222 - 1169) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(2581 - 2526), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(1868 - 1820) + chr(0b1100001 + 0o16) + chr(2502 - 2450) + '\x35', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(633 - 581) + chr(499 - 451), 40233 - 40225), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(4276 - 4165) + chr(0b110001) + chr(0b11100 + 0o32) + '\x36', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(815 - 766) + '\065' + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + chr(1833 - 1784) + '\x33' + '\x32', 44585 - 44577), ehT0Px3KOsy9(chr(601 - 553) + chr(0b101 + 0o152) + chr(50) + chr(0b110001 + 0o0) + chr(0b11100 + 0o27), 51333 - 51325), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + chr(0b101101 + 0o5) + '\064' + chr(0b0 + 0o62), 19898 - 19890), ehT0Px3KOsy9('\060' + chr(111) + chr(770 - 719) + '\x32' + chr(1116 - 1064), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(1701 - 1590) + chr(588 - 539) + chr(0b100000 + 0o21) + '\067', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11001 + 0o31) + '\064' + chr(0b110011), 19145 - 19137), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(344 - 294) + chr(0b11100 + 0o31) + chr(0b10011 + 0o42), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1010101 + 0o32) + chr(1959 - 1906) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'?'), chr(2902 - 2802) + chr(0b1100101) + chr(99) + chr(111) + '\144' + chr(5370 - 5269))('\165' + '\164' + '\x66' + '\x2d' + chr(1627 - 1571)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def zXm8hKpI6bmL(NSstowUUZlxS, uI2evTH5km5q, J1xY5QKRaWDc):
return NSstowUUZlxS(expr=uI2evTH5km5q, binds=J1xY5QKRaWDc, dtype=RxCWrR7Zbq1B)
|
quantopian/zipline
|
zipline/pipeline/filters/filter.py
|
NumExprFilter._compute
|
def _compute(self, arrays, dates, assets, mask):
"""
Compute our result with numexpr, then re-apply `mask`.
"""
return super(NumExprFilter, self)._compute(
arrays,
dates,
assets,
mask,
) & mask
|
python
|
def _compute(self, arrays, dates, assets, mask):
"""
Compute our result with numexpr, then re-apply `mask`.
"""
return super(NumExprFilter, self)._compute(
arrays,
dates,
assets,
mask,
) & mask
|
[
"def",
"_compute",
"(",
"self",
",",
"arrays",
",",
"dates",
",",
"assets",
",",
"mask",
")",
":",
"return",
"super",
"(",
"NumExprFilter",
",",
"self",
")",
".",
"_compute",
"(",
"arrays",
",",
"dates",
",",
"assets",
",",
"mask",
",",
")",
"&",
"mask"
] |
Compute our result with numexpr, then re-apply `mask`.
|
[
"Compute",
"our",
"result",
"with",
"numexpr",
"then",
"re",
"-",
"apply",
"mask",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/filters/filter.py#L247-L256
|
train
|
Compute our result with numexpr then re - apply mask.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,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IvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\x6f' + chr(0b101110 + 0o4) + '\067' + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + '\x30' + chr(951 - 899), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101111) + chr(0b100110 + 0o15) + chr(2143 - 2090) + '\x32', 26076 - 26068), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1770 - 1720) + chr(1509 - 1461) + chr(0b1010 + 0o50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10110 + 0o35) + chr(1198 - 1144), 33668 - 33660), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + '\x37' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b11010 + 0o125) + chr(1264 - 1210), 64267 - 64259), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11000 + 0o33) + chr(0b110100) + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1010101 + 0o32) + chr(0b110001 + 0o2) + chr(51) + chr(1301 - 1247), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(1823 - 1773) + '\063', 0o10), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(5765 - 5654) + chr(0b110010) + chr(55) + chr(1705 - 1656), 13673 - 13665), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(111) + chr(0b110011) + chr(122 - 67) + '\x36', 0o10), ehT0Px3KOsy9(chr(260 - 212) + chr(0b1101111) + chr(881 - 832) + chr(0b10 + 0o64) + chr(54), 0o10), ehT0Px3KOsy9(chr(2161 - 2113) + chr(0b1101111) + '\062' + chr(1517 - 1469) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + '\x33' + chr(0b110001) + '\x32', 0o10), ehT0Px3KOsy9('\x30' + chr(0b110101 + 0o72) + '\x32' + chr(2334 - 2285) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1000 + 0o147) + '\063' + chr(2357 - 2308) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(519 - 470) + chr(54) + '\060', 44826 - 44818), ehT0Px3KOsy9(chr(48) + chr(0b1001000 + 0o47) + chr(0b11110 + 0o24) + chr(0b101101 + 0o4) + chr(0b110100), 57802 - 57794), ehT0Px3KOsy9('\060' + chr(0b101 + 0o152) + chr(51) + '\067' + '\060', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110111) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11101 + 0o26) + chr(49) + '\x35', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1986 - 1936) + chr(0b10010 + 0o43), 0b1000), ehT0Px3KOsy9(chr(206 - 158) + chr(111) + chr(0b110110) + chr(0b100000 + 0o24), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5342 - 5231) + chr(2405 - 2354) + chr(55) + '\060', 8), ehT0Px3KOsy9(chr(0b110000) + chr(1346 - 1235) + chr(0b110010) + chr(0b110010) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(0b100110 + 0o16) + '\x34', 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + chr(0b110110) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(2065 - 2017) + '\x6f' + chr(392 - 341) + chr(55) + chr(0b101100 + 0o13), 0b1000), ehT0Px3KOsy9(chr(48) + chr(6158 - 6047) + chr(2367 - 2316) + chr(49) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1101111) + '\x33' + chr(0b100000 + 0o25) + '\062', 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101 + 0o54) + chr(0b10001 + 0o46) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x37' + chr(681 - 633), ord("\x08")), ehT0Px3KOsy9(chr(1502 - 1454) + chr(111) + chr(0b11111 + 0o22) + chr(773 - 718) + chr(51), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1343 - 1294) + '\x30' + '\061', 52208 - 52200), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(1201 - 1090) + chr(51) + '\x37' + chr(0b101011 + 0o6), 29705 - 29697), ehT0Px3KOsy9(chr(48) + chr(0b1010100 + 0o33) + '\065' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + chr(1967 - 1917) + '\x37' + '\x31', 8), ehT0Px3KOsy9(chr(396 - 348) + '\x6f' + chr(0b110010) + '\067' + chr(0b1111 + 0o41), ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b10111 + 0o130) + chr(51) + '\x37' + chr(0b100100 + 0o21), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + chr(53) + chr(0b0 + 0o60), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x93'), chr(2139 - 2039) + '\145' + chr(99) + chr(111) + chr(5356 - 5256) + chr(101))(chr(0b1010101 + 0o40) + '\164' + '\146' + chr(0b10110 + 0o27) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def PeHoGDqlkidn(oVre8I6UXc3b, lmEEfdW_XFlN, SLiSZu5nk7Kn, YGFU3oxACPcg, Iz1jSgUKZDvt):
return xafqLlk3kkUe(KNx0Ujaz9UM0(TD_Kp8gv_LT7, oVre8I6UXc3b), xafqLlk3kkUe(SXOLrMavuUCe(b"\xe2'\x85\xefn\tr\x81"), '\x64' + chr(2927 - 2826) + '\x63' + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(0b1010111 + 0o35) + chr(0b1100110) + chr(1336 - 1291) + chr(56)))(lmEEfdW_XFlN, SLiSZu5nk7Kn, YGFU3oxACPcg, Iz1jSgUKZDvt) & Iz1jSgUKZDvt
|
quantopian/zipline
|
zipline/pipeline/filters/filter.py
|
PercentileFilter._validate
|
def _validate(self):
"""
Ensure that our percentile bounds are well-formed.
"""
if not 0.0 <= self._min_percentile < self._max_percentile <= 100.0:
raise BadPercentileBounds(
min_percentile=self._min_percentile,
max_percentile=self._max_percentile,
upper_bound=100.0
)
return super(PercentileFilter, self)._validate()
|
python
|
def _validate(self):
"""
Ensure that our percentile bounds are well-formed.
"""
if not 0.0 <= self._min_percentile < self._max_percentile <= 100.0:
raise BadPercentileBounds(
min_percentile=self._min_percentile,
max_percentile=self._max_percentile,
upper_bound=100.0
)
return super(PercentileFilter, self)._validate()
|
[
"def",
"_validate",
"(",
"self",
")",
":",
"if",
"not",
"0.0",
"<=",
"self",
".",
"_min_percentile",
"<",
"self",
".",
"_max_percentile",
"<=",
"100.0",
":",
"raise",
"BadPercentileBounds",
"(",
"min_percentile",
"=",
"self",
".",
"_min_percentile",
",",
"max_percentile",
"=",
"self",
".",
"_max_percentile",
",",
"upper_bound",
"=",
"100.0",
")",
"return",
"super",
"(",
"PercentileFilter",
",",
"self",
")",
".",
"_validate",
"(",
")"
] |
Ensure that our percentile bounds are well-formed.
|
[
"Ensure",
"that",
"our",
"percentile",
"bounds",
"are",
"well",
"-",
"formed",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/filters/filter.py#L344-L354
|
train
|
Ensure that our percentile bounds are well - formed.
|
Pu7Z6IJC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ZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\x37' + chr(0b100000 + 0o23), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(49) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1499 - 1445) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(1741 - 1686) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1011011 + 0o24) + chr(0b110001) + chr(1269 - 1220) + chr(55), 28738 - 28730), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b1011 + 0o47) + chr(0b110010) + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1110 + 0o141) + chr(0b101011 + 0o6) + chr(2109 - 2059) + chr(0b110101), 3827 - 3819), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11110 + 0o121) + chr(1692 - 1642) + '\065' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + '\x31' + chr(0b100100 + 0o14) + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(998 - 949) + chr(1481 - 1431), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\061' + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(266 - 215) + chr(0b10110 + 0o35) + chr(0b110100), 3431 - 3423), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(54) + chr(1614 - 1565), ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1100101 + 0o12) + '\x32' + chr(0b101110 + 0o11) + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(1238 - 1127) + '\x32' + chr(1057 - 1005) + chr(0b110010), 42889 - 42881), ehT0Px3KOsy9('\060' + chr(411 - 300) + '\067' + chr(263 - 215), 17447 - 17439), ehT0Px3KOsy9('\x30' + chr(0b11110 + 0o121) + chr(51) + chr(55) + chr(0b1001 + 0o55), ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b1101111) + chr(51) + '\067' + chr(0b100010 + 0o23), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + '\x34' + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + '\x33' + '\061', 0b1000), ehT0Px3KOsy9(chr(2275 - 2227) + chr(0b1101111) + '\061' + '\060' + '\x30', 29294 - 29286), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110101) + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101100 + 0o3) + '\063' + chr(2624 - 2571) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(2185 - 2137) + chr(111) + chr(51) + '\x36' + chr(0b110011), 10378 - 10370), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + '\065' + chr(2681 - 2627), 0b1000), ehT0Px3KOsy9(chr(1081 - 1033) + '\157' + '\061' + chr(55) + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + chr(54) + '\066', 0b1000), ehT0Px3KOsy9(chr(1311 - 1263) + chr(3833 - 3722) + chr(796 - 746) + '\060' + chr(1590 - 1539), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x34' + chr(813 - 765), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\066' + chr(2172 - 2118), 8), ehT0Px3KOsy9('\x30' + chr(4760 - 4649) + chr(51) + chr(50) + '\060', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(0b110100) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(1622 - 1574) + '\157' + chr(0b110001) + chr(0b110000) + '\063', 8), ehT0Px3KOsy9(chr(628 - 580) + chr(0b1101111) + chr(0b11011 + 0o30) + chr(0b1011 + 0o53) + chr(1120 - 1070), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2162 - 2111) + chr(0b1010 + 0o53) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(11118 - 11007) + chr(49) + chr(0b1010 + 0o50) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + chr(7733 - 7622) + chr(50) + chr(819 - 770) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(112 - 64) + chr(1875 - 1764) + chr(1217 - 1167) + '\x37' + '\x33', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(598 - 550) + chr(0b1101111) + '\x35' + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'U'), chr(100) + '\x65' + chr(99) + chr(111) + '\x64' + chr(0b1000001 + 0o44))(chr(0b1110101) + '\x74' + '\146' + '\055' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def mCArq4frRHUO(oVre8I6UXc3b):
if not 0.0 <= xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'$\xa6X\xd7\x10\xe20l\xcf&d9\xb5\x9d\xd8'), chr(100) + chr(6041 - 5940) + '\x63' + chr(111) + chr(6735 - 6635) + '\x65')(chr(0b1110101) + chr(0b100010 + 0o122) + '\x66' + '\x2d' + chr(0b111000))) < xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'$\xa6P\xc1\x10\xe20l\xcf&d9\xb5\x9d\xd8'), '\x64' + chr(101) + chr(99) + '\x6f' + chr(3478 - 3378) + chr(0b101011 + 0o72))(chr(0b1110101) + '\164' + chr(102) + chr(0b100100 + 0o11) + '\070')) <= 100.0:
raise Xw0jWJH4Z3As(min_percentile=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'$\xa6X\xd7\x10\xe20l\xcf&d9\xb5\x9d\xd8'), chr(6003 - 5903) + chr(0b111110 + 0o47) + chr(0b111101 + 0o46) + chr(0b1001101 + 0o42) + chr(9426 - 9326) + chr(101))('\165' + chr(2443 - 2327) + '\x66' + chr(45) + chr(0b111000))), max_percentile=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'$\xa6P\xc1\x10\xe20l\xcf&d9\xb5\x9d\xd8'), '\x64' + chr(0b1100101) + chr(0b11 + 0o140) + '\x6f' + chr(0b11111 + 0o105) + '\x65')(chr(0b10011 + 0o142) + '\x74' + chr(9693 - 9591) + chr(0b0 + 0o55) + chr(0b100111 + 0o21))), upper_bound=100.0)
return xafqLlk3kkUe(KNx0Ujaz9UM0(tyd2kRP70T4P, oVre8I6UXc3b), xafqLlk3kkUe(SXOLrMavuUCe(b'$\xbdP\xd5&\xf64j\xc9'), chr(0b1100100) + chr(0b1100101) + '\143' + '\x6f' + chr(100) + '\x65')(chr(0b1110101) + chr(0b1110100 + 0o0) + '\146' + '\055' + chr(56)))()
|
quantopian/zipline
|
zipline/pipeline/filters/filter.py
|
PercentileFilter._compute
|
def _compute(self, arrays, dates, assets, mask):
"""
For each row in the input, compute a mask of all values falling between
the given percentiles.
"""
# TODO: Review whether there's a better way of handling small numbers
# of columns.
data = arrays[0].copy().astype(float64)
data[~mask] = nan
# FIXME: np.nanpercentile **should** support computing multiple bounds
# at once, but there's a bug in the logic for multiple bounds in numpy
# 1.9.2. It will be fixed in 1.10.
# c.f. https://github.com/numpy/numpy/pull/5981
lower_bounds = nanpercentile(
data,
self._min_percentile,
axis=1,
keepdims=True,
)
upper_bounds = nanpercentile(
data,
self._max_percentile,
axis=1,
keepdims=True,
)
return (lower_bounds <= data) & (data <= upper_bounds)
|
python
|
def _compute(self, arrays, dates, assets, mask):
"""
For each row in the input, compute a mask of all values falling between
the given percentiles.
"""
# TODO: Review whether there's a better way of handling small numbers
# of columns.
data = arrays[0].copy().astype(float64)
data[~mask] = nan
# FIXME: np.nanpercentile **should** support computing multiple bounds
# at once, but there's a bug in the logic for multiple bounds in numpy
# 1.9.2. It will be fixed in 1.10.
# c.f. https://github.com/numpy/numpy/pull/5981
lower_bounds = nanpercentile(
data,
self._min_percentile,
axis=1,
keepdims=True,
)
upper_bounds = nanpercentile(
data,
self._max_percentile,
axis=1,
keepdims=True,
)
return (lower_bounds <= data) & (data <= upper_bounds)
|
[
"def",
"_compute",
"(",
"self",
",",
"arrays",
",",
"dates",
",",
"assets",
",",
"mask",
")",
":",
"# TODO: Review whether there's a better way of handling small numbers",
"# of columns.",
"data",
"=",
"arrays",
"[",
"0",
"]",
".",
"copy",
"(",
")",
".",
"astype",
"(",
"float64",
")",
"data",
"[",
"~",
"mask",
"]",
"=",
"nan",
"# FIXME: np.nanpercentile **should** support computing multiple bounds",
"# at once, but there's a bug in the logic for multiple bounds in numpy",
"# 1.9.2. It will be fixed in 1.10.",
"# c.f. https://github.com/numpy/numpy/pull/5981",
"lower_bounds",
"=",
"nanpercentile",
"(",
"data",
",",
"self",
".",
"_min_percentile",
",",
"axis",
"=",
"1",
",",
"keepdims",
"=",
"True",
",",
")",
"upper_bounds",
"=",
"nanpercentile",
"(",
"data",
",",
"self",
".",
"_max_percentile",
",",
"axis",
"=",
"1",
",",
"keepdims",
"=",
"True",
",",
")",
"return",
"(",
"lower_bounds",
"<=",
"data",
")",
"&",
"(",
"data",
"<=",
"upper_bounds",
")"
] |
For each row in the input, compute a mask of all values falling between
the given percentiles.
|
[
"For",
"each",
"row",
"in",
"the",
"input",
"compute",
"a",
"mask",
"of",
"all",
"values",
"falling",
"between",
"the",
"given",
"percentiles",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/pipeline/filters/filter.py#L356-L382
|
train
|
Compute the mask of all values falling between the given percentiles.
|
Pu7Z6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ej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1101111) + '\062' + '\x34' + '\063', 0o10), ehT0Px3KOsy9(chr(277 - 229) + chr(111) + '\062' + '\067' + chr(2699 - 2644), 61984 - 61976), ehT0Px3KOsy9('\060' + chr(8134 - 8023) + chr(0b10011 + 0o40) + chr(2197 - 2143) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b11101 + 0o122) + '\061' + '\062' + chr(0b110100), 42751 - 42743), ehT0Px3KOsy9(chr(821 - 773) + chr(0b101101 + 0o102) + '\063' + chr(53) + chr(1774 - 1720), 41086 - 41078), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(0b100010 + 0o20) + chr(979 - 928), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101110 + 0o1) + chr(0b11101 + 0o26) + '\x33' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(6231 - 6120) + chr(0b110001) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11100 + 0o26) + '\x30' + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(55) + '\067', 0b1000), ehT0Px3KOsy9(chr(1309 - 1261) + chr(11390 - 11279) + chr(49) + chr(0b1110 + 0o50) + chr(2636 - 2582), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(53) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10001 + 0o136) + chr(0b110001) + '\x34' + '\x37', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b110001) + '\067', 3228 - 3220), ehT0Px3KOsy9(chr(669 - 621) + chr(0b1101111) + chr(2474 - 2423) + chr(54) + chr(0b110000 + 0o5), 8857 - 8849), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101110 + 0o3) + chr(51) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + chr(0b10101 + 0o35) + chr(2336 - 2287), 0o10), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(0b110010) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(307 - 257) + '\061' + '\x34', 19396 - 19388), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\157' + chr(50) + chr(0b110001) + chr(0b1101 + 0o44), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11011 + 0o31) + chr(0b100100 + 0o21), 16774 - 16766), ehT0Px3KOsy9('\060' + chr(1304 - 1193) + '\x32' + chr(0b111 + 0o51) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1101111) + chr(0b110001) + chr(1657 - 1607) + chr(800 - 750), 0o10), ehT0Px3KOsy9(chr(965 - 917) + chr(111) + chr(51) + '\x35' + chr(0b11111 + 0o30), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + '\062' + chr(0b110001), 22160 - 22152), ehT0Px3KOsy9('\060' + chr(0b101 + 0o152) + chr(0b10001 + 0o41) + chr(0b101000 + 0o12) + chr(55), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + '\x31' + chr(0b10101 + 0o40), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b110001) + chr(860 - 811), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11 + 0o56) + '\x30' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\x6f' + chr(0b1 + 0o61) + chr(973 - 925) + chr(55), 8), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1001011 + 0o44) + chr(832 - 781) + chr(0b110 + 0o60), 62857 - 62849), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1101111) + '\x32' + chr(0b101111 + 0o6), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + '\063', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + chr(1751 - 1696) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(1385 - 1274) + chr(1181 - 1131) + '\065' + chr(2139 - 2090), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(417 - 367) + chr(49) + '\067', 8), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(0b110000) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1000001 + 0o56) + chr(1298 - 1247) + '\x30' + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(10243 - 10132) + chr(0b110010) + '\x32' + chr(638 - 583), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + '\x35' + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8d'), '\144' + '\145' + chr(6064 - 5965) + chr(4675 - 4564) + chr(0b1001110 + 0o26) + chr(8736 - 8635))('\165' + chr(0b1110100) + chr(0b1100110) + chr(0b110 + 0o47) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def PeHoGDqlkidn(oVre8I6UXc3b, lmEEfdW_XFlN, SLiSZu5nk7Kn, YGFU3oxACPcg, Iz1jSgUKZDvt):
ULnjp6D6efFH = lmEEfdW_XFlN[ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b1101111) + '\x30', 8)].copy().astype(UDFMTvC8EtwJ)
ULnjp6D6efFH[~Iz1jSgUKZDvt] = wL5W1xj47aOd
EJH0RVkIxXn7 = y_4Yahp2wmcE(ULnjp6D6efFH, oVre8I6UXc3b._min_percentile, axis=ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49), 0o10), keepdims=ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1643 - 1594), 8))
v7TBLgiAHw8y = y_4Yahp2wmcE(ULnjp6D6efFH, oVre8I6UXc3b._max_percentile, axis=ehT0Px3KOsy9(chr(2300 - 2252) + '\157' + '\061', 8), keepdims=ehT0Px3KOsy9(chr(0b110000) + chr(0b1100010 + 0o15) + chr(0b101010 + 0o7), 8))
return (EJH0RVkIxXn7 <= ULnjp6D6efFH) & (ULnjp6D6efFH <= v7TBLgiAHw8y)
|
quantopian/zipline
|
zipline/data/treasuries.py
|
parse_treasury_csv_column
|
def parse_treasury_csv_column(column):
"""
Parse a treasury CSV column into a more human-readable format.
Columns start with 'RIFLGFC', followed by Y or M (year or month), followed
by a two-digit number signifying number of years/months, followed by _N.B.
We only care about the middle two entries, which we turn into a string like
3month or 30year.
"""
column_re = re.compile(
r"^(?P<prefix>RIFLGFC)"
"(?P<unit>[YM])"
"(?P<periods>[0-9]{2})"
"(?P<suffix>_N.B)$"
)
match = column_re.match(column)
if match is None:
raise ValueError("Couldn't parse CSV column %r." % column)
unit, periods = get_unit_and_periods(match.groupdict())
# Roundtrip through int to coerce '06' into '6'.
return str(int(periods)) + ('year' if unit == 'Y' else 'month')
|
python
|
def parse_treasury_csv_column(column):
"""
Parse a treasury CSV column into a more human-readable format.
Columns start with 'RIFLGFC', followed by Y or M (year or month), followed
by a two-digit number signifying number of years/months, followed by _N.B.
We only care about the middle two entries, which we turn into a string like
3month or 30year.
"""
column_re = re.compile(
r"^(?P<prefix>RIFLGFC)"
"(?P<unit>[YM])"
"(?P<periods>[0-9]{2})"
"(?P<suffix>_N.B)$"
)
match = column_re.match(column)
if match is None:
raise ValueError("Couldn't parse CSV column %r." % column)
unit, periods = get_unit_and_periods(match.groupdict())
# Roundtrip through int to coerce '06' into '6'.
return str(int(periods)) + ('year' if unit == 'Y' else 'month')
|
[
"def",
"parse_treasury_csv_column",
"(",
"column",
")",
":",
"column_re",
"=",
"re",
".",
"compile",
"(",
"r\"^(?P<prefix>RIFLGFC)\"",
"\"(?P<unit>[YM])\"",
"\"(?P<periods>[0-9]{2})\"",
"\"(?P<suffix>_N.B)$\"",
")",
"match",
"=",
"column_re",
".",
"match",
"(",
"column",
")",
"if",
"match",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Couldn't parse CSV column %r.\"",
"%",
"column",
")",
"unit",
",",
"periods",
"=",
"get_unit_and_periods",
"(",
"match",
".",
"groupdict",
"(",
")",
")",
"# Roundtrip through int to coerce '06' into '6'.",
"return",
"str",
"(",
"int",
"(",
"periods",
")",
")",
"+",
"(",
"'year'",
"if",
"unit",
"==",
"'Y'",
"else",
"'month'",
")"
] |
Parse a treasury CSV column into a more human-readable format.
Columns start with 'RIFLGFC', followed by Y or M (year or month), followed
by a two-digit number signifying number of years/months, followed by _N.B.
We only care about the middle two entries, which we turn into a string like
3month or 30year.
|
[
"Parse",
"a",
"treasury",
"CSV",
"column",
"into",
"a",
"more",
"human",
"-",
"readable",
"format",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/treasuries.py#L25-L47
|
train
|
Parses a treasury CSV column into a more human - readable format.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXA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xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10001 + 0o42) + '\063' + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(53) + chr(48), 0o10), ehT0Px3KOsy9('\060' + chr(10798 - 10687) + chr(0b101010 + 0o10) + '\066' + chr(1207 - 1159), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101111 + 0o7) + chr(2727 - 2674), 42241 - 42233), ehT0Px3KOsy9(chr(1996 - 1948) + chr(0b1010110 + 0o31) + '\x32' + '\x32' + chr(52), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(49) + '\x36' + '\060', 29099 - 29091), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(111) + chr(0b10010 + 0o41) + '\x30' + chr(758 - 707), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101001 + 0o6) + '\x32' + chr(0b101110 + 0o10) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b10100 + 0o133) + '\063' + chr(0b1110 + 0o44) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(963 - 910) + '\066', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101011 + 0o6) + chr(0b110 + 0o60) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x35' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(193 - 141) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(290 - 242) + chr(0b1101111) + chr(50) + chr(0b101001 + 0o11) + chr(0b11111 + 0o24), 53128 - 53120), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(2879 - 2768) + chr(49) + chr(54) + '\067', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(53) + '\065', 30123 - 30115), ehT0Px3KOsy9(chr(1064 - 1016) + '\x6f' + chr(49) + chr(0b101101 + 0o5) + chr(1299 - 1244), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9040 - 8929) + '\063' + '\x32' + chr(48), 16708 - 16700), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(6877 - 6766) + '\063' + chr(50) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3076 - 2965) + chr(0b1101 + 0o45) + chr(345 - 294) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(0b110100) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101 + 0o55) + '\063' + chr(0b110000), 8), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(841 - 789) + chr(0b110110), 10801 - 10793), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + '\x36' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(1800 - 1752) + chr(0b10010 + 0o135) + '\061' + chr(0b1001 + 0o53) + chr(0b11 + 0o56), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\157' + '\061' + chr(0b10010 + 0o40) + chr(607 - 558), 0b1000), ehT0Px3KOsy9(chr(1026 - 978) + chr(0b1101111) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + '\064', 0b1000), ehT0Px3KOsy9(chr(565 - 517) + '\157' + '\x33' + chr(0b100100 + 0o20) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1101111) + chr(0b110010) + '\061', 22509 - 22501), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + chr(0b110011 + 0o2) + '\061', 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1101111) + '\061' + chr(49) + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + '\x37' + '\063', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b11000 + 0o31) + chr(0b100101 + 0o16) + chr(1412 - 1357), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\067' + chr(0b0 + 0o62), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(0b101100 + 0o13) + chr(2244 - 2194), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + '\x31' + chr(0b1 + 0o65) + chr(0b101010 + 0o13), 0b1000), ehT0Px3KOsy9(chr(2277 - 2229) + chr(0b1101111) + chr(0b110011) + chr(0b10001 + 0o37) + chr(265 - 214), 8), ehT0Px3KOsy9(chr(516 - 468) + chr(0b101 + 0o152) + chr(51) + chr(0b110110) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(1508 - 1460) + chr(111) + '\062' + '\063' + chr(0b100001 + 0o20), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x35' + chr(1642 - 1594), 31693 - 31685)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf2'), chr(8217 - 8117) + chr(0b1100101) + chr(0b1100011) + chr(5647 - 5536) + '\x64' + chr(7388 - 7287))(chr(8702 - 8585) + chr(0b1111 + 0o145) + chr(0b10111 + 0o117) + '\055' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def XvUsQAGY0Otb(Pl0JgJDv0QqN):
_6uqmkDbCsyZ = _7u55U49WwX2.compile(xafqLlk3kkUe(SXOLrMavuUCe(b'\x82@\x8fe\xa8\x00\xb1\xd2\xb7\x07\n\x13\xf7\xda1!\x10\x96\x95\xb1\x89\xa7\xb6J\x14?mx\xddJ\xb0\x02&vR\xc5%\xff\x87\xfc\xae\x01\xdfQ\xe7N\x98\x87\xfcW/V\x97\xee^Eh\x80\xea\xeb\xd4\xfe\x80\x1f\x19o[B\xcdS\xc0k'), chr(0b110101 + 0o57) + chr(0b1100101) + chr(0b1001 + 0o132) + '\x6f' + chr(0b1011110 + 0o6) + '\x65')('\165' + chr(116) + chr(0b111000 + 0o56) + '\055' + '\070'))
AZi1vqvu7T1_ = _6uqmkDbCsyZ.match(Pl0JgJDv0QqN)
if AZi1vqvu7T1_ is None:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f\x07\xc5Y\xf0\x1e\xe4\xc3\xf1\x1e\x13_\xd6\xf6W.\x04\x86\xf6\xfb\xce\xf4\x93\x1b\x0fq!~\xcd'), chr(0b100 + 0o140) + chr(101) + chr(0b1100011) + chr(0b1001000 + 0o47) + chr(0b1100100) + '\145')(chr(10304 - 10187) + chr(116) + chr(0b1100110) + chr(0b100010 + 0o13) + chr(0b111000)) % Pl0JgJDv0QqN)
(zbwQ4mKE5Iq9, JSLL1jbGbEMC) = ZsYmtk5eG5Bw(AZi1vqvu7T1_.groupdict())
return M8_cKLkHVB2V(ehT0Px3KOsy9(JSLL1jbGbEMC)) + (xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5\r\xd1G'), chr(3925 - 3825) + '\x65' + chr(0b101 + 0o136) + chr(0b1101111) + chr(3332 - 3232) + '\145')(chr(0b1101000 + 0o15) + '\164' + '\146' + '\x2d' + chr(1239 - 1183)) if zbwQ4mKE5Iq9 == xafqLlk3kkUe(SXOLrMavuUCe(b'\x85'), chr(100) + chr(10188 - 10087) + '\143' + chr(0b1100101 + 0o12) + chr(0b1100100) + '\145')('\x75' + chr(4374 - 4258) + chr(102) + '\055' + chr(56)) else xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\x07\xdeA\xfc'), chr(0b110111 + 0o55) + chr(0b1100101) + chr(99) + chr(0b0 + 0o157) + chr(100) + chr(0b1100101))('\165' + chr(116) + '\146' + '\055' + chr(0b10010 + 0o46)))
|
quantopian/zipline
|
zipline/data/treasuries.py
|
get_daily_10yr_treasury_data
|
def get_daily_10yr_treasury_data():
"""Download daily 10 year treasury rates from the Federal Reserve and
return a pandas.Series."""
url = "https://www.federalreserve.gov/datadownload/Output.aspx?rel=H15" \
"&series=bcb44e57fb57efbe90002369321bfb3f&lastObs=&from=&to=" \
"&filetype=csv&label=include&layout=seriescolumn"
return pd.read_csv(url, header=5, index_col=0, names=['DATE', 'BC_10YEAR'],
parse_dates=True, converters={1: dataconverter},
squeeze=True)
|
python
|
def get_daily_10yr_treasury_data():
"""Download daily 10 year treasury rates from the Federal Reserve and
return a pandas.Series."""
url = "https://www.federalreserve.gov/datadownload/Output.aspx?rel=H15" \
"&series=bcb44e57fb57efbe90002369321bfb3f&lastObs=&from=&to=" \
"&filetype=csv&label=include&layout=seriescolumn"
return pd.read_csv(url, header=5, index_col=0, names=['DATE', 'BC_10YEAR'],
parse_dates=True, converters={1: dataconverter},
squeeze=True)
|
[
"def",
"get_daily_10yr_treasury_data",
"(",
")",
":",
"url",
"=",
"\"https://www.federalreserve.gov/datadownload/Output.aspx?rel=H15\"",
"\"&series=bcb44e57fb57efbe90002369321bfb3f&lastObs=&from=&to=\"",
"\"&filetype=csv&label=include&layout=seriescolumn\"",
"return",
"pd",
".",
"read_csv",
"(",
"url",
",",
"header",
"=",
"5",
",",
"index_col",
"=",
"0",
",",
"names",
"=",
"[",
"'DATE'",
",",
"'BC_10YEAR'",
"]",
",",
"parse_dates",
"=",
"True",
",",
"converters",
"=",
"{",
"1",
":",
"dataconverter",
"}",
",",
"squeeze",
"=",
"True",
")"
] |
Download daily 10 year treasury rates from the Federal Reserve and
return a pandas.Series.
|
[
"Download",
"daily",
"10",
"year",
"treasury",
"rates",
"from",
"the",
"Federal",
"Reserve",
"and",
"return",
"a",
"pandas",
".",
"Series",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/treasuries.py#L93-L101
|
train
|
Download daily 10 year treasury rates from the Federal Reserve and
return a pandas. Series.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4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SM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b11010 + 0o125) + '\062' + chr(1708 - 1653), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(556 - 502) + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(0b100110 + 0o111) + chr(0b1100 + 0o45) + chr(0b1010 + 0o52) + chr(0b110010), 22108 - 22100), ehT0Px3KOsy9(chr(49 - 1) + chr(111) + chr(0b11101 + 0o25) + chr(0b101000 + 0o16) + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11000 + 0o32) + chr(0b110010) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(111) + '\066' + chr(0b10 + 0o56), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(214 - 165) + '\063' + chr(117 - 64), 49804 - 49796), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\157' + chr(0b100101 + 0o16) + '\x36' + chr(0b10000 + 0o43), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b11110 + 0o23) + '\x37' + chr(2269 - 2215), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + '\x30' + chr(0b10 + 0o64), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + chr(0b1 + 0o62) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2577 - 2526) + chr(1648 - 1593) + '\x31', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(54) + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(0b110111) + '\061', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(51) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b111101 + 0o62) + '\x37' + '\x36', 27097 - 27089), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + chr(0b110011) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + chr(51) + chr(54) + chr(1935 - 1880), 4866 - 4858), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(0b10101 + 0o36), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2586 - 2535) + '\063' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\157' + chr(51) + chr(0b110111) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(111) + chr(0b11001 + 0o30) + '\066' + '\x32', 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(54) + '\x31', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1001011 + 0o44) + chr(0b110101) + chr(2258 - 2205), 8329 - 8321), ehT0Px3KOsy9('\x30' + chr(0b1100011 + 0o14) + chr(51) + chr(1608 - 1560) + chr(752 - 703), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011000 + 0o27) + chr(1275 - 1224) + '\065' + chr(2083 - 2028), 115 - 107), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(0b10 + 0o63) + chr(53), 13523 - 13515), ehT0Px3KOsy9(chr(1634 - 1586) + '\157' + chr(51) + chr(48) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11000 + 0o31) + '\065' + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(471 - 420) + chr(51) + chr(0b100011 + 0o17), 27297 - 27289), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(0b110010) + chr(0b10011 + 0o41) + chr(1398 - 1350), 3531 - 3523), ehT0Px3KOsy9('\060' + chr(11220 - 11109) + chr(49), 0b1000), ehT0Px3KOsy9(chr(753 - 705) + chr(0b1101111) + chr(1694 - 1644) + '\063' + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11011 + 0o124) + chr(0b100100 + 0o16) + chr(1876 - 1825) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(0b1100 + 0o50) + chr(0b110110), 51291 - 51283), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101011 + 0o6) + '\x36' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10110 + 0o131) + chr(0b110111) + chr(1307 - 1253), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(0b1111 + 0o43) + chr(2803 - 2749), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(783 - 672) + chr(803 - 753) + chr(1246 - 1192) + '\060', 43598 - 43590)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b10010 + 0o135) + '\065' + chr(1237 - 1189), 13040 - 13032)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'9'), chr(100) + chr(0b110 + 0o137) + chr(5267 - 5168) + '\x6f' + chr(8263 - 8163) + chr(101))('\x75' + chr(0b1110100) + '\x66' + chr(1861 - 1816) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def rF_zTsPsGzfG():
CYCr3xzMHl4K = xafqLlk3kkUe(SXOLrMavuUCe(b"\x7f\x06\x16\xc4\xe6\nr/\x84\t1u\x9f\x97\x9d=Lx\x9by\xba\x8e\x17\xc3[\xa4\xc1\n\xad\x1a\xf5\xc4`\xed\xf9\x82\x1aI\xb8\xdcx\x13\x06\x9b\xdaE)p\x86\nh:\x8a\x82\x81gL|\x9b6\x97\xccG\x97^\xa4\x9d\x04\xa7\x1f\xe7\xc2b\xfb\xac\xd2\x10\x0b\xe1\xd6uGU\xd1\xf3R89\xc3Nvi\xca\xc4\xc0k\x0c(\x95m\xbd\xce\x14\x97A\xa0\x9c\x19\x8d\x0e\xa9\x9d'\xff\xea\x89\x18\x03\xf0\xc4xOD\xd2\xfc\\8t\x8a\x0e#f\x9a\x81\x8f~Rx\x95n\xb3\xc0\x1b\xdfN\xad\x9a\t\xa7J\xb6\xc1x\xf6\xed\x92HM\xb3\xc2~\x17\x11\xd7\xfa\\(m\x9d"), chr(0b101000 + 0o74) + chr(9912 - 9811) + '\x63' + '\157' + chr(7931 - 7831) + chr(0b1000010 + 0o43))(chr(0b1010101 + 0o40) + '\x74' + chr(0b1100110) + '\x2d' + chr(56))
return xafqLlk3kkUe(dubtF9GfzOdC, xafqLlk3kkUe(SXOLrMavuUCe(b'e\x17\x03\xd0\xcaS.v'), chr(0b111110 + 0o46) + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\144' + chr(101))('\x75' + chr(6960 - 6844) + chr(0b100110 + 0o100) + '\055' + chr(0b111000)))(CYCr3xzMHl4K, header=ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001 + 0o4), ord("\x08")), index_col=ehT0Px3KOsy9('\060' + chr(0b1101111) + '\060', 8), names=[xafqLlk3kkUe(SXOLrMavuUCe(b'S36\xf1'), '\144' + chr(0b1011110 + 0o7) + chr(99) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(7871 - 7754) + chr(1426 - 1310) + '\x66' + chr(1066 - 1021) + chr(1501 - 1445)), xafqLlk3kkUe(SXOLrMavuUCe(b'U1=\x85\xa5i\x18A\xa1'), chr(3199 - 3099) + chr(692 - 591) + chr(0b1100011) + chr(2585 - 2474) + '\x64' + chr(101))(chr(10291 - 10174) + '\164' + chr(6413 - 6311) + '\055' + '\070')], parse_dates=ehT0Px3KOsy9('\x30' + '\157' + chr(1489 - 1440), 8), converters={ehT0Px3KOsy9('\x30' + '\x6f' + '\x31', 8): icIv8wSWGvm5}, squeeze=ehT0Px3KOsy9(chr(536 - 488) + chr(0b1111 + 0o140) + '\061', 8))
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
_sid_subdir_path
|
def _sid_subdir_path(sid):
"""
Format subdir path to limit the number directories in any given
subdirectory to 100.
The number in each directory is designed to support at least 100000
equities.
Parameters
----------
sid : int
Asset identifier.
Returns
-------
out : string
A path for the bcolz rootdir, including subdirectory prefixes based on
the padded string representation of the given sid.
e.g. 1 is formatted as 00/00/000001.bcolz
"""
padded_sid = format(sid, '06')
return os.path.join(
# subdir 1 00/XX
padded_sid[0:2],
# subdir 2 XX/00
padded_sid[2:4],
"{0}.bcolz".format(str(padded_sid))
)
|
python
|
def _sid_subdir_path(sid):
"""
Format subdir path to limit the number directories in any given
subdirectory to 100.
The number in each directory is designed to support at least 100000
equities.
Parameters
----------
sid : int
Asset identifier.
Returns
-------
out : string
A path for the bcolz rootdir, including subdirectory prefixes based on
the padded string representation of the given sid.
e.g. 1 is formatted as 00/00/000001.bcolz
"""
padded_sid = format(sid, '06')
return os.path.join(
# subdir 1 00/XX
padded_sid[0:2],
# subdir 2 XX/00
padded_sid[2:4],
"{0}.bcolz".format(str(padded_sid))
)
|
[
"def",
"_sid_subdir_path",
"(",
"sid",
")",
":",
"padded_sid",
"=",
"format",
"(",
"sid",
",",
"'06'",
")",
"return",
"os",
".",
"path",
".",
"join",
"(",
"# subdir 1 00/XX",
"padded_sid",
"[",
"0",
":",
"2",
"]",
",",
"# subdir 2 XX/00",
"padded_sid",
"[",
"2",
":",
"4",
"]",
",",
"\"{0}.bcolz\"",
".",
"format",
"(",
"str",
"(",
"padded_sid",
")",
")",
")"
] |
Format subdir path to limit the number directories in any given
subdirectory to 100.
The number in each directory is designed to support at least 100000
equities.
Parameters
----------
sid : int
Asset identifier.
Returns
-------
out : string
A path for the bcolz rootdir, including subdirectory prefixes based on
the padded string representation of the given sid.
e.g. 1 is formatted as 00/00/000001.bcolz
|
[
"Format",
"subdir",
"path",
"to",
"limit",
"the",
"number",
"directories",
"in",
"any",
"given",
"subdirectory",
"to",
"100",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L85-L113
|
train
|
Return a path to the bcolz subdirectory for the given sid.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLu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CViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(1647 - 1536) + '\x33' + chr(0b110100) + chr(2746 - 2691), ord("\x08")), ehT0Px3KOsy9(chr(1891 - 1843) + chr(1676 - 1565) + '\062' + chr(0b10000 + 0o45) + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(0b110000) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x34' + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + '\064' + chr(1132 - 1084), 7355 - 7347), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4187 - 4076) + chr(0b1010 + 0o51) + chr(0b110101) + '\x33', 0o10), ehT0Px3KOsy9(chr(2222 - 2174) + chr(8345 - 8234) + chr(0b110001) + '\x32' + chr(51), 40883 - 40875), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2420 - 2369) + chr(0b110000) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101100 + 0o7) + chr(1126 - 1071) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(592 - 481) + '\061' + chr(0b110010) + chr(0b110011 + 0o3), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1 + 0o62) + chr(0b10110 + 0o32) + '\x33', 8), ehT0Px3KOsy9(chr(897 - 849) + '\x6f' + '\x31' + chr(55) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + '\066' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(1009 - 961) + '\157' + '\067' + chr(2161 - 2111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6031 - 5920) + chr(0b110001) + '\x36' + '\x30', 0o10), ehT0Px3KOsy9(chr(1053 - 1005) + chr(9941 - 9830) + '\066' + chr(1386 - 1333), 0o10), ehT0Px3KOsy9('\060' + chr(3320 - 3209) + '\x33' + '\x33' + chr(2146 - 2094), ord("\x08")), ehT0Px3KOsy9(chr(2042 - 1994) + chr(0b1000 + 0o147) + chr(0b110011) + '\x34' + chr(48), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10010 + 0o40) + '\x32' + chr(50), 35313 - 35305), ehT0Px3KOsy9(chr(330 - 282) + '\157' + chr(0b110011) + chr(0b11110 + 0o22) + chr(51), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b101010 + 0o105) + chr(0b100111 + 0o13) + chr(0b11101 + 0o26) + '\060', 42485 - 42477), ehT0Px3KOsy9(chr(0b110000) + chr(0b0 + 0o157) + '\061' + chr(1936 - 1886) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + '\x36' + '\067', 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1011100 + 0o23) + chr(0b110011) + chr(1316 - 1266) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + chr(765 - 654) + '\x33' + chr(576 - 528) + chr(0b110101), 8), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(0b101111 + 0o3) + '\060' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + '\063' + chr(0b0 + 0o63) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(494 - 383) + chr(441 - 392) + '\x36' + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\066' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(55) + '\x36', 34136 - 34128), ehT0Px3KOsy9(chr(1067 - 1019) + '\157' + chr(0b100010 + 0o21) + chr(1793 - 1738) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(4955 - 4844) + chr(49) + chr(0b110001) + '\061', 0b1000), ehT0Px3KOsy9(chr(1078 - 1030) + '\157' + '\x32' + '\x36' + chr(0b101100 + 0o7), 6813 - 6805), ehT0Px3KOsy9('\060' + chr(0b101 + 0o152) + chr(0b110011) + '\061' + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(48) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b111101 + 0o62) + '\x31' + '\063' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x32' + '\x30' + chr(0b11110 + 0o30), 3963 - 3955), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\067' + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(1102 - 1052) + chr(1025 - 974) + chr(50), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(1240 - 1129) + chr(0b11111 + 0o26) + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9'), chr(100) + '\x65' + '\x63' + chr(0b1101111) + '\144' + chr(101))('\x75' + chr(116) + chr(9274 - 9172) + '\x2d' + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Ze4NUI7x7Gk_(Cli4Sf5HnGOS):
mBH5wLNNJt7r = V4roHaS3Ppej(Cli4Sf5HnGOS, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd7\x9b'), chr(0b101111 + 0o65) + chr(0b1101 + 0o130) + chr(0b1011010 + 0o11) + chr(9555 - 9444) + chr(0b1100100) + '\145')(chr(13274 - 13157) + chr(2807 - 2691) + chr(0b1100110) + '\055' + chr(0b111000)))
return xafqLlk3kkUe(oqhJDdMJfuwx.path, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8\xc2\x94\x7f\x1a`\xbd\x1d\xab\x8b\x1e\x85'), chr(7601 - 7501) + chr(0b110111 + 0o56) + '\143' + chr(0b1011101 + 0o22) + chr(100) + chr(101))(chr(117) + chr(3975 - 3859) + chr(0b1011111 + 0o7) + chr(0b10000 + 0o35) + '\x38'))(mBH5wLNNJt7r[ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\157' + chr(48), 0o10):ehT0Px3KOsy9(chr(48) + chr(0b1100001 + 0o16) + chr(0b1011 + 0o47), 54317 - 54309)], mBH5wLNNJt7r[ehT0Px3KOsy9(chr(48) + chr(0b1000011 + 0o54) + '\062', 8):ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110100), 0b1000)], xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x9c\x9d\xbe\t\x02w\x84?\xbf'), chr(0b1100100) + chr(9662 - 9561) + chr(4078 - 3979) + chr(0b1101101 + 0o2) + chr(0b1010 + 0o132) + '\x65')(chr(12733 - 12616) + '\x74' + chr(0b110000 + 0o66) + '\055' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\x99\xb1H(u\xb8`\x95\x8a3\xa9'), '\x64' + '\x65' + chr(99) + chr(3055 - 2944) + chr(0b101111 + 0o65) + '\x65')('\165' + chr(116) + '\146' + chr(0b101101) + '\x38'))(M8_cKLkHVB2V(mBH5wLNNJt7r)))
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
convert_cols
|
def convert_cols(cols, scale_factor, sid, invalid_data_behavior):
"""Adapt OHLCV columns into uint32 columns.
Parameters
----------
cols : dict
A dict mapping each column name (open, high, low, close, volume)
to a float column to convert to uint32.
scale_factor : int
Factor to use to scale float values before converting to uint32.
sid : int
Sid of the relevant asset, for logging.
invalid_data_behavior : str
Specifies behavior when data cannot be converted to uint32.
If 'raise', raises an exception.
If 'warn', logs a warning and filters out incompatible values.
If 'ignore', silently filters out incompatible values.
"""
scaled_opens = (np.nan_to_num(cols['open']) * scale_factor).round()
scaled_highs = (np.nan_to_num(cols['high']) * scale_factor).round()
scaled_lows = (np.nan_to_num(cols['low']) * scale_factor).round()
scaled_closes = (np.nan_to_num(cols['close']) * scale_factor).round()
exclude_mask = np.zeros_like(scaled_opens, dtype=bool)
for col_name, scaled_col in [
('open', scaled_opens),
('high', scaled_highs),
('low', scaled_lows),
('close', scaled_closes),
]:
max_val = scaled_col.max()
try:
check_uint32_safe(max_val, col_name)
except ValueError:
if invalid_data_behavior == 'raise':
raise
if invalid_data_behavior == 'warn':
logger.warn(
'Values for sid={}, col={} contain some too large for '
'uint32 (max={}), filtering them out',
sid, col_name, max_val,
)
# We want to exclude all rows that have an unsafe value in
# this column.
exclude_mask &= (scaled_col >= np.iinfo(np.uint32).max)
# Convert all cols to uint32.
opens = scaled_opens.astype(np.uint32)
highs = scaled_highs.astype(np.uint32)
lows = scaled_lows.astype(np.uint32)
closes = scaled_closes.astype(np.uint32)
volumes = cols['volume'].astype(np.uint32)
# Exclude rows with unsafe values by setting to zero.
opens[exclude_mask] = 0
highs[exclude_mask] = 0
lows[exclude_mask] = 0
closes[exclude_mask] = 0
volumes[exclude_mask] = 0
return opens, highs, lows, closes, volumes
|
python
|
def convert_cols(cols, scale_factor, sid, invalid_data_behavior):
"""Adapt OHLCV columns into uint32 columns.
Parameters
----------
cols : dict
A dict mapping each column name (open, high, low, close, volume)
to a float column to convert to uint32.
scale_factor : int
Factor to use to scale float values before converting to uint32.
sid : int
Sid of the relevant asset, for logging.
invalid_data_behavior : str
Specifies behavior when data cannot be converted to uint32.
If 'raise', raises an exception.
If 'warn', logs a warning and filters out incompatible values.
If 'ignore', silently filters out incompatible values.
"""
scaled_opens = (np.nan_to_num(cols['open']) * scale_factor).round()
scaled_highs = (np.nan_to_num(cols['high']) * scale_factor).round()
scaled_lows = (np.nan_to_num(cols['low']) * scale_factor).round()
scaled_closes = (np.nan_to_num(cols['close']) * scale_factor).round()
exclude_mask = np.zeros_like(scaled_opens, dtype=bool)
for col_name, scaled_col in [
('open', scaled_opens),
('high', scaled_highs),
('low', scaled_lows),
('close', scaled_closes),
]:
max_val = scaled_col.max()
try:
check_uint32_safe(max_val, col_name)
except ValueError:
if invalid_data_behavior == 'raise':
raise
if invalid_data_behavior == 'warn':
logger.warn(
'Values for sid={}, col={} contain some too large for '
'uint32 (max={}), filtering them out',
sid, col_name, max_val,
)
# We want to exclude all rows that have an unsafe value in
# this column.
exclude_mask &= (scaled_col >= np.iinfo(np.uint32).max)
# Convert all cols to uint32.
opens = scaled_opens.astype(np.uint32)
highs = scaled_highs.astype(np.uint32)
lows = scaled_lows.astype(np.uint32)
closes = scaled_closes.astype(np.uint32)
volumes = cols['volume'].astype(np.uint32)
# Exclude rows with unsafe values by setting to zero.
opens[exclude_mask] = 0
highs[exclude_mask] = 0
lows[exclude_mask] = 0
closes[exclude_mask] = 0
volumes[exclude_mask] = 0
return opens, highs, lows, closes, volumes
|
[
"def",
"convert_cols",
"(",
"cols",
",",
"scale_factor",
",",
"sid",
",",
"invalid_data_behavior",
")",
":",
"scaled_opens",
"=",
"(",
"np",
".",
"nan_to_num",
"(",
"cols",
"[",
"'open'",
"]",
")",
"*",
"scale_factor",
")",
".",
"round",
"(",
")",
"scaled_highs",
"=",
"(",
"np",
".",
"nan_to_num",
"(",
"cols",
"[",
"'high'",
"]",
")",
"*",
"scale_factor",
")",
".",
"round",
"(",
")",
"scaled_lows",
"=",
"(",
"np",
".",
"nan_to_num",
"(",
"cols",
"[",
"'low'",
"]",
")",
"*",
"scale_factor",
")",
".",
"round",
"(",
")",
"scaled_closes",
"=",
"(",
"np",
".",
"nan_to_num",
"(",
"cols",
"[",
"'close'",
"]",
")",
"*",
"scale_factor",
")",
".",
"round",
"(",
")",
"exclude_mask",
"=",
"np",
".",
"zeros_like",
"(",
"scaled_opens",
",",
"dtype",
"=",
"bool",
")",
"for",
"col_name",
",",
"scaled_col",
"in",
"[",
"(",
"'open'",
",",
"scaled_opens",
")",
",",
"(",
"'high'",
",",
"scaled_highs",
")",
",",
"(",
"'low'",
",",
"scaled_lows",
")",
",",
"(",
"'close'",
",",
"scaled_closes",
")",
",",
"]",
":",
"max_val",
"=",
"scaled_col",
".",
"max",
"(",
")",
"try",
":",
"check_uint32_safe",
"(",
"max_val",
",",
"col_name",
")",
"except",
"ValueError",
":",
"if",
"invalid_data_behavior",
"==",
"'raise'",
":",
"raise",
"if",
"invalid_data_behavior",
"==",
"'warn'",
":",
"logger",
".",
"warn",
"(",
"'Values for sid={}, col={} contain some too large for '",
"'uint32 (max={}), filtering them out'",
",",
"sid",
",",
"col_name",
",",
"max_val",
",",
")",
"# We want to exclude all rows that have an unsafe value in",
"# this column.",
"exclude_mask",
"&=",
"(",
"scaled_col",
">=",
"np",
".",
"iinfo",
"(",
"np",
".",
"uint32",
")",
".",
"max",
")",
"# Convert all cols to uint32.",
"opens",
"=",
"scaled_opens",
".",
"astype",
"(",
"np",
".",
"uint32",
")",
"highs",
"=",
"scaled_highs",
".",
"astype",
"(",
"np",
".",
"uint32",
")",
"lows",
"=",
"scaled_lows",
".",
"astype",
"(",
"np",
".",
"uint32",
")",
"closes",
"=",
"scaled_closes",
".",
"astype",
"(",
"np",
".",
"uint32",
")",
"volumes",
"=",
"cols",
"[",
"'volume'",
"]",
".",
"astype",
"(",
"np",
".",
"uint32",
")",
"# Exclude rows with unsafe values by setting to zero.",
"opens",
"[",
"exclude_mask",
"]",
"=",
"0",
"highs",
"[",
"exclude_mask",
"]",
"=",
"0",
"lows",
"[",
"exclude_mask",
"]",
"=",
"0",
"closes",
"[",
"exclude_mask",
"]",
"=",
"0",
"volumes",
"[",
"exclude_mask",
"]",
"=",
"0",
"return",
"opens",
",",
"highs",
",",
"lows",
",",
"closes",
",",
"volumes"
] |
Adapt OHLCV columns into uint32 columns.
Parameters
----------
cols : dict
A dict mapping each column name (open, high, low, close, volume)
to a float column to convert to uint32.
scale_factor : int
Factor to use to scale float values before converting to uint32.
sid : int
Sid of the relevant asset, for logging.
invalid_data_behavior : str
Specifies behavior when data cannot be converted to uint32.
If 'raise', raises an exception.
If 'warn', logs a warning and filters out incompatible values.
If 'ignore', silently filters out incompatible values.
|
[
"Adapt",
"OHLCV",
"columns",
"into",
"uint32",
"columns",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L116-L180
|
train
|
Adapt OHLCV columns into uint32 columns.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,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1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2203 - 2148) + chr(0b11111 + 0o25), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(996 - 941) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10101 + 0o34) + chr(0b11000 + 0o31) + chr(299 - 251), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(0b11111 + 0o23) + chr(2236 - 2186), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(708 - 657) + chr(0b110111) + '\062', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1767 - 1718) + chr(49) + chr(0b110100), 62975 - 62967), ehT0Px3KOsy9(chr(1750 - 1702) + '\x6f' + '\x31' + chr(1771 - 1720), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11010 + 0o27) + '\x37' + chr(0b10000 + 0o44), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(5502 - 5391) + '\066' + chr(0b1111 + 0o43), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1307 - 1258) + chr(55) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(966 - 918) + chr(12232 - 12121) + chr(0b110011 + 0o0) + '\x31' + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(2351 - 2296) + chr(1324 - 1269), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2162 - 2112) + chr(0b110000) + '\065', 30155 - 30147), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1101100 + 0o3) + chr(0b1101 + 0o46) + '\067' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(835 - 787) + chr(0b101000 + 0o107) + chr(2015 - 1966) + '\x32' + chr(48), 0o10), ehT0Px3KOsy9(chr(1733 - 1685) + chr(205 - 94) + chr(53) + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + chr(1657 - 1604) + chr(1137 - 1089), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(2702 - 2591) + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + '\x37' + chr(0b1000 + 0o53), ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\x6f' + chr(0b10101 + 0o36) + chr(0b110100) + chr(1840 - 1792), 0o10), ehT0Px3KOsy9('\060' + chr(490 - 379) + '\061' + chr(0b1101 + 0o43) + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(0b101011 + 0o14) + chr(2247 - 2199), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + '\063' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1010 + 0o54) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(543 - 495) + chr(0b1101111) + '\061' + '\065' + chr(0b10100 + 0o40), 47675 - 47667), ehT0Px3KOsy9(chr(140 - 92) + chr(4402 - 4291) + '\067' + chr(0b110101), 8276 - 8268), ehT0Px3KOsy9(chr(1397 - 1349) + chr(111) + chr(0b110010) + chr(446 - 394) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(368 - 257) + chr(587 - 538) + chr(0b110001 + 0o6) + chr(0b110000), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + '\x31' + '\x32', 0b1000), ehT0Px3KOsy9(chr(1227 - 1179) + chr(9451 - 9340) + chr(0b100100 + 0o15) + '\x30' + chr(0b110011), 3934 - 3926), ehT0Px3KOsy9(chr(998 - 950) + '\x6f' + '\064' + chr(53), 45109 - 45101), ehT0Px3KOsy9(chr(48) + chr(0b1101100 + 0o3) + chr(50) + chr(54), 28473 - 28465), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + chr(975 - 925) + chr(55) + chr(957 - 907), 35384 - 35376), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\x6f' + chr(0b110101) + chr(0b110000 + 0o7), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(111) + chr(0b110011) + '\063' + '\x30', 5791 - 5783), ehT0Px3KOsy9('\060' + chr(4047 - 3936) + chr(2405 - 2350) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + '\062' + chr(1845 - 1794) + chr(50), 58369 - 58361), ehT0Px3KOsy9('\x30' + chr(4171 - 4060) + chr(0b110001) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1284 - 1233) + '\x35' + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(52) + chr(0b110101), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + chr(731 - 678) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x12'), chr(0b111111 + 0o45) + chr(101) + chr(99) + chr(8922 - 8811) + chr(0b101101 + 0o67) + chr(0b11100 + 0o111))(chr(1367 - 1250) + chr(0b1011100 + 0o30) + '\146' + chr(0b101101) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def _Hy_Io2AL3wE(AIgvIWQd9onz, dThZv5GPT3D8, Cli4Sf5HnGOS, cR28UAwBtSml):
O3CHB6Fl5VQg = (WqUC3KWvYVup.nan_to_num(AIgvIWQd9onz[xafqLlk3kkUe(SXOLrMavuUCe(b'S\xce-\xfc'), chr(0b1100100) + chr(101) + '\x63' + '\x6f' + chr(100) + chr(0b1001101 + 0o30))(chr(0b1110101) + chr(7656 - 7540) + '\x66' + chr(1158 - 1113) + '\070')]) * dThZv5GPT3D8).round()
iGI6KMqjZPp9 = (WqUC3KWvYVup.nan_to_num(AIgvIWQd9onz[xafqLlk3kkUe(SXOLrMavuUCe(b'T\xd7/\xfa'), chr(0b1011101 + 0o7) + chr(0b1100101) + '\x63' + chr(111) + chr(100) + chr(101))(chr(117) + '\164' + chr(0b11 + 0o143) + chr(0b10000 + 0o35) + '\070')]) * dThZv5GPT3D8).round()
vN2G8HkKwPne = (WqUC3KWvYVup.nan_to_num(AIgvIWQd9onz[xafqLlk3kkUe(SXOLrMavuUCe(b'P\xd1?'), chr(100) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(3115 - 3015) + chr(0b1100101))(chr(0b1110 + 0o147) + chr(116) + chr(102) + chr(0b101011 + 0o2) + chr(0b111000))]) * dThZv5GPT3D8).round()
VyqVWRwgwfoA = (WqUC3KWvYVup.nan_to_num(AIgvIWQd9onz[xafqLlk3kkUe(SXOLrMavuUCe(b"_\xd2'\xe1\x9f"), chr(100) + '\x65' + chr(0b1100011) + '\x6f' + '\x64' + chr(0b111 + 0o136))('\x75' + '\164' + '\x66' + chr(1439 - 1394) + '\070')]) * dThZv5GPT3D8).round()
dOkKnXjLrlsK = WqUC3KWvYVup.zeros_like(O3CHB6Fl5VQg, dtype=WbBjf8Y7v9VN)
for (W93rymQCbozJ, hf8L0OMReOoW) in [(xafqLlk3kkUe(SXOLrMavuUCe(b'S\xce-\xfc'), chr(100) + chr(0b100001 + 0o104) + chr(3715 - 3616) + chr(0b1101111) + chr(3847 - 3747) + chr(0b1000011 + 0o42))('\x75' + '\x74' + chr(6348 - 6246) + '\x2d' + chr(1037 - 981)), O3CHB6Fl5VQg), (xafqLlk3kkUe(SXOLrMavuUCe(b'T\xd7/\xfa'), chr(100) + chr(0b1100 + 0o131) + chr(99) + chr(111) + chr(100) + '\145')('\165' + chr(116) + chr(0b1 + 0o145) + '\055' + chr(0b111000)), iGI6KMqjZPp9), (xafqLlk3kkUe(SXOLrMavuUCe(b'P\xd1?'), chr(0b100111 + 0o75) + chr(101) + '\x63' + chr(111) + '\x64' + chr(0b11001 + 0o114))('\165' + chr(0b1110100) + '\146' + chr(45) + '\x38'), vN2G8HkKwPne), (xafqLlk3kkUe(SXOLrMavuUCe(b"_\xd2'\xe1\x9f"), chr(232 - 132) + chr(101) + chr(4175 - 4076) + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(116) + '\x66' + '\x2d' + chr(56)), VyqVWRwgwfoA)]:
VnEEVinV1no4 = hf8L0OMReOoW.tsdjvlgh9gDP()
try:
pW2Nh3b8eYMg(VnEEVinV1no4, W93rymQCbozJ)
except q1QCh3W88sgk:
if cR28UAwBtSml == xafqLlk3kkUe(SXOLrMavuUCe(b'N\xdf!\xe1\x9f'), chr(0b1100100) + chr(3457 - 3356) + '\143' + '\157' + '\144' + '\145')(chr(0b1101001 + 0o14) + '\x74' + chr(0b1000111 + 0o37) + '\055' + '\070'):
raise
if cR28UAwBtSml == xafqLlk3kkUe(SXOLrMavuUCe(b'K\xdf:\xfc'), chr(100) + chr(101) + '\143' + chr(0b1101111) + chr(100) + '\145')('\165' + chr(0b1001100 + 0o50) + chr(102) + chr(0b101101) + '\070'):
xafqLlk3kkUe(hdK8qOUhR6Or, xafqLlk3kkUe(SXOLrMavuUCe(b'R\xfa\r\xfc\xb4\x0ej\x1et6\x85\x12'), '\x64' + chr(101) + chr(0b1100011) + '\x6f' + '\144' + chr(0b10101 + 0o120))(chr(0b1110101) + '\x74' + '\146' + chr(0b10 + 0o53) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'j\xdf$\xe7\x9f?+\x1a]\n\xee\x0c\xec\x99mVU-[\x83)\xd4\xa4O\x11\x1d\xc3\x17\xa47D\x7f\xd4\x0f\xabW\xf7h\xc9QS\xd1h\xfe\x9b>l\x19\x12\x1e\xa1\r\xa5\x889C\\2I\xc0n\xd5\xf8LQF\xddQ\xe6cC\x7f\xd6[\xbdJ\xf3c\x8e\x05H\xd6-\xff\xda#~\x08'), '\144' + chr(0b1001000 + 0o35) + chr(99) + chr(0b1101111) + '\144' + chr(5289 - 5188))(chr(117) + chr(379 - 263) + '\x66' + chr(1979 - 1934) + chr(296 - 240)), Cli4Sf5HnGOS, W93rymQCbozJ, VnEEVinV1no4)
dOkKnXjLrlsK &= hf8L0OMReOoW >= WqUC3KWvYVup.iinfo(WqUC3KWvYVup.uint32).tsdjvlgh9gDP
GoNRRmYhmnXW = O3CHB6Fl5VQg.astype(WqUC3KWvYVup.uint32)
qXC8hTZjOSkR = iGI6KMqjZPp9.astype(WqUC3KWvYVup.uint32)
jcS6CR2X9kjt = vN2G8HkKwPne.astype(WqUC3KWvYVup.uint32)
qJbm8AZRdNAI = VyqVWRwgwfoA.astype(WqUC3KWvYVup.uint32)
cK3zzJjiBNev = AIgvIWQd9onz[xafqLlk3kkUe(SXOLrMavuUCe(b'J\xd1$\xe7\x97)'), '\x64' + chr(0b1100101) + chr(99) + chr(9016 - 8905) + chr(0b1100100) + chr(0b1011011 + 0o12))('\x75' + chr(11638 - 11522) + '\x66' + chr(0b101101) + chr(0b111000))].astype(WqUC3KWvYVup.uint32)
GoNRRmYhmnXW[dOkKnXjLrlsK] = ehT0Px3KOsy9('\060' + chr(3542 - 3431) + chr(1053 - 1005), ord("\x08"))
qXC8hTZjOSkR[dOkKnXjLrlsK] = ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x30', 8)
jcS6CR2X9kjt[dOkKnXjLrlsK] = ehT0Px3KOsy9(chr(267 - 219) + '\157' + chr(0b110000), 8)
qJbm8AZRdNAI[dOkKnXjLrlsK] = ehT0Px3KOsy9('\x30' + chr(0b10111 + 0o130) + chr(0b110000), 8)
cK3zzJjiBNev[dOkKnXjLrlsK] = ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2006 - 1958), 8)
return (GoNRRmYhmnXW, qXC8hTZjOSkR, jcS6CR2X9kjt, qJbm8AZRdNAI, cK3zzJjiBNev)
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarMetadata.write
|
def write(self, rootdir):
"""
Write the metadata to a JSON file in the rootdir.
Values contained in the metadata are:
version : int
The value of FORMAT_VERSION of this class.
ohlc_ratio : int
The default ratio by which to multiply the pricing data to
convert the floats from floats to an integer to fit within
the np.uint32. If ohlc_ratios_per_sid is None or does not
contain a mapping for a given sid, this ratio is used.
ohlc_ratios_per_sid : dict
A dict mapping each sid in the output to the factor by
which the pricing data is multiplied so that the float data
can be stored as an integer.
minutes_per_day : int
The number of minutes per each period.
calendar_name : str
The name of the TradingCalendar on which the minute bars are
based.
start_session : datetime
'YYYY-MM-DD' formatted representation of the first trading
session in the data set.
end_session : datetime
'YYYY-MM-DD' formatted representation of the last trading
session in the data set.
Deprecated, but included for backwards compatibility:
first_trading_day : string
'YYYY-MM-DD' formatted representation of the first trading day
available in the dataset.
market_opens : list
List of int64 values representing UTC market opens as
minutes since epoch.
market_closes : list
List of int64 values representing UTC market closes as
minutes since epoch.
"""
calendar = self.calendar
slicer = calendar.schedule.index.slice_indexer(
self.start_session,
self.end_session,
)
schedule = calendar.schedule[slicer]
market_opens = schedule.market_open
market_closes = schedule.market_close
metadata = {
'version': self.version,
'ohlc_ratio': self.default_ohlc_ratio,
'ohlc_ratios_per_sid': self.ohlc_ratios_per_sid,
'minutes_per_day': self.minutes_per_day,
'calendar_name': self.calendar.name,
'start_session': str(self.start_session.date()),
'end_session': str(self.end_session.date()),
# Write these values for backwards compatibility
'first_trading_day': str(self.start_session.date()),
'market_opens': (
market_opens.values.astype('datetime64[m]').
astype(np.int64).tolist()),
'market_closes': (
market_closes.values.astype('datetime64[m]').
astype(np.int64).tolist()),
}
with open(self.metadata_path(rootdir), 'w+') as fp:
json.dump(metadata, fp)
|
python
|
def write(self, rootdir):
"""
Write the metadata to a JSON file in the rootdir.
Values contained in the metadata are:
version : int
The value of FORMAT_VERSION of this class.
ohlc_ratio : int
The default ratio by which to multiply the pricing data to
convert the floats from floats to an integer to fit within
the np.uint32. If ohlc_ratios_per_sid is None or does not
contain a mapping for a given sid, this ratio is used.
ohlc_ratios_per_sid : dict
A dict mapping each sid in the output to the factor by
which the pricing data is multiplied so that the float data
can be stored as an integer.
minutes_per_day : int
The number of minutes per each period.
calendar_name : str
The name of the TradingCalendar on which the minute bars are
based.
start_session : datetime
'YYYY-MM-DD' formatted representation of the first trading
session in the data set.
end_session : datetime
'YYYY-MM-DD' formatted representation of the last trading
session in the data set.
Deprecated, but included for backwards compatibility:
first_trading_day : string
'YYYY-MM-DD' formatted representation of the first trading day
available in the dataset.
market_opens : list
List of int64 values representing UTC market opens as
minutes since epoch.
market_closes : list
List of int64 values representing UTC market closes as
minutes since epoch.
"""
calendar = self.calendar
slicer = calendar.schedule.index.slice_indexer(
self.start_session,
self.end_session,
)
schedule = calendar.schedule[slicer]
market_opens = schedule.market_open
market_closes = schedule.market_close
metadata = {
'version': self.version,
'ohlc_ratio': self.default_ohlc_ratio,
'ohlc_ratios_per_sid': self.ohlc_ratios_per_sid,
'minutes_per_day': self.minutes_per_day,
'calendar_name': self.calendar.name,
'start_session': str(self.start_session.date()),
'end_session': str(self.end_session.date()),
# Write these values for backwards compatibility
'first_trading_day': str(self.start_session.date()),
'market_opens': (
market_opens.values.astype('datetime64[m]').
astype(np.int64).tolist()),
'market_closes': (
market_closes.values.astype('datetime64[m]').
astype(np.int64).tolist()),
}
with open(self.metadata_path(rootdir), 'w+') as fp:
json.dump(metadata, fp)
|
[
"def",
"write",
"(",
"self",
",",
"rootdir",
")",
":",
"calendar",
"=",
"self",
".",
"calendar",
"slicer",
"=",
"calendar",
".",
"schedule",
".",
"index",
".",
"slice_indexer",
"(",
"self",
".",
"start_session",
",",
"self",
".",
"end_session",
",",
")",
"schedule",
"=",
"calendar",
".",
"schedule",
"[",
"slicer",
"]",
"market_opens",
"=",
"schedule",
".",
"market_open",
"market_closes",
"=",
"schedule",
".",
"market_close",
"metadata",
"=",
"{",
"'version'",
":",
"self",
".",
"version",
",",
"'ohlc_ratio'",
":",
"self",
".",
"default_ohlc_ratio",
",",
"'ohlc_ratios_per_sid'",
":",
"self",
".",
"ohlc_ratios_per_sid",
",",
"'minutes_per_day'",
":",
"self",
".",
"minutes_per_day",
",",
"'calendar_name'",
":",
"self",
".",
"calendar",
".",
"name",
",",
"'start_session'",
":",
"str",
"(",
"self",
".",
"start_session",
".",
"date",
"(",
")",
")",
",",
"'end_session'",
":",
"str",
"(",
"self",
".",
"end_session",
".",
"date",
"(",
")",
")",
",",
"# Write these values for backwards compatibility",
"'first_trading_day'",
":",
"str",
"(",
"self",
".",
"start_session",
".",
"date",
"(",
")",
")",
",",
"'market_opens'",
":",
"(",
"market_opens",
".",
"values",
".",
"astype",
"(",
"'datetime64[m]'",
")",
".",
"astype",
"(",
"np",
".",
"int64",
")",
".",
"tolist",
"(",
")",
")",
",",
"'market_closes'",
":",
"(",
"market_closes",
".",
"values",
".",
"astype",
"(",
"'datetime64[m]'",
")",
".",
"astype",
"(",
"np",
".",
"int64",
")",
".",
"tolist",
"(",
")",
")",
",",
"}",
"with",
"open",
"(",
"self",
".",
"metadata_path",
"(",
"rootdir",
")",
",",
"'w+'",
")",
"as",
"fp",
":",
"json",
".",
"dump",
"(",
"metadata",
",",
"fp",
")"
] |
Write the metadata to a JSON file in the rootdir.
Values contained in the metadata are:
version : int
The value of FORMAT_VERSION of this class.
ohlc_ratio : int
The default ratio by which to multiply the pricing data to
convert the floats from floats to an integer to fit within
the np.uint32. If ohlc_ratios_per_sid is None or does not
contain a mapping for a given sid, this ratio is used.
ohlc_ratios_per_sid : dict
A dict mapping each sid in the output to the factor by
which the pricing data is multiplied so that the float data
can be stored as an integer.
minutes_per_day : int
The number of minutes per each period.
calendar_name : str
The name of the TradingCalendar on which the minute bars are
based.
start_session : datetime
'YYYY-MM-DD' formatted representation of the first trading
session in the data set.
end_session : datetime
'YYYY-MM-DD' formatted representation of the last trading
session in the data set.
Deprecated, but included for backwards compatibility:
first_trading_day : string
'YYYY-MM-DD' formatted representation of the first trading day
available in the dataset.
market_opens : list
List of int64 values representing UTC market opens as
minutes since epoch.
market_closes : list
List of int64 values representing UTC market closes as
minutes since epoch.
|
[
"Write",
"the",
"metadata",
"to",
"a",
"JSON",
"file",
"in",
"the",
"rootdir",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L280-L349
|
train
|
Write the metadata to a JSON file in the rootdir.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5F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Otyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(236 - 125) + '\x33' + '\060' + '\060', 0b1000), ehT0Px3KOsy9('\060' + chr(0b11011 + 0o124) + '\063' + chr(0b110001) + chr(1450 - 1396), 10948 - 10940), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + '\x31' + chr(0b100001 + 0o25), 18220 - 18212), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b110110), 26309 - 26301), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + '\063' + '\x33' + chr(54), 41697 - 41689), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(5468 - 5357) + chr(0b101 + 0o55) + '\062' + chr(0b10110 + 0o41), 42360 - 42352), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(0b1100 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(1522 - 1474) + chr(0b100101 + 0o112) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\157' + '\062' + chr(0b101010 + 0o11) + chr(291 - 243), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11011 + 0o26) + chr(0b0 + 0o62) + chr(156 - 105), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\x37' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + chr(51) + '\067' + '\065', 1824 - 1816), ehT0Px3KOsy9(chr(1211 - 1163) + '\x6f' + '\065' + chr(0b100101 + 0o22), ord("\x08")), ehT0Px3KOsy9(chr(762 - 714) + chr(111) + chr(50) + '\x30' + '\060', 35261 - 35253), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + '\x32' + '\x30' + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + '\063' + chr(0b110000 + 0o0) + chr(1000 - 951), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1101 + 0o45) + chr(0b11101 + 0o25) + chr(0b101010 + 0o6), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b11101 + 0o24) + chr(0b10101 + 0o33) + chr(0b1111 + 0o45), 54797 - 54789), ehT0Px3KOsy9(chr(1936 - 1888) + chr(11121 - 11010) + chr(0b1110 + 0o43) + chr(0b110000) + chr(0b10011 + 0o43), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\064' + '\x36', 49511 - 49503), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\062' + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(0b110001) + '\x34', 0o10), ehT0Px3KOsy9(chr(428 - 380) + '\x6f' + '\062' + chr(0b101001 + 0o14), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\157' + '\x34' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(54) + '\x35', 0o10), ehT0Px3KOsy9(chr(826 - 778) + chr(0b1110 + 0o141) + chr(1005 - 952) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(0b110010) + '\063', 48788 - 48780), ehT0Px3KOsy9(chr(0b110000) + chr(11169 - 11058) + chr(0b110100) + chr(0b100011 + 0o16), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100101 + 0o112) + chr(169 - 119) + '\060', 29964 - 29956), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + chr(640 - 587) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(8597 - 8486) + chr(0b110100) + chr(955 - 905), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101101 + 0o2) + '\061' + chr(0b111 + 0o51) + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(52) + chr(79 - 26), 36406 - 36398), ehT0Px3KOsy9(chr(2162 - 2114) + chr(111) + chr(0b110010) + '\x35' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b110 + 0o151) + chr(0b101 + 0o56) + '\060' + chr(2053 - 2004), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b111 + 0o54) + chr(52) + '\x35', 0b1000), ehT0Px3KOsy9(chr(1619 - 1571) + chr(0b10 + 0o155) + chr(0b110010) + '\x32' + chr(0b101101 + 0o5), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(0b10011 + 0o36) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(111) + '\061' + chr(0b110000) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + '\x30' + chr(54), 21635 - 21627)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\065' + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xee'), '\x64' + chr(9708 - 9607) + '\x63' + '\x6f' + chr(0b10001 + 0o123) + chr(0b110 + 0o137))(chr(7818 - 7701) + chr(116) + chr(0b100100 + 0o102) + chr(0b1111 + 0o36) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def QywlqEoQilJa(oVre8I6UXc3b, EFoM8xiTBVL4):
poUKhjo0_BbB = oVre8I6UXc3b.calendar
OyGhpW4Gd1Jo = poUKhjo0_BbB.schedule.index.slice_indexer(oVre8I6UXc3b.start_session, oVre8I6UXc3b.end_session)
UAGQwjlXRoHO = poUKhjo0_BbB.UAGQwjlXRoHO[OyGhpW4Gd1Jo]
dksvNmte4BkF = UAGQwjlXRoHO.market_open
kdgrZToddo2_ = UAGQwjlXRoHO.market_close
mU7wOAGoTnlM = {xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6\xab\xfc}\xb7\xf8x'), chr(0b1100100) + chr(7518 - 7417) + chr(0b11011 + 0o110) + '\x6f' + chr(6254 - 6154) + '\x65')('\x75' + chr(0b1110100) + '\x66' + '\x2d' + chr(0b101111 + 0o11)): oVre8I6UXc3b.cpMfQ_4_Vb7C, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaf\xa6\xe2m\x81\xe5wr\xf1<'), chr(100) + chr(0b1100101) + chr(99) + '\157' + chr(100) + chr(8369 - 8268))('\165' + chr(116) + chr(0b1100110) + chr(45) + '\x38'): oVre8I6UXc3b.default_ohlc_ratio, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaf\xa6\xe2m\x81\xe5wr\xf1<K\xa2_\xe5\xf3\x9e\xe3-"'), '\x64' + '\145' + chr(99) + chr(111) + '\144' + chr(0b1100101))(chr(0b110010 + 0o103) + '\164' + '\146' + '\x2d' + chr(56)): oVre8I6UXc3b.ohlc_ratios_per_sid, xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xa7\xe0{\xaa\xf2eY\xe86J\xa2K\xe1\xf8'), '\144' + chr(101) + chr(99) + '\157' + chr(0b1100100) + chr(101))('\165' + chr(1405 - 1289) + '\146' + chr(666 - 621) + '\x38'): oVre8I6UXc3b.minutes_per_day, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3\xaf\xe2k\xb0\xf3wt\xc7=Y\x90J'), chr(4628 - 4528) + chr(101) + '\x63' + chr(111) + '\144' + chr(0b1100101))(chr(8792 - 8675) + chr(0b1110100) + '\146' + '\x2d' + chr(0b10010 + 0o46)): oVre8I6UXc3b.calendar.AIvJRzLdDfgF, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb3\xba\xef|\xaa\xc8ec\xeb Q\x92A'), '\x64' + chr(101) + '\x63' + chr(0b100000 + 0o117) + chr(100) + '\145')(chr(0b100100 + 0o121) + chr(0b1101 + 0o147) + '\146' + chr(534 - 489) + chr(56)): M8_cKLkHVB2V(oVre8I6UXc3b.start_session.date()), xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5\xa0\xeaQ\xad\xf2eu\xf1<V'), chr(0b1100100) + chr(0b101010 + 0o73) + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(5044 - 4943))(chr(117) + chr(0b1000111 + 0o55) + chr(102) + '\055' + chr(56)): M8_cKLkHVB2V(oVre8I6UXc3b.end_session.date()), xafqLlk3kkUe(SXOLrMavuUCe(b'\xa6\xa7\xfc}\xaa\xc8bt\xf97Q\x93H\xdf\xe5\xa0\xe9'), chr(0b1100010 + 0o2) + chr(0b1100101) + '\143' + '\x6f' + chr(0b11010 + 0o112) + '\x65')(chr(10256 - 10139) + chr(3051 - 2935) + chr(0b1011011 + 0o13) + '\x2d' + '\x38'): M8_cKLkHVB2V(oVre8I6UXc3b.start_session.date()), xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xaf\xfce\xbb\xe3Ii\xe86V\x8e'), '\x64' + chr(1826 - 1725) + chr(99) + chr(1877 - 1766) + chr(100) + '\x65')(chr(117) + chr(0b1101110 + 0o6) + chr(9054 - 8952) + chr(128 - 83) + '\x38'): dksvNmte4BkF.values.astype(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4\xaf\xfak\xaa\xfe{c\xaegc\x90r'), chr(0b1100100) + chr(101) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b1010001 + 0o24))(chr(3193 - 3076) + chr(116) + chr(8012 - 7910) + chr(869 - 824) + chr(2699 - 2643))).astype(WqUC3KWvYVup.int64).tolist(), xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xaf\xfce\xbb\xe3Ie\xf4<K\x98\\'), '\x64' + '\x65' + '\x63' + chr(0b1101111) + '\144' + chr(0b110 + 0o137))(chr(2677 - 2560) + '\x74' + chr(3320 - 3218) + chr(492 - 447) + '\070'): kdgrZToddo2_.values.astype(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4\xaf\xfak\xaa\xfe{c\xaegc\x90r'), chr(0b11101 + 0o107) + '\x65' + chr(1037 - 938) + '\157' + '\x64' + chr(0b1100101))('\x75' + '\x74' + '\x66' + chr(0b101101) + chr(56))).astype(WqUC3KWvYVup.int64).tolist()}
with _fwkIVCGgtAN(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xab\xfao\xba\xf6bg\xc7#Y\x89G'), '\144' + '\145' + chr(5783 - 5684) + chr(11536 - 11425) + chr(0b1100100) + '\x65')('\165' + chr(7592 - 7476) + chr(0b1010001 + 0o25) + '\055' + chr(2438 - 2382)))(EFoM8xiTBVL4), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7\xe5'), '\144' + chr(0b1010010 + 0o23) + chr(99) + '\157' + chr(0b1010010 + 0o22) + '\x65')(chr(8692 - 8575) + chr(0b1110100) + chr(6381 - 6279) + chr(0b101101) + chr(56))) as ey_P6rjw_s2D:
xafqLlk3kkUe(fXk443epxtd5, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4\xbb\xe3~'), chr(100) + '\145' + chr(0b100 + 0o137) + chr(0b1101111) + chr(1004 - 904) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b0 + 0o55) + chr(2294 - 2238)))(mU7wOAGoTnlM, ey_P6rjw_s2D)
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter.open
|
def open(cls, rootdir, end_session=None):
"""
Open an existing ``rootdir`` for writing.
Parameters
----------
end_session : Timestamp (optional)
When appending, the intended new ``end_session``.
"""
metadata = BcolzMinuteBarMetadata.read(rootdir)
return BcolzMinuteBarWriter(
rootdir,
metadata.calendar,
metadata.start_session,
end_session if end_session is not None else metadata.end_session,
metadata.minutes_per_day,
metadata.default_ohlc_ratio,
metadata.ohlc_ratios_per_sid,
write_metadata=end_session is not None
)
|
python
|
def open(cls, rootdir, end_session=None):
"""
Open an existing ``rootdir`` for writing.
Parameters
----------
end_session : Timestamp (optional)
When appending, the intended new ``end_session``.
"""
metadata = BcolzMinuteBarMetadata.read(rootdir)
return BcolzMinuteBarWriter(
rootdir,
metadata.calendar,
metadata.start_session,
end_session if end_session is not None else metadata.end_session,
metadata.minutes_per_day,
metadata.default_ohlc_ratio,
metadata.ohlc_ratios_per_sid,
write_metadata=end_session is not None
)
|
[
"def",
"open",
"(",
"cls",
",",
"rootdir",
",",
"end_session",
"=",
"None",
")",
":",
"metadata",
"=",
"BcolzMinuteBarMetadata",
".",
"read",
"(",
"rootdir",
")",
"return",
"BcolzMinuteBarWriter",
"(",
"rootdir",
",",
"metadata",
".",
"calendar",
",",
"metadata",
".",
"start_session",
",",
"end_session",
"if",
"end_session",
"is",
"not",
"None",
"else",
"metadata",
".",
"end_session",
",",
"metadata",
".",
"minutes_per_day",
",",
"metadata",
".",
"default_ohlc_ratio",
",",
"metadata",
".",
"ohlc_ratios_per_sid",
",",
"write_metadata",
"=",
"end_session",
"is",
"not",
"None",
")"
] |
Open an existing ``rootdir`` for writing.
Parameters
----------
end_session : Timestamp (optional)
When appending, the intended new ``end_session``.
|
[
"Open",
"an",
"existing",
"rootdir",
"for",
"writing",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L482-L501
|
train
|
Open an existing BcolzMinuteBarWriter for writing.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeX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M4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(2112 - 2064) + chr(0b10111 + 0o37), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + chr(48) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(1712 - 1662) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + '\067', 8), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b110111) + '\060', 0b1000), ehT0Px3KOsy9(chr(345 - 297) + chr(0b1101111) + chr(49) + '\x30' + chr(2168 - 2113), 0b1000), ehT0Px3KOsy9('\060' + chr(8597 - 8486) + chr(51) + chr(2014 - 1960) + chr(2159 - 2107), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + chr(49) + chr(49) + '\x32', 65077 - 65069), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + '\063' + chr(55) + chr(0b10001 + 0o42), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\064' + chr(0b0 + 0o64), 0o10), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(6827 - 6716) + chr(1323 - 1274) + chr(2581 - 2528) + chr(0b11101 + 0o27), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(0b10101 + 0o34), 60722 - 60714), ehT0Px3KOsy9(chr(1967 - 1919) + chr(0b1001101 + 0o42) + '\x32' + '\x32' + '\x35', 63958 - 63950), ehT0Px3KOsy9('\060' + chr(7515 - 7404) + chr(50) + '\063' + chr(0b11000 + 0o30), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(52) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110 + 0o61) + chr(0b110110), 7407 - 7399), ehT0Px3KOsy9(chr(48) + chr(0b1011000 + 0o27) + '\061' + chr(0b100000 + 0o20) + chr(0b0 + 0o62), ord("\x08")), ehT0Px3KOsy9('\060' + chr(5274 - 5163) + '\065' + chr(2568 - 2516), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(0b110110) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(53) + '\066', 20382 - 20374), ehT0Px3KOsy9(chr(634 - 586) + '\x6f' + chr(0b110001) + '\x36' + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + chr(10562 - 10451) + '\063' + chr(0b11001 + 0o31) + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(7242 - 7131) + '\062' + '\063' + '\x35', 0o10), ehT0Px3KOsy9(chr(569 - 521) + chr(0b1000001 + 0o56) + chr(0b10000 + 0o42) + chr(0b0 + 0o67) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + chr(0b101010 + 0o7) + chr(1210 - 1158) + chr(1915 - 1862), ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + chr(52) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(902 - 852) + '\062', 16727 - 16719), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(0b100000 + 0o26) + '\x34', 8), ehT0Px3KOsy9(chr(160 - 112) + '\157' + chr(51) + chr(48), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\062' + '\061', 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(739 - 689) + '\067' + chr(909 - 854), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(412 - 362) + '\x30', 8), ehT0Px3KOsy9(chr(48) + chr(9386 - 9275) + chr(0b10110 + 0o33) + chr(2366 - 2311) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10001 + 0o136) + '\x36' + chr(0b11000 + 0o32), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b100111 + 0o110) + '\062' + chr(52) + chr(1386 - 1338), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(1137 - 1086) + chr(0b10000 + 0o43) + chr(0b100010 + 0o21), 6804 - 6796), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(3742 - 3631) + '\061' + chr(1977 - 1923) + chr(0b110101), 33875 - 33867), ehT0Px3KOsy9('\060' + chr(111) + chr(122 - 72) + chr(50), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b0 + 0o62) + chr(960 - 905) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x33' + '\x34' + '\x31', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\065' + '\060', 31296 - 31288)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8'), chr(0b1100100) + '\x65' + chr(516 - 417) + '\x6f' + '\x64' + '\x65')('\165' + chr(116) + '\x66' + chr(0b101100 + 0o1) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def _fwkIVCGgtAN(NSstowUUZlxS, EFoM8xiTBVL4, qRfpaQSMkwXK=None):
mU7wOAGoTnlM = s5FpdwikV4nK.U6MiWrhuCi2Y(EFoM8xiTBVL4)
return m06khSrvkAab(EFoM8xiTBVL4, xafqLlk3kkUe(mU7wOAGoTnlM, xafqLlk3kkUe(SXOLrMavuUCe(b"\xe5'{r\x16#\x958"), chr(768 - 668) + chr(7780 - 7679) + '\143' + '\x6f' + chr(0b1100100) + chr(4367 - 4266))(chr(5748 - 5631) + chr(116) + chr(0b1010 + 0o134) + chr(45) + chr(56))), xafqLlk3kkUe(mU7wOAGoTnlM, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf52ve\x0c\x18\x87/\x88W\x05~\xfb'), chr(7197 - 7097) + chr(0b1010100 + 0o21) + chr(0b111010 + 0o51) + '\157' + '\x64' + '\x65')('\165' + chr(5886 - 5770) + '\x66' + chr(1245 - 1200) + chr(56))), qRfpaQSMkwXK if qRfpaQSMkwXK is not None else xafqLlk3kkUe(mU7wOAGoTnlM, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe3(sH\x0b"\x879\x92K\x02'), chr(100) + '\x65' + chr(9128 - 9029) + chr(111) + '\x64' + '\145')(chr(10174 - 10057) + '\x74' + chr(102) + chr(45) + '\x38')), xafqLlk3kkUe(mU7wOAGoTnlM, xafqLlk3kkUe(SXOLrMavuUCe(b'\xeb/yb\x0c"\x87\x15\x8bA\x1eN\xf1\xf9Z'), chr(0b10101 + 0o117) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(100) + chr(5943 - 5842))('\x75' + chr(11934 - 11818) + '\x66' + chr(0b100111 + 0o6) + chr(1688 - 1632))), xafqLlk3kkUe(mU7wOAGoTnlM, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2#qv\r+\x80\x15\x94L\x00r\xca\xeaBJ+C'), chr(0b111110 + 0o46) + chr(0b111101 + 0o50) + chr(0b1100011) + '\157' + '\144' + '\x65')('\165' + chr(2736 - 2620) + '\x66' + chr(0b100000 + 0o15) + chr(0b1001 + 0o57))), xafqLlk3kkUe(mU7wOAGoTnlM, xafqLlk3kkUe(SXOLrMavuUCe(b"\xe9.{t'5\x95>\x92K\x1fN\xe5\xfdQa1E\xd7"), chr(100) + '\145' + chr(888 - 789) + chr(111) + chr(100) + chr(0b10111 + 0o116))('\165' + chr(5124 - 5008) + '\x66' + '\x2d' + chr(0b101 + 0o63))), write_metadata=qRfpaQSMkwXK is not None)
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter.sidpath
|
def sidpath(self, sid):
"""
Parameters
----------
sid : int
Asset identifier.
Returns
-------
out : string
Full path to the bcolz rootdir for the given sid.
"""
sid_subdir = _sid_subdir_path(sid)
return join(self._rootdir, sid_subdir)
|
python
|
def sidpath(self, sid):
"""
Parameters
----------
sid : int
Asset identifier.
Returns
-------
out : string
Full path to the bcolz rootdir for the given sid.
"""
sid_subdir = _sid_subdir_path(sid)
return join(self._rootdir, sid_subdir)
|
[
"def",
"sidpath",
"(",
"self",
",",
"sid",
")",
":",
"sid_subdir",
"=",
"_sid_subdir_path",
"(",
"sid",
")",
"return",
"join",
"(",
"self",
".",
"_rootdir",
",",
"sid_subdir",
")"
] |
Parameters
----------
sid : int
Asset identifier.
Returns
-------
out : string
Full path to the bcolz rootdir for the given sid.
|
[
"Parameters",
"----------",
"sid",
":",
"int",
"Asset",
"identifier",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L518-L531
|
train
|
Returns the full path to the bcolz rootdir for the given asset identifier.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4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Q,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100100 + 0o16) + '\064' + chr(1453 - 1399), 44833 - 44825), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110100) + '\x33', 10172 - 10164), ehT0Px3KOsy9(chr(48) + chr(0b1001100 + 0o43) + chr(0b110011) + chr(122 - 71) + chr(0b110111), 30815 - 30807), ehT0Px3KOsy9(chr(48) + chr(11942 - 11831) + chr(0b1 + 0o60) + chr(0b10001 + 0o42) + chr(0b11100 + 0o24), 28979 - 28971), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(2089 - 1978) + chr(0b11101 + 0o25) + chr(0b101010 + 0o10), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + '\061' + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\066' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(1136 - 1083) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(0b110101) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(0b110110) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + chr(48) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\x37' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + '\063' + chr(0b110101) + chr(1086 - 1035), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(53) + '\066', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(48) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(3662 - 3551) + chr(49) + '\063' + '\x31', 37808 - 37800), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2259 - 2209) + chr(0b1010 + 0o54) + '\061', 13234 - 13226), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(0b100000 + 0o23) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1474 - 1425) + chr(0b110011) + chr(0b1111 + 0o47), 0o10), ehT0Px3KOsy9('\060' + chr(0b101100 + 0o103) + chr(0b110010) + '\061' + '\065', 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(0b100100 + 0o16) + chr(0b110101) + chr(481 - 427), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(1637 - 1584) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(1569 - 1521) + chr(7872 - 7761) + chr(0b11110 + 0o24) + '\x32' + chr(49), 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\157' + chr(0b110010) + '\x32' + chr(2380 - 2326), 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(5051 - 4940) + chr(53) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + '\067' + '\x30', 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(3677 - 3566) + chr(0b110011) + chr(0b110111) + chr(0b1010 + 0o50), ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1011011 + 0o24) + '\x32' + chr(1104 - 1051), 14003 - 13995), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + '\x36' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b10111 + 0o130) + chr(0b1011 + 0o50) + chr(51) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100110 + 0o11) + chr(49) + chr(0b10011 + 0o41) + '\x33', 3022 - 3014), ehT0Px3KOsy9('\x30' + chr(4147 - 4036) + chr(1741 - 1691) + chr(54) + chr(379 - 328), 0o10), ehT0Px3KOsy9(chr(470 - 422) + '\157' + chr(0b110010) + chr(275 - 224) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(2242 - 2194) + '\x6f' + chr(714 - 664) + chr(0b110001) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(54) + '\x34', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11100 + 0o27) + chr(1797 - 1747) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + '\x31' + '\064' + chr(0b11101 + 0o32), ord("\x08")), ehT0Px3KOsy9(chr(1039 - 991) + '\157' + chr(0b110010) + '\062' + chr(0b10110 + 0o33), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101100 + 0o3) + chr(1346 - 1295) + chr(0b111 + 0o55) + chr(0b110010), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x35' + chr(0b1100 + 0o44), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x88'), chr(0b1100100) + chr(9287 - 9186) + chr(0b100101 + 0o76) + chr(0b1101111) + chr(0b101111 + 0o65) + chr(8483 - 8382))(chr(0b10000 + 0o145) + '\164' + '\146' + chr(0b101101 + 0o0) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def NifI0GJjvvLR(oVre8I6UXc3b, Cli4Sf5HnGOS):
CrqaP1WsNUzu = Ze4NUI7x7Gk_(Cli4Sf5HnGOS)
return _oWXztVNnqHF(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9Q\xb07f.X\x9d'), chr(0b11001 + 0o113) + '\x65' + chr(0b1100011) + '\x6f' + '\144' + chr(0b10010 + 0o123))('\165' + '\x74' + chr(4000 - 3898) + chr(1706 - 1661) + '\x38')), CrqaP1WsNUzu)
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter.last_date_in_output_for_sid
|
def last_date_in_output_for_sid(self, sid):
"""
Parameters
----------
sid : int
Asset identifier.
Returns
-------
out : pd.Timestamp
The midnight of the last date written in to the output for the
given sid.
"""
sizes_path = "{0}/close/meta/sizes".format(self.sidpath(sid))
if not os.path.exists(sizes_path):
return pd.NaT
with open(sizes_path, mode='r') as f:
sizes = f.read()
data = json.loads(sizes)
# use integer division so that the result is an int
# for pandas index later https://github.com/pandas-dev/pandas/blob/master/pandas/tseries/base.py#L247 # noqa
num_days = data['shape'][0] // self._minutes_per_day
if num_days == 0:
# empty container
return pd.NaT
return self._session_labels[num_days - 1]
|
python
|
def last_date_in_output_for_sid(self, sid):
"""
Parameters
----------
sid : int
Asset identifier.
Returns
-------
out : pd.Timestamp
The midnight of the last date written in to the output for the
given sid.
"""
sizes_path = "{0}/close/meta/sizes".format(self.sidpath(sid))
if not os.path.exists(sizes_path):
return pd.NaT
with open(sizes_path, mode='r') as f:
sizes = f.read()
data = json.loads(sizes)
# use integer division so that the result is an int
# for pandas index later https://github.com/pandas-dev/pandas/blob/master/pandas/tseries/base.py#L247 # noqa
num_days = data['shape'][0] // self._minutes_per_day
if num_days == 0:
# empty container
return pd.NaT
return self._session_labels[num_days - 1]
|
[
"def",
"last_date_in_output_for_sid",
"(",
"self",
",",
"sid",
")",
":",
"sizes_path",
"=",
"\"{0}/close/meta/sizes\"",
".",
"format",
"(",
"self",
".",
"sidpath",
"(",
"sid",
")",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"sizes_path",
")",
":",
"return",
"pd",
".",
"NaT",
"with",
"open",
"(",
"sizes_path",
",",
"mode",
"=",
"'r'",
")",
"as",
"f",
":",
"sizes",
"=",
"f",
".",
"read",
"(",
")",
"data",
"=",
"json",
".",
"loads",
"(",
"sizes",
")",
"# use integer division so that the result is an int",
"# for pandas index later https://github.com/pandas-dev/pandas/blob/master/pandas/tseries/base.py#L247 # noqa",
"num_days",
"=",
"data",
"[",
"'shape'",
"]",
"[",
"0",
"]",
"//",
"self",
".",
"_minutes_per_day",
"if",
"num_days",
"==",
"0",
":",
"# empty container",
"return",
"pd",
".",
"NaT",
"return",
"self",
".",
"_session_labels",
"[",
"num_days",
"-",
"1",
"]"
] |
Parameters
----------
sid : int
Asset identifier.
Returns
-------
out : pd.Timestamp
The midnight of the last date written in to the output for the
given sid.
|
[
"Parameters",
"----------",
"sid",
":",
"int",
"Asset",
"identifier",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L533-L558
|
train
|
Returns the midnight of the last date written in to the output for the given sid.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqM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KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(11701 - 11590) + chr(2222 - 2171) + chr(0b110010) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1001 + 0o52) + chr(0b110010) + chr(1244 - 1193), 32926 - 32918), ehT0Px3KOsy9(chr(1046 - 998) + '\x6f' + chr(2113 - 2064) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(327 - 279) + '\157' + chr(51) + chr(50) + '\061', 35352 - 35344), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100111 + 0o10) + chr(1368 - 1318) + chr(51) + chr(0b100100 + 0o22), 26782 - 26774), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(1010 - 957) + '\066', 0b1000), ehT0Px3KOsy9(chr(2080 - 2032) + chr(111) + '\x32' + chr(0b110011) + '\064', 41302 - 41294), ehT0Px3KOsy9(chr(859 - 811) + chr(111) + '\064' + chr(0b101001 + 0o15), 0b1000), ehT0Px3KOsy9(chr(802 - 754) + chr(111) + chr(859 - 810) + chr(0b11001 + 0o30) + chr(0b110000 + 0o1), 0o10), ehT0Px3KOsy9(chr(1571 - 1523) + '\157' + chr(0b110011) + chr(1435 - 1385), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(11593 - 11482) + chr(51) + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\x31' + '\060', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\x36' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + '\x33' + chr(1995 - 1946), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(9406 - 9295) + chr(0b101001 + 0o11) + chr(1985 - 1934) + chr(0b1010 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(1545 - 1434) + chr(0b101100 + 0o5) + chr(2149 - 2101) + '\062', 0o10), ehT0Px3KOsy9('\x30' + chr(8596 - 8485) + '\065' + '\x37', 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b1101111) + '\063' + chr(527 - 477) + chr(53), 8), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + '\x33' + chr(971 - 919) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(503 - 392) + '\063' + '\x36' + '\x33', 56063 - 56055), ehT0Px3KOsy9(chr(156 - 108) + chr(0b1001111 + 0o40) + '\x35' + chr(2317 - 2263), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\061', 31617 - 31609), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + '\x30' + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + '\x36' + chr(51), 6118 - 6110), ehT0Px3KOsy9('\060' + '\x6f' + chr(1718 - 1668) + chr(52), 0o10), ehT0Px3KOsy9(chr(1469 - 1421) + chr(2166 - 2055) + '\063' + chr(160 - 106), 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + chr(0b11100 + 0o26) + chr(0b1001 + 0o56) + '\066', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(672 - 621) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(172 - 119) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(2060 - 2012) + chr(111) + '\064' + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b1001 + 0o51) + chr(0b110010) + chr(0b101111 + 0o10), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\063', 0o10), ehT0Px3KOsy9(chr(1767 - 1719) + chr(0b1101111) + chr(0b110001 + 0o0) + chr(0b100 + 0o63) + chr(0b100110 + 0o13), 65436 - 65428), ehT0Px3KOsy9(chr(1829 - 1781) + '\x6f' + chr(0b10111 + 0o35), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(8328 - 8217) + '\063' + '\063' + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + chr(55) + '\061', 8), ehT0Px3KOsy9(chr(48) + chr(4311 - 4200) + '\060', 8), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1101111) + chr(1157 - 1106) + chr(49) + '\063', 9081 - 9073), ehT0Px3KOsy9('\060' + chr(6458 - 6347) + chr(50) + chr(50) + chr(0b100111 + 0o11), 14949 - 14941)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(5433 - 5322) + '\x35' + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb'), chr(100) + '\145' + chr(8271 - 8172) + chr(111) + chr(0b1100100) + chr(0b110111 + 0o56))('\x75' + '\x74' + chr(0b1011011 + 0o13) + chr(617 - 572) + chr(0b11011 + 0o35)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def dzwpUup5VJxS(oVre8I6UXc3b, Cli4Sf5HnGOS):
bMoN9Rk3cm_2 = xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xe3w\xfe\xfd\x82\xf3U,5q\xad\xc28\xb61F\xaf\x87\x80'), chr(100) + '\x65' + chr(99) + chr(2778 - 2667) + chr(0b1010 + 0o132) + chr(7182 - 7081))('\165' + chr(0b1110100) + chr(102) + chr(0b101101) + chr(0b111000)).V4roHaS3Ppej(oVre8I6UXc3b.sidpath(Cli4Sf5HnGOS))
if not xafqLlk3kkUe(oqhJDdMJfuwx.path, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0\xabc\xa2\xea\x9d'), chr(100) + '\x65' + chr(4818 - 4719) + chr(1591 - 1480) + '\144' + chr(101))(chr(117) + '\164' + chr(0b1100110) + chr(45) + chr(56)))(bMoN9Rk3cm_2):
return xafqLlk3kkUe(dubtF9GfzOdC, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b\xb2^'), chr(0b1100100) + chr(0b101 + 0o140) + '\x63' + '\157' + chr(100) + '\x65')('\x75' + chr(116) + '\x66' + chr(0b11111 + 0o16) + '\070'))
with _fwkIVCGgtAN(bMoN9Rk3cm_2, mode=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(0b1011000 + 0o16) + '\x2d' + chr(0b100100 + 0o24))) as EGyt1xfPT1P6:
Q55tUpoH0W5L = EGyt1xfPT1P6.U6MiWrhuCi2Y()
ULnjp6D6efFH = fXk443epxtd5.loads(Q55tUpoH0W5L)
VTOQxbU0lZxg = ULnjp6D6efFH[xafqLlk3kkUe(SXOLrMavuUCe(b'\xa6\xbbk\xa1\xfb'), chr(0b1011010 + 0o12) + chr(0b1100101) + chr(0b1001101 + 0o26) + chr(7695 - 7584) + '\x64' + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b100110 + 0o100) + chr(45) + chr(824 - 768))][ehT0Px3KOsy9('\060' + '\157' + chr(673 - 625), 8)] // oVre8I6UXc3b._minutes_per_day
if VTOQxbU0lZxg == ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(504 - 456), 8):
return xafqLlk3kkUe(dubtF9GfzOdC, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b\xb2^'), chr(0b1100100) + '\x65' + '\x63' + chr(2149 - 2038) + chr(826 - 726) + chr(0b1100101))(chr(0b1110101) + chr(0b101001 + 0o113) + '\x66' + '\055' + chr(0b111000)))
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a\xa0o\xa2\xed\x87\xf3H\x16v}\xaa\xd35\xea'), '\x64' + chr(0b1100101) + chr(0b1100011) + chr(7800 - 7689) + chr(100) + '\x65')(chr(117) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b111000)))[VTOQxbU0lZxg - ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061', 8)]
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter._init_ctable
|
def _init_ctable(self, path):
"""
Create empty ctable for given path.
Parameters
----------
path : string
The path to rootdir of the new ctable.
"""
# Only create the containing subdir on creation.
# This is not to be confused with the `.bcolz` directory, but is the
# directory up one level from the `.bcolz` directories.
sid_containing_dirname = os.path.dirname(path)
if not os.path.exists(sid_containing_dirname):
# Other sids may have already created the containing directory.
os.makedirs(sid_containing_dirname)
initial_array = np.empty(0, np.uint32)
table = ctable(
rootdir=path,
columns=[
initial_array,
initial_array,
initial_array,
initial_array,
initial_array,
],
names=[
'open',
'high',
'low',
'close',
'volume'
],
expectedlen=self._expectedlen,
mode='w',
)
table.flush()
return table
|
python
|
def _init_ctable(self, path):
"""
Create empty ctable for given path.
Parameters
----------
path : string
The path to rootdir of the new ctable.
"""
# Only create the containing subdir on creation.
# This is not to be confused with the `.bcolz` directory, but is the
# directory up one level from the `.bcolz` directories.
sid_containing_dirname = os.path.dirname(path)
if not os.path.exists(sid_containing_dirname):
# Other sids may have already created the containing directory.
os.makedirs(sid_containing_dirname)
initial_array = np.empty(0, np.uint32)
table = ctable(
rootdir=path,
columns=[
initial_array,
initial_array,
initial_array,
initial_array,
initial_array,
],
names=[
'open',
'high',
'low',
'close',
'volume'
],
expectedlen=self._expectedlen,
mode='w',
)
table.flush()
return table
|
[
"def",
"_init_ctable",
"(",
"self",
",",
"path",
")",
":",
"# Only create the containing subdir on creation.",
"# This is not to be confused with the `.bcolz` directory, but is the",
"# directory up one level from the `.bcolz` directories.",
"sid_containing_dirname",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"path",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"sid_containing_dirname",
")",
":",
"# Other sids may have already created the containing directory.",
"os",
".",
"makedirs",
"(",
"sid_containing_dirname",
")",
"initial_array",
"=",
"np",
".",
"empty",
"(",
"0",
",",
"np",
".",
"uint32",
")",
"table",
"=",
"ctable",
"(",
"rootdir",
"=",
"path",
",",
"columns",
"=",
"[",
"initial_array",
",",
"initial_array",
",",
"initial_array",
",",
"initial_array",
",",
"initial_array",
",",
"]",
",",
"names",
"=",
"[",
"'open'",
",",
"'high'",
",",
"'low'",
",",
"'close'",
",",
"'volume'",
"]",
",",
"expectedlen",
"=",
"self",
".",
"_expectedlen",
",",
"mode",
"=",
"'w'",
",",
")",
"table",
".",
"flush",
"(",
")",
"return",
"table"
] |
Create empty ctable for given path.
Parameters
----------
path : string
The path to rootdir of the new ctable.
|
[
"Create",
"empty",
"ctable",
"for",
"given",
"path",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L560-L597
|
train
|
Create empty ctable for given path.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3E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iX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + '\x33' + '\x33', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1999 - 1950) + chr(0b110000) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b101101 + 0o102) + '\062' + chr(0b110100) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1100010 + 0o15) + chr(0b110001) + chr(2331 - 2277) + chr(0b110011), 36463 - 36455), ehT0Px3KOsy9('\060' + chr(0b100011 + 0o114) + chr(0b110011) + chr(1561 - 1506), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(0b100000 + 0o25) + chr(0b10101 + 0o40), 0b1000), ehT0Px3KOsy9(chr(1180 - 1132) + chr(0b1101111) + chr(2283 - 2234) + '\063' + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b110110) + chr(51), 58445 - 58437), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(54) + '\x35', 43361 - 43353), ehT0Px3KOsy9(chr(1589 - 1541) + chr(8003 - 7892) + '\x31' + chr(1974 - 1925) + '\x36', 48381 - 48373), ehT0Px3KOsy9(chr(2181 - 2133) + chr(5732 - 5621) + chr(0b110001) + chr(48) + chr(0b101 + 0o57), 8390 - 8382), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + '\064' + chr(0b10100 + 0o37), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + chr(54) + chr(0b11011 + 0o26), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2471 - 2420) + chr(0b101111 + 0o5), 64567 - 64559), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(55) + chr(2019 - 1967), 0o10), ehT0Px3KOsy9(chr(48) + chr(9221 - 9110) + '\x32' + chr(0b110001) + chr(1050 - 996), 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\x6f' + chr(0b110011) + chr(0b110100 + 0o0) + chr(0b1101 + 0o50), 44855 - 44847), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b101 + 0o152) + chr(0b110001) + '\x36' + chr(1980 - 1928), 0b1000), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\157' + chr(0b110 + 0o55) + chr(0b101001 + 0o11) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(11042 - 10931) + chr(2225 - 2170) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(7207 - 7096) + chr(86 - 35) + '\062' + chr(70 - 22), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000000 + 0o57) + chr(53) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11010 + 0o31) + chr(51) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + chr(51) + chr(52) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(1814 - 1766) + chr(111) + '\x32' + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + chr(6485 - 6374) + chr(0b110011) + '\065' + chr(48), 0o10), ehT0Px3KOsy9(chr(2226 - 2178) + chr(0b1101111) + '\x32' + chr(218 - 166) + chr(943 - 895), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(53) + chr(0b1101 + 0o50), 8), ehT0Px3KOsy9('\x30' + chr(0b1100101 + 0o12) + chr(51) + chr(280 - 228) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(735 - 687) + chr(0b1100101 + 0o12) + chr(0b10110 + 0o34) + chr(0b11000 + 0o36) + '\063', 8), ehT0Px3KOsy9('\060' + chr(9329 - 9218) + chr(1328 - 1279) + '\063' + chr(0b10010 + 0o44), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + '\063' + chr(49) + '\066', 19572 - 19564), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11010 + 0o30) + '\062', 8), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(52) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11167 - 11056) + '\x33' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(55) + chr(0b1 + 0o62), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(2139 - 2085), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10 + 0o60) + chr(1356 - 1308) + '\x36', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(11149 - 11038) + chr(0b110101) + chr(0b110000), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5'), chr(0b100110 + 0o76) + chr(0b1000100 + 0o41) + '\143' + '\x6f' + chr(0b1100100) + '\145')(chr(0b1110101) + chr(5624 - 5508) + '\146' + '\x2d' + chr(1533 - 1477)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def y9yd9AZ0UwmA(oVre8I6UXc3b, EaCjyhZptSer):
OqffraSywF5e = oqhJDdMJfuwx.path.dirname(EaCjyhZptSer)
if not xafqLlk3kkUe(oqhJDdMJfuwx.path, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe;\xcc\x00k\x1e'), chr(0b11110 + 0o106) + '\145' + '\x63' + chr(0b1010010 + 0o35) + chr(100) + chr(0b1100101))('\x75' + '\164' + chr(8010 - 7908) + '\x2d' + '\070'))(OqffraSywF5e):
xafqLlk3kkUe(oqhJDdMJfuwx, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6"\xce\x16{\x04.\xc0'), chr(100) + chr(0b1100101) + chr(0b100000 + 0o103) + '\157' + '\144' + chr(0b100110 + 0o77))('\x75' + '\x74' + '\x66' + chr(0b101101) + chr(0b110011 + 0o5)))(OqffraSywF5e)
DGr0Ja2vbt_t = WqUC3KWvYVup.empty(ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(1062 - 951) + '\x30', 43930 - 43922), WqUC3KWvYVup.uint32)
YbLi4ide0_3E = pWXITEoX6M4r(rootdir=EaCjyhZptSer, columns=[DGr0Ja2vbt_t, DGr0Ja2vbt_t, DGr0Ja2vbt_t, DGr0Ja2vbt_t, DGr0Ja2vbt_t], names=[xafqLlk3kkUe(SXOLrMavuUCe(b'\xb43\xc0\x1d'), chr(9514 - 9414) + chr(101) + chr(3053 - 2954) + '\x6f' + chr(0b10111 + 0o115) + chr(101))(chr(8632 - 8515) + chr(116) + chr(5799 - 5697) + '\055' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb3*\xc2\x1b'), chr(0b1100100) + chr(394 - 293) + chr(5494 - 5395) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b1110100) + '\146' + chr(1865 - 1820) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7,\xd2'), '\144' + '\145' + chr(6410 - 6311) + chr(0b1001010 + 0o45) + chr(0b1100100) + chr(0b100 + 0o141))(chr(0b10111 + 0o136) + chr(10847 - 10731) + chr(0b1100110) + chr(0b11101 + 0o20) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8/\xca\x00z'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(100) + '\145')('\165' + '\164' + chr(7305 - 7203) + chr(0b101101) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xad,\xc9\x06r\x08'), '\144' + chr(101) + chr(0b1000100 + 0o37) + chr(111) + chr(5917 - 5817) + chr(0b1010111 + 0o16))('\165' + '\164' + chr(0b1100110) + chr(45) + '\070')], expectedlen=oVre8I6UXc3b._expectedlen, mode=xafqLlk3kkUe(SXOLrMavuUCe(b'\xac'), chr(100) + '\145' + '\143' + chr(111) + '\144' + chr(596 - 495))(chr(0b1110101) + '\164' + chr(102) + '\x2d' + '\070'))
xafqLlk3kkUe(YbLi4ide0_3E, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd/\xd0\x00w'), chr(100) + chr(0b1100101) + chr(0b111110 + 0o45) + chr(111) + '\144' + chr(0b1000000 + 0o45))(chr(117) + chr(116) + chr(0b1110 + 0o130) + '\x2d' + chr(0b1101 + 0o53)))()
return YbLi4ide0_3E
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter._ensure_ctable
|
def _ensure_ctable(self, sid):
"""Ensure that a ctable exists for ``sid``, then return it."""
sidpath = self.sidpath(sid)
if not os.path.exists(sidpath):
return self._init_ctable(sidpath)
return bcolz.ctable(rootdir=sidpath, mode='a')
|
python
|
def _ensure_ctable(self, sid):
"""Ensure that a ctable exists for ``sid``, then return it."""
sidpath = self.sidpath(sid)
if not os.path.exists(sidpath):
return self._init_ctable(sidpath)
return bcolz.ctable(rootdir=sidpath, mode='a')
|
[
"def",
"_ensure_ctable",
"(",
"self",
",",
"sid",
")",
":",
"sidpath",
"=",
"self",
".",
"sidpath",
"(",
"sid",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"sidpath",
")",
":",
"return",
"self",
".",
"_init_ctable",
"(",
"sidpath",
")",
"return",
"bcolz",
".",
"ctable",
"(",
"rootdir",
"=",
"sidpath",
",",
"mode",
"=",
"'a'",
")"
] |
Ensure that a ctable exists for ``sid``, then return it.
|
[
"Ensure",
"that",
"a",
"ctable",
"exists",
"for",
"sid",
"then",
"return",
"it",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L599-L604
|
train
|
Ensure that a ctable exists for sid then return it.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy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DPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(53) + chr(0b110 + 0o57), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(2461 - 2411) + '\062', 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101111) + '\x33' + chr(0b100001 + 0o25) + chr(1985 - 1931), 0b1000), ehT0Px3KOsy9(chr(1812 - 1764) + '\x6f' + chr(74 - 23) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(11843 - 11732) + chr(0b110111) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(0b110110) + '\x30', 0o10), ehT0Px3KOsy9(chr(530 - 482) + chr(575 - 464) + chr(49) + chr(55) + '\x32', 0o10), ehT0Px3KOsy9(chr(1710 - 1662) + chr(8863 - 8752) + chr(50) + chr(48) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b10100 + 0o133) + chr(50) + '\x32' + chr(406 - 358), ord("\x08")), ehT0Px3KOsy9(chr(1673 - 1625) + chr(0b111100 + 0o63) + chr(54) + '\x33', 27167 - 27159), ehT0Px3KOsy9(chr(48) + chr(10813 - 10702) + '\062' + '\x32' + chr(2813 - 2759), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1011100 + 0o23) + chr(1205 - 1155) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10001 + 0o42) + '\x30' + '\x30', 40673 - 40665), ehT0Px3KOsy9(chr(769 - 721) + chr(0b1101111) + chr(778 - 728) + chr(1821 - 1772) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101000 + 0o11) + chr(0b101000 + 0o16) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(895 - 784) + chr(0b110011) + '\x30' + chr(0b101001 + 0o13), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(6368 - 6257) + '\067' + chr(0b110011 + 0o2), 31580 - 31572), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\157' + '\061' + chr(49), 0o10), ehT0Px3KOsy9(chr(1696 - 1648) + chr(11282 - 11171) + '\x32' + chr(0b110101) + chr(0b110000), 22650 - 22642), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011000 + 0o27) + chr(0b110001) + chr(2228 - 2180) + '\x37', 0b1000), ehT0Px3KOsy9(chr(2173 - 2125) + chr(0b11111 + 0o120) + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + chr(0b100000 + 0o117) + chr(0b110001) + '\062' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + '\x30' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + '\066' + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101101 + 0o4) + '\063' + '\x31', 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(0b10 + 0o57) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(54) + chr(53), 0b1000), ehT0Px3KOsy9(chr(443 - 395) + '\157' + '\061' + chr(50) + chr(0b10 + 0o63), 8), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(0b1010 + 0o50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1111 + 0o140) + chr(0b110011) + chr(0b10011 + 0o37) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + '\x37' + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + chr(0b11010 + 0o125) + chr(0b11000 + 0o33) + chr(0b10000 + 0o46) + chr(0b110110), 8), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(0b11001 + 0o31) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1214 - 1163) + chr(0b10101 + 0o42) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + '\x32' + chr(1776 - 1725), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(897 - 786) + chr(1479 - 1430) + chr(55) + chr(0b11111 + 0o23), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11001 + 0o36) + chr(0b10010 + 0o37), 0b1000), ehT0Px3KOsy9(chr(1888 - 1840) + chr(0b1101111) + chr(51) + chr(688 - 639) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(111) + chr(0b110001) + chr(0b110100) + chr(51), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010100 + 0o33) + '\x31' + chr(0b10 + 0o64) + chr(1381 - 1327), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10011 + 0o42) + '\x30', 32178 - 32170)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x03'), '\x64' + chr(0b11111 + 0o106) + '\x63' + '\157' + '\144' + chr(0b1000001 + 0o44))(chr(117) + '\x74' + '\146' + chr(45) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def JNDDPRg1GRQj(oVre8I6UXc3b, Cli4Sf5HnGOS):
NifI0GJjvvLR = oVre8I6UXc3b.sidpath(Cli4Sf5HnGOS)
if not xafqLlk3kkUe(oqhJDdMJfuwx.path, xafqLlk3kkUe(SXOLrMavuUCe(b'H\xaa\x9fjL\x03'), chr(9645 - 9545) + '\145' + chr(4610 - 4511) + chr(111) + chr(100) + chr(0b1101 + 0o130))(chr(11096 - 10979) + chr(116) + chr(0b1100110) + '\x2d' + chr(56)))(NifI0GJjvvLR):
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'r\xbb\x98pL/\x19\xf6\xf1Q\xfaw'), chr(100) + chr(0b1101 + 0o130) + chr(6925 - 6826) + chr(7451 - 7340) + chr(0b1100100) + '\x65')('\x75' + chr(0b1110100) + chr(102) + '\055' + chr(2700 - 2644)))(NifI0GJjvvLR)
return xafqLlk3kkUe(oxWyLaiFGvnT, xafqLlk3kkUe(SXOLrMavuUCe(b'N\xa6\x97{T\x15'), '\144' + '\x65' + '\143' + chr(0b1000 + 0o147) + '\x64' + chr(997 - 896))('\x75' + chr(116) + chr(1265 - 1163) + chr(0b101101) + '\070'))(rootdir=NifI0GJjvvLR, mode=xafqLlk3kkUe(SXOLrMavuUCe(b'L'), chr(0b1100100) + chr(6510 - 6409) + chr(0b1100010 + 0o1) + chr(0b1101111) + chr(0b110100 + 0o60) + chr(101))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(3068 - 3012)))
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter.pad
|
def pad(self, sid, date):
"""
Fill sid container with empty data through the specified date.
If the last recorded trade is not at the close, then that day will be
padded with zeros until its close. Any day after that (up to and
including the specified date) will be padded with `minute_per_day`
worth of zeros
Parameters
----------
sid : int
The asset identifier for the data being written.
date : datetime-like
The date used to calculate how many slots to be pad.
The padding is done through the date, i.e. after the padding is
done the `last_date_in_output_for_sid` will be equal to `date`
"""
table = self._ensure_ctable(sid)
last_date = self.last_date_in_output_for_sid(sid)
tds = self._session_labels
if date <= last_date or date < tds[0]:
# No need to pad.
return
if last_date == pd.NaT:
# If there is no data, determine how many days to add so that
# desired days are written to the correct slots.
days_to_zerofill = tds[tds.slice_indexer(end=date)]
else:
days_to_zerofill = tds[tds.slice_indexer(
start=last_date + tds.freq,
end=date)]
self._zerofill(table, len(days_to_zerofill))
new_last_date = self.last_date_in_output_for_sid(sid)
assert new_last_date == date, "new_last_date={0} != date={1}".format(
new_last_date, date)
|
python
|
def pad(self, sid, date):
"""
Fill sid container with empty data through the specified date.
If the last recorded trade is not at the close, then that day will be
padded with zeros until its close. Any day after that (up to and
including the specified date) will be padded with `minute_per_day`
worth of zeros
Parameters
----------
sid : int
The asset identifier for the data being written.
date : datetime-like
The date used to calculate how many slots to be pad.
The padding is done through the date, i.e. after the padding is
done the `last_date_in_output_for_sid` will be equal to `date`
"""
table = self._ensure_ctable(sid)
last_date = self.last_date_in_output_for_sid(sid)
tds = self._session_labels
if date <= last_date or date < tds[0]:
# No need to pad.
return
if last_date == pd.NaT:
# If there is no data, determine how many days to add so that
# desired days are written to the correct slots.
days_to_zerofill = tds[tds.slice_indexer(end=date)]
else:
days_to_zerofill = tds[tds.slice_indexer(
start=last_date + tds.freq,
end=date)]
self._zerofill(table, len(days_to_zerofill))
new_last_date = self.last_date_in_output_for_sid(sid)
assert new_last_date == date, "new_last_date={0} != date={1}".format(
new_last_date, date)
|
[
"def",
"pad",
"(",
"self",
",",
"sid",
",",
"date",
")",
":",
"table",
"=",
"self",
".",
"_ensure_ctable",
"(",
"sid",
")",
"last_date",
"=",
"self",
".",
"last_date_in_output_for_sid",
"(",
"sid",
")",
"tds",
"=",
"self",
".",
"_session_labels",
"if",
"date",
"<=",
"last_date",
"or",
"date",
"<",
"tds",
"[",
"0",
"]",
":",
"# No need to pad.",
"return",
"if",
"last_date",
"==",
"pd",
".",
"NaT",
":",
"# If there is no data, determine how many days to add so that",
"# desired days are written to the correct slots.",
"days_to_zerofill",
"=",
"tds",
"[",
"tds",
".",
"slice_indexer",
"(",
"end",
"=",
"date",
")",
"]",
"else",
":",
"days_to_zerofill",
"=",
"tds",
"[",
"tds",
".",
"slice_indexer",
"(",
"start",
"=",
"last_date",
"+",
"tds",
".",
"freq",
",",
"end",
"=",
"date",
")",
"]",
"self",
".",
"_zerofill",
"(",
"table",
",",
"len",
"(",
"days_to_zerofill",
")",
")",
"new_last_date",
"=",
"self",
".",
"last_date_in_output_for_sid",
"(",
"sid",
")",
"assert",
"new_last_date",
"==",
"date",
",",
"\"new_last_date={0} != date={1}\"",
".",
"format",
"(",
"new_last_date",
",",
"date",
")"
] |
Fill sid container with empty data through the specified date.
If the last recorded trade is not at the close, then that day will be
padded with zeros until its close. Any day after that (up to and
including the specified date) will be padded with `minute_per_day`
worth of zeros
Parameters
----------
sid : int
The asset identifier for the data being written.
date : datetime-like
The date used to calculate how many slots to be pad.
The padding is done through the date, i.e. after the padding is
done the `last_date_in_output_for_sid` will be equal to `date`
|
[
"Fill",
"sid",
"container",
"with",
"empty",
"data",
"through",
"the",
"specified",
"date",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L618-L659
|
train
|
Fills sid container with empty data through the specified date.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X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kZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(0b110100) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\157' + chr(0b1110 + 0o43) + '\066' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(1175 - 1127) + chr(111) + chr(54) + '\066', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10011 + 0o37) + chr(1097 - 1045) + chr(52), 28861 - 28853), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11110 + 0o25) + chr(55) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b0 + 0o62) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(111) + '\063' + chr(804 - 751), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1011101 + 0o22) + chr(0b110010) + chr(0b110000) + chr(2278 - 2226), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\064' + '\067', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(0b110100) + '\x32', 34075 - 34067), ehT0Px3KOsy9(chr(2276 - 2228) + '\157' + chr(0b110011) + chr(0b1010 + 0o47) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(12101 - 11990) + chr(849 - 799) + '\065' + chr(749 - 701), 43356 - 43348), ehT0Px3KOsy9(chr(48) + chr(8268 - 8157) + chr(0b10001 + 0o40) + chr(0b1010 + 0o46) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(0b110101) + chr(2402 - 2348), 28319 - 28311), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + '\061' + chr(53) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(1147 - 1099) + chr(0b100010 + 0o115) + chr(0b101110 + 0o5) + chr(0b100100 + 0o17) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(783 - 735) + '\157' + chr(0b110010) + chr(0b101101 + 0o7), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011 + 0o144) + '\062' + '\061' + chr(572 - 522), ord("\x08")), ehT0Px3KOsy9(chr(1852 - 1804) + '\x6f' + '\063' + chr(52) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(0b11 + 0o57) + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\063' + '\063' + '\x33', 10368 - 10360), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(0b110000) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\x37' + chr(0b10110 + 0o35), 62522 - 62514), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(1283 - 1231) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(0b100 + 0o60) + chr(1140 - 1088), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b111000 + 0o67) + chr(581 - 530) + chr(521 - 467) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + chr(0b110011) + chr(0b1100 + 0o47) + chr(0b100100 + 0o20), 0b1000), ehT0Px3KOsy9('\x30' + chr(3750 - 3639) + chr(0b110001) + '\064' + '\x32', 21291 - 21283), ehT0Px3KOsy9(chr(1563 - 1515) + chr(0b1101111) + chr(51) + chr(848 - 800) + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(2009 - 1959) + '\065' + chr(0b110111), 42960 - 42952), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(1299 - 1247) + '\065', 0b1000), ehT0Px3KOsy9('\060' + chr(2535 - 2424) + '\x32' + '\066' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\x6f' + chr(0b110010) + chr(0b1101 + 0o44) + chr(0b100010 + 0o20), 8), ehT0Px3KOsy9('\060' + chr(0b101010 + 0o105) + chr(50) + '\067' + chr(53), 31189 - 31181), ehT0Px3KOsy9(chr(1028 - 980) + chr(9120 - 9009) + chr(0b10111 + 0o36) + chr(0b1011 + 0o47), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + '\x31', 0o10), ehT0Px3KOsy9(chr(2093 - 2045) + chr(0b1101111) + '\x34' + chr(51), 63894 - 63886), ehT0Px3KOsy9('\060' + chr(111) + chr(1039 - 989) + '\x36' + chr(322 - 270), ord("\x08")), ehT0Px3KOsy9(chr(375 - 327) + '\x6f' + '\x33' + '\061', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(49) + '\063' + chr(0b110001), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b10011 + 0o134) + chr(0b11010 + 0o33) + chr(0b100100 + 0o14), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8d'), chr(6991 - 6891) + chr(0b1011010 + 0o13) + '\143' + '\x6f' + chr(100) + '\x65')(chr(117) + '\164' + chr(0b1100110) + chr(0b101101) + chr(342 - 286)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def jq0C7ttmqXPS(oVre8I6UXc3b, Cli4Sf5HnGOS, J4aeFOr3sjPo):
YbLi4ide0_3E = oVre8I6UXc3b._ensure_ctable(Cli4Sf5HnGOS)
wMWA42oTQSts = oVre8I6UXc3b.last_date_in_output_for_sid(Cli4Sf5HnGOS)
vziqQXSwuqQo = oVre8I6UXc3b._session_labels
if J4aeFOr3sjPo <= wMWA42oTQSts or J4aeFOr3sjPo < vziqQXSwuqQo[ehT0Px3KOsy9('\x30' + '\157' + '\x30', 44970 - 44962)]:
return
if wMWA42oTQSts == xafqLlk3kkUe(dubtF9GfzOdC, xafqLlk3kkUe(SXOLrMavuUCe(b'\xed\x17b'), chr(0b1100100) + chr(401 - 300) + chr(99) + '\x6f' + chr(0b1001000 + 0o34) + chr(101))('\165' + chr(116) + '\x66' + '\055' + '\x38')):
XO3RITPfgjbj = vziqQXSwuqQo[vziqQXSwuqQo.slice_indexer(end=J4aeFOr3sjPo)]
else:
XO3RITPfgjbj = vziqQXSwuqQo[vziqQXSwuqQo.slice_indexer(start=wMWA42oTQSts + vziqQXSwuqQo.ha8aTvyciPGb, end=J4aeFOr3sjPo)]
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfc\x0cS\xd6\x94st\xe8K'), '\144' + '\145' + chr(4027 - 3928) + chr(0b1101111) + chr(100) + chr(8952 - 8851))(chr(0b1110010 + 0o3) + chr(0b1000011 + 0o61) + chr(0b1010001 + 0o25) + '\055' + chr(0b1000 + 0o60)))(YbLi4ide0_3E, c2A0yzQpDQB3(XO3RITPfgjbj))
qUakMq_hQG54 = oVre8I6UXc3b.last_date_in_output_for_sid(Cli4Sf5HnGOS)
assert qUakMq_hQG54 == J4aeFOr3sjPo, xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\xcd\x13A\xfb\x97tn\xf0x\xc6\xaa\xdc \x93\x16\xeai\xaa\xc7o\xfb'\x1a\xd5\x81\xc9\xa7S\xbd"), chr(3602 - 3502) + chr(0b1100100 + 0o1) + '\143' + '\157' + '\144' + chr(9927 - 9826))(chr(117) + chr(0b1110100) + '\x66' + chr(0b101100 + 0o1) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5BD\xcb\xb3tN\xb7w\xd2\xae\xc2'), chr(3248 - 3148) + '\x65' + chr(3027 - 2928) + chr(111) + chr(0b1100100) + chr(3391 - 3290))('\165' + chr(5122 - 5006) + chr(102) + chr(0b11011 + 0o22) + '\x38'))(qUakMq_hQG54, J4aeFOr3sjPo)
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter.set_sid_attrs
|
def set_sid_attrs(self, sid, **kwargs):
"""Write all the supplied kwargs as attributes of the sid's file.
"""
table = self._ensure_ctable(sid)
for k, v in kwargs.items():
table.attrs[k] = v
|
python
|
def set_sid_attrs(self, sid, **kwargs):
"""Write all the supplied kwargs as attributes of the sid's file.
"""
table = self._ensure_ctable(sid)
for k, v in kwargs.items():
table.attrs[k] = v
|
[
"def",
"set_sid_attrs",
"(",
"self",
",",
"sid",
",",
"*",
"*",
"kwargs",
")",
":",
"table",
"=",
"self",
".",
"_ensure_ctable",
"(",
"sid",
")",
"for",
"k",
",",
"v",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"table",
".",
"attrs",
"[",
"k",
"]",
"=",
"v"
] |
Write all the supplied kwargs as attributes of the sid's file.
|
[
"Write",
"all",
"the",
"supplied",
"kwargs",
"as",
"attributes",
"of",
"the",
"sid",
"s",
"file",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L661-L666
|
train
|
Write all the supplied kwargs as attributes of the sid s file.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSb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Fey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(111) + chr(844 - 794) + '\067' + '\x35', 0b1000), ehT0Px3KOsy9(chr(1393 - 1345) + chr(5206 - 5095) + chr(51) + '\x30' + chr(0b10010 + 0o44), ord("\x08")), ehT0Px3KOsy9(chr(587 - 539) + chr(0b1101111) + chr(0b110001) + '\064' + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110100) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(0b110111) + chr(1744 - 1696), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + chr(49) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(2181 - 2132) + chr(2081 - 2033) + chr(0b101101 + 0o11), 52731 - 52723), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(0b110000) + chr(160 - 109), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b111 + 0o52) + chr(0b110001) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(56 - 8) + '\x6f' + chr(49) + chr(1721 - 1670) + chr(78 - 23), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b111111 + 0o60) + '\x36' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1101111) + '\x31' + '\x32' + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(49) + '\x30' + chr(1830 - 1776), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101101 + 0o5) + chr(52) + chr(0b11010 + 0o32), 0b1000), ehT0Px3KOsy9(chr(665 - 617) + chr(5561 - 5450) + chr(148 - 98) + chr(50), 2063 - 2055), ehT0Px3KOsy9(chr(2159 - 2111) + chr(6552 - 6441) + '\063' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + '\x30' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9973 - 9862) + '\067' + '\x30', 0b1000), ehT0Px3KOsy9(chr(865 - 817) + chr(0b1101111) + chr(0b11010 + 0o35), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1 + 0o62) + chr(0b110011) + chr(191 - 137), 11416 - 11408), ehT0Px3KOsy9(chr(2145 - 2097) + '\157' + chr(0b101101 + 0o4) + chr(2005 - 1957) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101 + 0o142) + chr(0b1101 + 0o46) + chr(0b100001 + 0o20) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(10655 - 10544) + chr(729 - 679) + '\x32' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110101) + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + '\x31' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1001001 + 0o46) + '\063' + chr(943 - 895) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(948 - 898) + chr(53) + chr(49), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(50) + '\x31', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(777 - 728) + chr(52), 0b1000), ehT0Px3KOsy9(chr(2228 - 2180) + '\x6f' + chr(1544 - 1493) + '\064' + chr(48), 17152 - 17144), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(51), 29055 - 29047), ehT0Px3KOsy9(chr(48) + chr(0b1101000 + 0o7) + '\063' + '\x36' + '\x36', 62658 - 62650), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\157' + '\x33' + chr(0b110111) + '\x30', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(48) + chr(675 - 626), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + '\x33' + chr(50), 15691 - 15683), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(48) + chr(0b110010), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1210 - 1159) + chr(0b100110 + 0o14) + '\x31', 0b1000), ehT0Px3KOsy9(chr(1321 - 1273) + chr(111) + '\066' + chr(49), 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\157' + chr(2334 - 2285) + '\067' + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\063' + chr(2022 - 1974), 43567 - 43559)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1866 - 1818) + '\x6f' + '\x35' + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x93'), chr(6877 - 6777) + chr(5588 - 5487) + '\x63' + chr(0b1101111) + '\x64' + chr(0b10101 + 0o120))('\x75' + '\164' + chr(0b111001 + 0o55) + chr(0b101101) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def sXdHWNBjHmud(oVre8I6UXc3b, Cli4Sf5HnGOS, **M8EIoTs2GJXE):
YbLi4ide0_3E = oVre8I6UXc3b._ensure_ctable(Cli4Sf5HnGOS)
for (OolUPRJhRaJd, cMbll0QYhULo) in xafqLlk3kkUe(M8EIoTs2GJXE, xafqLlk3kkUe(SXOLrMavuUCe(b"\xf3\xbc\x13F\xf1\xd4u\xca'\x0c\x7fl"), chr(9091 - 8991) + chr(2055 - 1954) + '\x63' + chr(111) + '\x64' + chr(0b1100101))(chr(0b1110101) + '\164' + chr(4863 - 4761) + chr(317 - 272) + chr(0b10000 + 0o50)))():
YbLi4ide0_3E.oIhwMA96NShQ[OolUPRJhRaJd] = cMbll0QYhULo
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter.write
|
def write(self, data, show_progress=False, invalid_data_behavior='warn'):
"""Write a stream of minute data.
Parameters
----------
data : iterable[(int, pd.DataFrame)]
The data to write. Each element should be a tuple of sid, data
where data has the following format:
columns : ('open', 'high', 'low', 'close', 'volume')
open : float64
high : float64
low : float64
close : float64
volume : float64|int64
index : DatetimeIndex of market minutes.
A given sid may appear more than once in ``data``; however,
the dates must be strictly increasing.
show_progress : bool, optional
Whether or not to show a progress bar while writing.
"""
ctx = maybe_show_progress(
data,
show_progress=show_progress,
item_show_func=lambda e: e if e is None else str(e[0]),
label="Merging minute equity files:",
)
write_sid = self.write_sid
with ctx as it:
for e in it:
write_sid(*e, invalid_data_behavior=invalid_data_behavior)
|
python
|
def write(self, data, show_progress=False, invalid_data_behavior='warn'):
"""Write a stream of minute data.
Parameters
----------
data : iterable[(int, pd.DataFrame)]
The data to write. Each element should be a tuple of sid, data
where data has the following format:
columns : ('open', 'high', 'low', 'close', 'volume')
open : float64
high : float64
low : float64
close : float64
volume : float64|int64
index : DatetimeIndex of market minutes.
A given sid may appear more than once in ``data``; however,
the dates must be strictly increasing.
show_progress : bool, optional
Whether or not to show a progress bar while writing.
"""
ctx = maybe_show_progress(
data,
show_progress=show_progress,
item_show_func=lambda e: e if e is None else str(e[0]),
label="Merging minute equity files:",
)
write_sid = self.write_sid
with ctx as it:
for e in it:
write_sid(*e, invalid_data_behavior=invalid_data_behavior)
|
[
"def",
"write",
"(",
"self",
",",
"data",
",",
"show_progress",
"=",
"False",
",",
"invalid_data_behavior",
"=",
"'warn'",
")",
":",
"ctx",
"=",
"maybe_show_progress",
"(",
"data",
",",
"show_progress",
"=",
"show_progress",
",",
"item_show_func",
"=",
"lambda",
"e",
":",
"e",
"if",
"e",
"is",
"None",
"else",
"str",
"(",
"e",
"[",
"0",
"]",
")",
",",
"label",
"=",
"\"Merging minute equity files:\"",
",",
")",
"write_sid",
"=",
"self",
".",
"write_sid",
"with",
"ctx",
"as",
"it",
":",
"for",
"e",
"in",
"it",
":",
"write_sid",
"(",
"*",
"e",
",",
"invalid_data_behavior",
"=",
"invalid_data_behavior",
")"
] |
Write a stream of minute data.
Parameters
----------
data : iterable[(int, pd.DataFrame)]
The data to write. Each element should be a tuple of sid, data
where data has the following format:
columns : ('open', 'high', 'low', 'close', 'volume')
open : float64
high : float64
low : float64
close : float64
volume : float64|int64
index : DatetimeIndex of market minutes.
A given sid may appear more than once in ``data``; however,
the dates must be strictly increasing.
show_progress : bool, optional
Whether or not to show a progress bar while writing.
|
[
"Write",
"a",
"stream",
"of",
"minute",
"data",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L668-L697
|
train
|
Write a series of market minutes data to the log file.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5H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ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(53) + chr(0b100000 + 0o27), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b100 + 0o63) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(1115 - 1067) + chr(111) + chr(0b100110 + 0o13) + '\x36' + '\065', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(98 - 45) + chr(0b110111 + 0o0), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(790 - 737) + chr(1018 - 963), 29568 - 29560), ehT0Px3KOsy9('\060' + '\157' + chr(54) + '\x30', 0b1000), ehT0Px3KOsy9(chr(1050 - 1002) + chr(5766 - 5655) + chr(0b100111 + 0o12) + chr(49) + chr(0b1101 + 0o45), 18138 - 18130), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(53) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(49) + chr(48), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(2626 - 2574) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1275 - 1164) + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100101 + 0o21) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b110000) + chr(48), 29105 - 29097), ehT0Px3KOsy9('\060' + chr(0b1010111 + 0o30) + '\065', 0o10), ehT0Px3KOsy9(chr(296 - 248) + chr(0b1101111) + chr(0b10001 + 0o41) + chr(0b11101 + 0o23) + chr(0b110110), 40427 - 40419), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + '\x33' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(4126 - 4015) + chr(0b110010) + chr(0b10101 + 0o41) + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(49) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1110 + 0o141) + chr(0b11001 + 0o30) + chr(0b110101) + chr(0b101100 + 0o5), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(0b110110 + 0o1) + chr(0b101000 + 0o17), 35733 - 35725), ehT0Px3KOsy9(chr(48) + chr(0b11010 + 0o125) + chr(0b11011 + 0o32) + chr(55), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101111 + 0o3) + chr(1465 - 1413) + chr(0b101111 + 0o3), 8), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1100000 + 0o17) + '\x33' + chr(568 - 513), 64140 - 64132), ehT0Px3KOsy9(chr(48) + chr(5783 - 5672) + chr(2341 - 2290) + '\062' + chr(0b101 + 0o56), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + '\062' + chr(49), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110110) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(8528 - 8417) + chr(49) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\x6f' + chr(49) + chr(0b110111) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(651 - 603) + chr(0b110000 + 0o77) + chr(962 - 911) + chr(567 - 518) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(69 - 21) + chr(111) + '\x33' + chr(0b111 + 0o53) + '\x31', 8), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + chr(0b11110 + 0o24) + chr(0b110011) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110 + 0o151) + chr(0b110010) + chr(485 - 434) + '\066', 57897 - 57889), ehT0Px3KOsy9('\060' + chr(3694 - 3583) + chr(50) + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(0b110001) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101001 + 0o12) + '\x34' + chr(0b100010 + 0o20), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + '\065' + '\061', 8), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(643 - 594) + chr(2035 - 1986), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\065' + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x81'), '\144' + chr(0b1100101) + chr(0b1001000 + 0o33) + chr(0b1101111) + chr(9066 - 8966) + chr(101))(chr(0b1000111 + 0o56) + chr(11583 - 11467) + chr(10004 - 9902) + chr(0b10111 + 0o26) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def QywlqEoQilJa(oVre8I6UXc3b, ULnjp6D6efFH, _rgtfo4EPgcH=ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + chr(0b1110 + 0o42), 0o10), cR28UAwBtSml=xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\x9c\x07\xc1'), chr(0b1100100) + '\x65' + chr(8983 - 8884) + chr(111) + chr(209 - 109) + chr(0b111010 + 0o53))(chr(0b100000 + 0o125) + chr(116) + chr(0b11011 + 0o113) + chr(0b101101) + chr(56))):
oM3jLo753XfX = EV62YNiiK8hq(ULnjp6D6efFH, show_progress=_rgtfo4EPgcH, item_show_func=lambda GlnVAPeT6CUe: GlnVAPeT6CUe if GlnVAPeT6CUe is None else M8_cKLkHVB2V(GlnVAPeT6CUe[ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + '\060', 8)]), label=xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2\x98\x07\xc8\x06^-\xcc\xe5\xcbm@4`\xa6\xbe\xc5\xfe\x00\xcbV&\xc4v\xbf\xb4B5'), chr(100) + '\x65' + chr(0b110111 + 0o54) + chr(11094 - 10983) + chr(0b1100100) + chr(0b1100101))('\x75' + chr(0b101101 + 0o107) + chr(0b1100110) + chr(0b101100 + 0o1) + chr(0b100111 + 0o21)))
bop81zgtAfMu = oVre8I6UXc3b.write_sid
with oM3jLo753XfX as SdOiQfoVLiMl:
for GlnVAPeT6CUe in SdOiQfoVLiMl:
bop81zgtAfMu(*GlnVAPeT6CUe, invalid_data_behavior=cR28UAwBtSml)
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter.write_sid
|
def write_sid(self, sid, df, invalid_data_behavior='warn'):
"""
Write the OHLCV data for the given sid.
If there is no bcolz ctable yet created for the sid, create it.
If the length of the bcolz ctable is not exactly to the date before
the first day provided, fill the ctable with 0s up to that date.
Parameters
----------
sid : int
The asset identifer for the data being written.
df : pd.DataFrame
DataFrame of market data with the following characteristics.
columns : ('open', 'high', 'low', 'close', 'volume')
open : float64
high : float64
low : float64
close : float64
volume : float64|int64
index : DatetimeIndex of market minutes.
"""
cols = {
'open': df.open.values,
'high': df.high.values,
'low': df.low.values,
'close': df.close.values,
'volume': df.volume.values,
}
dts = df.index.values
# Call internal method, since DataFrame has already ensured matching
# index and value lengths.
self._write_cols(sid, dts, cols, invalid_data_behavior)
|
python
|
def write_sid(self, sid, df, invalid_data_behavior='warn'):
"""
Write the OHLCV data for the given sid.
If there is no bcolz ctable yet created for the sid, create it.
If the length of the bcolz ctable is not exactly to the date before
the first day provided, fill the ctable with 0s up to that date.
Parameters
----------
sid : int
The asset identifer for the data being written.
df : pd.DataFrame
DataFrame of market data with the following characteristics.
columns : ('open', 'high', 'low', 'close', 'volume')
open : float64
high : float64
low : float64
close : float64
volume : float64|int64
index : DatetimeIndex of market minutes.
"""
cols = {
'open': df.open.values,
'high': df.high.values,
'low': df.low.values,
'close': df.close.values,
'volume': df.volume.values,
}
dts = df.index.values
# Call internal method, since DataFrame has already ensured matching
# index and value lengths.
self._write_cols(sid, dts, cols, invalid_data_behavior)
|
[
"def",
"write_sid",
"(",
"self",
",",
"sid",
",",
"df",
",",
"invalid_data_behavior",
"=",
"'warn'",
")",
":",
"cols",
"=",
"{",
"'open'",
":",
"df",
".",
"open",
".",
"values",
",",
"'high'",
":",
"df",
".",
"high",
".",
"values",
",",
"'low'",
":",
"df",
".",
"low",
".",
"values",
",",
"'close'",
":",
"df",
".",
"close",
".",
"values",
",",
"'volume'",
":",
"df",
".",
"volume",
".",
"values",
",",
"}",
"dts",
"=",
"df",
".",
"index",
".",
"values",
"# Call internal method, since DataFrame has already ensured matching",
"# index and value lengths.",
"self",
".",
"_write_cols",
"(",
"sid",
",",
"dts",
",",
"cols",
",",
"invalid_data_behavior",
")"
] |
Write the OHLCV data for the given sid.
If there is no bcolz ctable yet created for the sid, create it.
If the length of the bcolz ctable is not exactly to the date before
the first day provided, fill the ctable with 0s up to that date.
Parameters
----------
sid : int
The asset identifer for the data being written.
df : pd.DataFrame
DataFrame of market data with the following characteristics.
columns : ('open', 'high', 'low', 'close', 'volume')
open : float64
high : float64
low : float64
close : float64
volume : float64|int64
index : DatetimeIndex of market minutes.
|
[
"Write",
"the",
"OHLCV",
"data",
"for",
"the",
"given",
"sid",
".",
"If",
"there",
"is",
"no",
"bcolz",
"ctable",
"yet",
"created",
"for",
"the",
"sid",
"create",
"it",
".",
"If",
"the",
"length",
"of",
"the",
"bcolz",
"ctable",
"is",
"not",
"exactly",
"to",
"the",
"date",
"before",
"the",
"first",
"day",
"provided",
"fill",
"the",
"ctable",
"with",
"0s",
"up",
"to",
"that",
"date",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L699-L730
|
train
|
Writes the OHLCV data for the given sid to the bcolz ctable.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v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ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1216 - 1168) + chr(111) + chr(1880 - 1830) + '\x32' + chr(0b101001 + 0o7), 0o10), ehT0Px3KOsy9(chr(1332 - 1284) + chr(0b100000 + 0o117) + chr(0b100101 + 0o15) + chr(0b1000 + 0o57) + '\x36', 0b1000), ehT0Px3KOsy9(chr(983 - 935) + '\x6f' + chr(49) + chr(0b100101 + 0o14) + chr(0b110110), 45678 - 45670), ehT0Px3KOsy9('\x30' + chr(0b100000 + 0o117) + chr(51) + chr(0b110011 + 0o3) + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + chr(4969 - 4858) + chr(0b11110 + 0o27) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111 + 0o0) + '\063' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9725 - 9614) + chr(50) + chr(313 - 262) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + '\067' + '\060', 30843 - 30835), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1286 - 1236) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101110 + 0o1) + chr(51) + '\x35' + chr(0b110101), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101111 + 0o3) + '\x33' + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11111 + 0o24) + '\064' + chr(53), 21725 - 21717), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1101111) + '\063' + chr(53) + chr(0b110010 + 0o3), 8), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(1504 - 1450) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(0b110111) + chr(48), 8), ehT0Px3KOsy9(chr(1474 - 1426) + chr(111) + '\061' + '\x33' + chr(55), 63772 - 63764), ehT0Px3KOsy9('\060' + chr(4535 - 4424) + chr(51) + '\067' + chr(2067 - 2013), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(358 - 307) + chr(1165 - 1117) + chr(53), 0b1000), ehT0Px3KOsy9(chr(1880 - 1832) + chr(5563 - 5452) + chr(50) + chr(50) + chr(51), 0o10), ehT0Px3KOsy9(chr(1705 - 1657) + '\x6f' + chr(1515 - 1466), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(54) + chr(0b101010 + 0o10), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b101011 + 0o104) + '\061' + chr(0b110001) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(48) + '\x31', 0o10), ehT0Px3KOsy9('\060' + chr(0b11101 + 0o122) + chr(0b101111 + 0o4) + chr(52) + '\065', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1111 + 0o140) + chr(0b110010) + chr(2298 - 2247) + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + chr(0b110111) + chr(1263 - 1214), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + '\064' + '\x35', 8), ehT0Px3KOsy9(chr(475 - 427) + chr(6412 - 6301) + chr(49) + chr(49) + chr(1710 - 1659), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(4457 - 4346) + chr(0b101101 + 0o6) + chr(0b100010 + 0o20) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(0b100001 + 0o21) + chr(0b101101 + 0o4), ord("\x08")), ehT0Px3KOsy9(chr(1650 - 1602) + '\157' + chr(543 - 494) + chr(0b1 + 0o66) + chr(253 - 201), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(0b110111) + '\066', 65045 - 65037), ehT0Px3KOsy9('\060' + chr(0b1011011 + 0o24) + '\062' + chr(50) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010001 + 0o36) + chr(367 - 318) + chr(0b11011 + 0o34) + chr(50), 42092 - 42084), ehT0Px3KOsy9(chr(1540 - 1492) + '\x6f' + chr(0b100011 + 0o16) + '\063' + '\066', 48868 - 48860), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(302 - 251) + chr(0b110010) + chr(1950 - 1900), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(55) + chr(0b11 + 0o62), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100 + 0o57) + '\064' + chr(54), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(2281 - 2233) + chr(3374 - 3263) + chr(53) + chr(318 - 270), 39151 - 39143)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe'), '\144' + '\145' + chr(0b1100011) + chr(0b1100 + 0o143) + '\144' + '\145')(chr(11541 - 11424) + '\x74' + '\x66' + '\055' + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def bop81zgtAfMu(oVre8I6UXc3b, Cli4Sf5HnGOS, aVhM9WzaWXU5, cR28UAwBtSml=xafqLlk3kkUe(SXOLrMavuUCe(b'\xe7\xdf<\x99'), chr(100) + chr(101) + chr(0b1100011) + '\157' + '\144' + chr(0b1100101))('\165' + '\164' + '\x66' + chr(0b101101) + '\x38')):
AIgvIWQd9onz = {xafqLlk3kkUe(SXOLrMavuUCe(b'\xff\xce+\x99'), chr(6982 - 6882) + chr(101) + chr(0b110011 + 0o60) + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(0b1100110) + '\x2d' + '\x38'): aVhM9WzaWXU5.open.SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\xd7)\x9f'), chr(100) + chr(5100 - 4999) + '\x63' + chr(11027 - 10916) + chr(100) + chr(6062 - 5961))(chr(0b10001 + 0o144) + chr(13083 - 12967) + chr(0b1100110) + chr(0b101101) + '\x38'): aVhM9WzaWXU5.high.SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfc\xd19'), chr(0b111100 + 0o50) + chr(101) + '\x63' + '\x6f' + chr(100) + chr(0b1100000 + 0o5))(chr(117) + chr(116) + chr(102) + '\x2d' + chr(0b101111 + 0o11)): aVhM9WzaWXU5.low.SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3\xd2!\x84K'), chr(5319 - 5219) + '\145' + chr(5072 - 4973) + chr(111) + chr(0b1011101 + 0o7) + chr(0b1000111 + 0o36))('\x75' + chr(9672 - 9556) + chr(0b1100110) + '\055' + chr(0b100011 + 0o25)): aVhM9WzaWXU5.close.SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6\xd1"\x82Cx'), '\144' + '\x65' + '\143' + '\x6f' + '\x64' + '\x65')(chr(0b1010111 + 0o36) + chr(4443 - 4327) + chr(0b1100110) + chr(45) + chr(1524 - 1468)): aVhM9WzaWXU5.volume.SPnCNu54H1db}
f5Ww7tOW_bKL = aVhM9WzaWXU5.index.SPnCNu54H1db
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf\xc9<\x9eZx\xc5\x1by{\x9e'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(1989 - 1878) + chr(100) + chr(101))('\x75' + '\x74' + '\146' + chr(2009 - 1964) + '\070'))(Cli4Sf5HnGOS, f5Ww7tOW_bKL, AIgvIWQd9onz, cR28UAwBtSml)
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter.write_cols
|
def write_cols(self, sid, dts, cols, invalid_data_behavior='warn'):
"""
Write the OHLCV data for the given sid.
If there is no bcolz ctable yet created for the sid, create it.
If the length of the bcolz ctable is not exactly to the date before
the first day provided, fill the ctable with 0s up to that date.
Parameters
----------
sid : int
The asset identifier for the data being written.
dts : datetime64 array
The dts corresponding to values in cols.
cols : dict of str -> np.array
dict of market data with the following characteristics.
keys are ('open', 'high', 'low', 'close', 'volume')
open : float64
high : float64
low : float64
close : float64
volume : float64|int64
"""
if not all(len(dts) == len(cols[name]) for name in self.COL_NAMES):
raise BcolzMinuteWriterColumnMismatch(
"Length of dts={0} should match cols: {1}".format(
len(dts),
" ".join("{0}={1}".format(name, len(cols[name]))
for name in self.COL_NAMES)))
self._write_cols(sid, dts, cols, invalid_data_behavior)
|
python
|
def write_cols(self, sid, dts, cols, invalid_data_behavior='warn'):
"""
Write the OHLCV data for the given sid.
If there is no bcolz ctable yet created for the sid, create it.
If the length of the bcolz ctable is not exactly to the date before
the first day provided, fill the ctable with 0s up to that date.
Parameters
----------
sid : int
The asset identifier for the data being written.
dts : datetime64 array
The dts corresponding to values in cols.
cols : dict of str -> np.array
dict of market data with the following characteristics.
keys are ('open', 'high', 'low', 'close', 'volume')
open : float64
high : float64
low : float64
close : float64
volume : float64|int64
"""
if not all(len(dts) == len(cols[name]) for name in self.COL_NAMES):
raise BcolzMinuteWriterColumnMismatch(
"Length of dts={0} should match cols: {1}".format(
len(dts),
" ".join("{0}={1}".format(name, len(cols[name]))
for name in self.COL_NAMES)))
self._write_cols(sid, dts, cols, invalid_data_behavior)
|
[
"def",
"write_cols",
"(",
"self",
",",
"sid",
",",
"dts",
",",
"cols",
",",
"invalid_data_behavior",
"=",
"'warn'",
")",
":",
"if",
"not",
"all",
"(",
"len",
"(",
"dts",
")",
"==",
"len",
"(",
"cols",
"[",
"name",
"]",
")",
"for",
"name",
"in",
"self",
".",
"COL_NAMES",
")",
":",
"raise",
"BcolzMinuteWriterColumnMismatch",
"(",
"\"Length of dts={0} should match cols: {1}\"",
".",
"format",
"(",
"len",
"(",
"dts",
")",
",",
"\" \"",
".",
"join",
"(",
"\"{0}={1}\"",
".",
"format",
"(",
"name",
",",
"len",
"(",
"cols",
"[",
"name",
"]",
")",
")",
"for",
"name",
"in",
"self",
".",
"COL_NAMES",
")",
")",
")",
"self",
".",
"_write_cols",
"(",
"sid",
",",
"dts",
",",
"cols",
",",
"invalid_data_behavior",
")"
] |
Write the OHLCV data for the given sid.
If there is no bcolz ctable yet created for the sid, create it.
If the length of the bcolz ctable is not exactly to the date before
the first day provided, fill the ctable with 0s up to that date.
Parameters
----------
sid : int
The asset identifier for the data being written.
dts : datetime64 array
The dts corresponding to values in cols.
cols : dict of str -> np.array
dict of market data with the following characteristics.
keys are ('open', 'high', 'low', 'close', 'volume')
open : float64
high : float64
low : float64
close : float64
volume : float64|int64
|
[
"Write",
"the",
"OHLCV",
"data",
"for",
"the",
"given",
"sid",
".",
"If",
"there",
"is",
"no",
"bcolz",
"ctable",
"yet",
"created",
"for",
"the",
"sid",
"create",
"it",
".",
"If",
"the",
"length",
"of",
"the",
"bcolz",
"ctable",
"is",
"not",
"exactly",
"to",
"the",
"date",
"before",
"the",
"first",
"day",
"provided",
"fill",
"the",
"ctable",
"with",
"0s",
"up",
"to",
"that",
"date",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L732-L760
|
train
|
Writes the columns of the given attributes to the bcolz ctable.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qq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Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(281 - 233) + chr(0b1101111) + '\x33' + chr(0b110110) + chr(0b101010 + 0o7), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1010 + 0o50) + chr(1563 - 1513) + chr(413 - 359), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110110) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(9968 - 9857) + chr(1011 - 962) + chr(0b11100 + 0o24) + chr(1885 - 1835), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1010 + 0o145) + chr(0b110011) + chr(0b110000) + chr(0b10011 + 0o37), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(2392 - 2342) + '\062' + '\x35', 0o10), ehT0Px3KOsy9('\060' + chr(0b1011110 + 0o21) + chr(0b11110 + 0o25) + '\063' + chr(430 - 376), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + '\x33', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(2360 - 2305) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(0b110001) + chr(0b1111 + 0o50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1011 + 0o144) + chr(49) + chr(625 - 571) + '\x30', 0b1000), ehT0Px3KOsy9(chr(1167 - 1119) + chr(0b1100010 + 0o15) + chr(0b1011 + 0o46) + '\x37' + chr(0b101000 + 0o15), ord("\x08")), ehT0Px3KOsy9(chr(305 - 257) + chr(0b1001 + 0o146) + '\062' + chr(54) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(1728 - 1680) + '\157' + chr(0b110001) + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100101 + 0o112) + chr(0b110001) + chr(0b110000) + chr(53), 0b1000), ehT0Px3KOsy9(chr(1103 - 1055) + chr(111) + chr(0b110100) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011 + 0o0) + chr(51), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(0b1111 + 0o42) + chr(52), 34062 - 34054), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + chr(0b110001) + '\065' + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + '\x36' + '\x30', 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11101 + 0o25) + '\063' + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + '\064' + '\066', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + '\066' + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110110) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + chr(10106 - 9995) + chr(774 - 720) + '\067', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(2483 - 2429) + chr(261 - 213), 8), ehT0Px3KOsy9(chr(959 - 911) + chr(0b1011100 + 0o23) + '\x31' + '\066' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(364 - 316) + chr(0b1000 + 0o147) + '\x33' + '\067' + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(0b110010) + chr(50), 12534 - 12526), ehT0Px3KOsy9(chr(0b110000) + chr(4105 - 3994) + chr(0b110001) + chr(0b10100 + 0o34) + chr(0b110010), 8), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(111) + chr(372 - 321) + chr(0b101110 + 0o2) + chr(0b110000), 0o10), ehT0Px3KOsy9('\x30' + chr(7079 - 6968) + '\063' + '\060' + chr(0b110010 + 0o0), 8), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1001010 + 0o45) + '\x33' + chr(0b110101) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(930 - 880) + chr(0b100010 + 0o25) + chr(52), 17640 - 17632), ehT0Px3KOsy9(chr(351 - 303) + chr(111) + '\063' + chr(2011 - 1963) + chr(0b101100 + 0o12), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(49) + '\x31', 42308 - 42300), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b101010 + 0o12) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\157' + '\067', 17001 - 16993), ehT0Px3KOsy9(chr(1640 - 1592) + chr(8611 - 8500) + chr(2176 - 2125) + chr(55) + chr(1572 - 1517), 39099 - 39091), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b101011 + 0o104) + chr(0b11100 + 0o27) + '\063' + chr(0b110010), 16509 - 16501)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1668 - 1620) + '\x6f' + '\065' + chr(0b100010 + 0o16), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf'), '\x64' + '\x65' + chr(2511 - 2412) + chr(111) + chr(0b1100100) + '\145')(chr(12066 - 11949) + chr(116) + '\146' + '\055' + chr(1448 - 1392)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def xYGYZi3kIt0H(oVre8I6UXc3b, Cli4Sf5HnGOS, f5Ww7tOW_bKL, AIgvIWQd9onz, cR28UAwBtSml=xafqLlk3kkUe(SXOLrMavuUCe(b'\x86\xf7B,'), '\x64' + '\145' + chr(6097 - 5998) + chr(0b1101100 + 0o3) + chr(0b1100100) + chr(2184 - 2083))(chr(0b111 + 0o156) + chr(0b1101001 + 0o13) + chr(102) + '\055' + '\070')):
if not Dl48nj1rbi23((c2A0yzQpDQB3(f5Ww7tOW_bKL) == c2A0yzQpDQB3(AIgvIWQd9onz[AIvJRzLdDfgF]) for AIvJRzLdDfgF in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2\xd9|\x1d\x8c\xd4\x93^o'), chr(100) + '\145' + '\143' + '\x6f' + chr(0b1100100) + '\x65')(chr(117) + chr(0b111101 + 0o67) + chr(0b1100110) + '\x2d' + chr(1747 - 1691))))):
raise yXTO3drt02yw(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\xf3^%\xb6\xfd\xfetZ/\x14\t\xc47>\x16fl\x1aX\xf4\x13\x1eU\x17]\x16\x89\xb1*\xe0\xa1\x86\xd0\xb5sB|\xce\xa7'), chr(100) + chr(0b1000 + 0o135) + chr(0b11010 + 0o111) + '\157' + chr(0b101111 + 0o65) + chr(5236 - 5135))(chr(117) + '\164' + chr(102) + chr(0b100101 + 0o10) + chr(823 - 767)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7\xa2B-\x8a\xf4\x8d(l\x7f\x15\x17'), '\x64' + chr(7964 - 7863) + chr(4615 - 4516) + '\157' + chr(4318 - 4218) + chr(5779 - 5678))('\x75' + chr(116) + chr(0b1100110) + chr(0b10001 + 0o34) + chr(56)))(c2A0yzQpDQB3(f5Ww7tOW_bKL), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd1'), '\x64' + chr(0b101110 + 0o67) + chr(6387 - 6288) + chr(4813 - 4702) + '\x64' + '\x65')('\165' + chr(0b1110100) + '\x66' + chr(0b1101 + 0o40) + chr(3112 - 3056)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xf9g\x1a\xb8\xe1\x88UR~8;'), '\x64' + '\x65' + chr(0b1000010 + 0o41) + '\x6f' + chr(100) + chr(101))(chr(117) + chr(10712 - 10596) + chr(4489 - 4387) + chr(45) + '\070'))((xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a\xa6M\x7f\xb9\xa4\xa3'), chr(100) + chr(7752 - 7651) + chr(99) + chr(0b1010110 + 0o31) + chr(8565 - 8465) + '\145')(chr(1415 - 1298) + '\164' + chr(0b1100110) + '\x2d' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7\xa2B-\x8a\xf4\x8d(l\x7f\x15\x17'), '\144' + '\145' + '\143' + chr(0b1011 + 0o144) + '\x64' + chr(101))(chr(117) + chr(116) + '\x66' + chr(0b101 + 0o50) + '\070'))(AIvJRzLdDfgF, c2A0yzQpDQB3(AIgvIWQd9onz[AIvJRzLdDfgF])) for AIvJRzLdDfgF in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2\xd9|\x1d\x8c\xd4\x93^o'), '\x64' + '\145' + chr(5284 - 5185) + '\157' + '\x64' + '\x65')(chr(7061 - 6944) + chr(0b1110100) + chr(9795 - 9693) + chr(0b11101 + 0o20) + chr(0b111000)))))))
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xe1B+\xb6\xf0\x81xSc\x03'), '\144' + chr(0b1010100 + 0o21) + '\143' + '\x6f' + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(4763 - 4647) + chr(0b1100110) + '\055' + chr(0b111000)))(Cli4Sf5HnGOS, f5Ww7tOW_bKL, AIgvIWQd9onz, cR28UAwBtSml)
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter._write_cols
|
def _write_cols(self, sid, dts, cols, invalid_data_behavior):
"""
Internal method for `write_cols` and `write`.
Parameters
----------
sid : int
The asset identifier for the data being written.
dts : datetime64 array
The dts corresponding to values in cols.
cols : dict of str -> np.array
dict of market data with the following characteristics.
keys are ('open', 'high', 'low', 'close', 'volume')
open : float64
high : float64
low : float64
close : float64
volume : float64|int64
"""
table = self._ensure_ctable(sid)
tds = self._session_labels
input_first_day = self._calendar.minute_to_session_label(
pd.Timestamp(dts[0]), direction='previous')
last_date = self.last_date_in_output_for_sid(sid)
day_before_input = input_first_day - tds.freq
self.pad(sid, day_before_input)
table = self._ensure_ctable(sid)
# Get the number of minutes already recorded in this sid's ctable
num_rec_mins = table.size
all_minutes = self._minute_index
# Get the latest minute we wish to write to the ctable
last_minute_to_write = pd.Timestamp(dts[-1], tz='UTC')
# In the event that we've already written some minutely data to the
# ctable, guard against overwriting that data.
if num_rec_mins > 0:
last_recorded_minute = all_minutes[num_rec_mins - 1]
if last_minute_to_write <= last_recorded_minute:
raise BcolzMinuteOverlappingData(dedent("""
Data with last_date={0} already includes input start={1} for
sid={2}""".strip()).format(last_date, input_first_day, sid))
latest_min_count = all_minutes.get_loc(last_minute_to_write)
# Get all the minutes we wish to write (all market minutes after the
# latest currently written, up to and including last_minute_to_write)
all_minutes_in_window = all_minutes[num_rec_mins:latest_min_count + 1]
minutes_count = all_minutes_in_window.size
open_col = np.zeros(minutes_count, dtype=np.uint32)
high_col = np.zeros(minutes_count, dtype=np.uint32)
low_col = np.zeros(minutes_count, dtype=np.uint32)
close_col = np.zeros(minutes_count, dtype=np.uint32)
vol_col = np.zeros(minutes_count, dtype=np.uint32)
dt_ixs = np.searchsorted(all_minutes_in_window.values,
dts.astype('datetime64[ns]'))
ohlc_ratio = self.ohlc_ratio_for_sid(sid)
(
open_col[dt_ixs],
high_col[dt_ixs],
low_col[dt_ixs],
close_col[dt_ixs],
vol_col[dt_ixs],
) = convert_cols(cols, ohlc_ratio, sid, invalid_data_behavior)
table.append([
open_col,
high_col,
low_col,
close_col,
vol_col
])
table.flush()
|
python
|
def _write_cols(self, sid, dts, cols, invalid_data_behavior):
"""
Internal method for `write_cols` and `write`.
Parameters
----------
sid : int
The asset identifier for the data being written.
dts : datetime64 array
The dts corresponding to values in cols.
cols : dict of str -> np.array
dict of market data with the following characteristics.
keys are ('open', 'high', 'low', 'close', 'volume')
open : float64
high : float64
low : float64
close : float64
volume : float64|int64
"""
table = self._ensure_ctable(sid)
tds = self._session_labels
input_first_day = self._calendar.minute_to_session_label(
pd.Timestamp(dts[0]), direction='previous')
last_date = self.last_date_in_output_for_sid(sid)
day_before_input = input_first_day - tds.freq
self.pad(sid, day_before_input)
table = self._ensure_ctable(sid)
# Get the number of minutes already recorded in this sid's ctable
num_rec_mins = table.size
all_minutes = self._minute_index
# Get the latest minute we wish to write to the ctable
last_minute_to_write = pd.Timestamp(dts[-1], tz='UTC')
# In the event that we've already written some minutely data to the
# ctable, guard against overwriting that data.
if num_rec_mins > 0:
last_recorded_minute = all_minutes[num_rec_mins - 1]
if last_minute_to_write <= last_recorded_minute:
raise BcolzMinuteOverlappingData(dedent("""
Data with last_date={0} already includes input start={1} for
sid={2}""".strip()).format(last_date, input_first_day, sid))
latest_min_count = all_minutes.get_loc(last_minute_to_write)
# Get all the minutes we wish to write (all market minutes after the
# latest currently written, up to and including last_minute_to_write)
all_minutes_in_window = all_minutes[num_rec_mins:latest_min_count + 1]
minutes_count = all_minutes_in_window.size
open_col = np.zeros(minutes_count, dtype=np.uint32)
high_col = np.zeros(minutes_count, dtype=np.uint32)
low_col = np.zeros(minutes_count, dtype=np.uint32)
close_col = np.zeros(minutes_count, dtype=np.uint32)
vol_col = np.zeros(minutes_count, dtype=np.uint32)
dt_ixs = np.searchsorted(all_minutes_in_window.values,
dts.astype('datetime64[ns]'))
ohlc_ratio = self.ohlc_ratio_for_sid(sid)
(
open_col[dt_ixs],
high_col[dt_ixs],
low_col[dt_ixs],
close_col[dt_ixs],
vol_col[dt_ixs],
) = convert_cols(cols, ohlc_ratio, sid, invalid_data_behavior)
table.append([
open_col,
high_col,
low_col,
close_col,
vol_col
])
table.flush()
|
[
"def",
"_write_cols",
"(",
"self",
",",
"sid",
",",
"dts",
",",
"cols",
",",
"invalid_data_behavior",
")",
":",
"table",
"=",
"self",
".",
"_ensure_ctable",
"(",
"sid",
")",
"tds",
"=",
"self",
".",
"_session_labels",
"input_first_day",
"=",
"self",
".",
"_calendar",
".",
"minute_to_session_label",
"(",
"pd",
".",
"Timestamp",
"(",
"dts",
"[",
"0",
"]",
")",
",",
"direction",
"=",
"'previous'",
")",
"last_date",
"=",
"self",
".",
"last_date_in_output_for_sid",
"(",
"sid",
")",
"day_before_input",
"=",
"input_first_day",
"-",
"tds",
".",
"freq",
"self",
".",
"pad",
"(",
"sid",
",",
"day_before_input",
")",
"table",
"=",
"self",
".",
"_ensure_ctable",
"(",
"sid",
")",
"# Get the number of minutes already recorded in this sid's ctable",
"num_rec_mins",
"=",
"table",
".",
"size",
"all_minutes",
"=",
"self",
".",
"_minute_index",
"# Get the latest minute we wish to write to the ctable",
"last_minute_to_write",
"=",
"pd",
".",
"Timestamp",
"(",
"dts",
"[",
"-",
"1",
"]",
",",
"tz",
"=",
"'UTC'",
")",
"# In the event that we've already written some minutely data to the",
"# ctable, guard against overwriting that data.",
"if",
"num_rec_mins",
">",
"0",
":",
"last_recorded_minute",
"=",
"all_minutes",
"[",
"num_rec_mins",
"-",
"1",
"]",
"if",
"last_minute_to_write",
"<=",
"last_recorded_minute",
":",
"raise",
"BcolzMinuteOverlappingData",
"(",
"dedent",
"(",
"\"\"\"\n Data with last_date={0} already includes input start={1} for\n sid={2}\"\"\"",
".",
"strip",
"(",
")",
")",
".",
"format",
"(",
"last_date",
",",
"input_first_day",
",",
"sid",
")",
")",
"latest_min_count",
"=",
"all_minutes",
".",
"get_loc",
"(",
"last_minute_to_write",
")",
"# Get all the minutes we wish to write (all market minutes after the",
"# latest currently written, up to and including last_minute_to_write)",
"all_minutes_in_window",
"=",
"all_minutes",
"[",
"num_rec_mins",
":",
"latest_min_count",
"+",
"1",
"]",
"minutes_count",
"=",
"all_minutes_in_window",
".",
"size",
"open_col",
"=",
"np",
".",
"zeros",
"(",
"minutes_count",
",",
"dtype",
"=",
"np",
".",
"uint32",
")",
"high_col",
"=",
"np",
".",
"zeros",
"(",
"minutes_count",
",",
"dtype",
"=",
"np",
".",
"uint32",
")",
"low_col",
"=",
"np",
".",
"zeros",
"(",
"minutes_count",
",",
"dtype",
"=",
"np",
".",
"uint32",
")",
"close_col",
"=",
"np",
".",
"zeros",
"(",
"minutes_count",
",",
"dtype",
"=",
"np",
".",
"uint32",
")",
"vol_col",
"=",
"np",
".",
"zeros",
"(",
"minutes_count",
",",
"dtype",
"=",
"np",
".",
"uint32",
")",
"dt_ixs",
"=",
"np",
".",
"searchsorted",
"(",
"all_minutes_in_window",
".",
"values",
",",
"dts",
".",
"astype",
"(",
"'datetime64[ns]'",
")",
")",
"ohlc_ratio",
"=",
"self",
".",
"ohlc_ratio_for_sid",
"(",
"sid",
")",
"(",
"open_col",
"[",
"dt_ixs",
"]",
",",
"high_col",
"[",
"dt_ixs",
"]",
",",
"low_col",
"[",
"dt_ixs",
"]",
",",
"close_col",
"[",
"dt_ixs",
"]",
",",
"vol_col",
"[",
"dt_ixs",
"]",
",",
")",
"=",
"convert_cols",
"(",
"cols",
",",
"ohlc_ratio",
",",
"sid",
",",
"invalid_data_behavior",
")",
"table",
".",
"append",
"(",
"[",
"open_col",
",",
"high_col",
",",
"low_col",
",",
"close_col",
",",
"vol_col",
"]",
")",
"table",
".",
"flush",
"(",
")"
] |
Internal method for `write_cols` and `write`.
Parameters
----------
sid : int
The asset identifier for the data being written.
dts : datetime64 array
The dts corresponding to values in cols.
cols : dict of str -> np.array
dict of market data with the following characteristics.
keys are ('open', 'high', 'low', 'close', 'volume')
open : float64
high : float64
low : float64
close : float64
volume : float64|int64
|
[
"Internal",
"method",
"for",
"write_cols",
"and",
"write",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zip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S7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b11001 + 0o126) + chr(52) + chr(277 - 226), 61514 - 61506), ehT0Px3KOsy9('\x30' + chr(0b1011110 + 0o21) + chr(50) + chr(939 - 887) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + '\x32' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b111110 + 0o61) + '\x31' + chr(0b110101) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(3034 - 2923) + chr(0b100001 + 0o20) + chr(1149 - 1098) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\065' + chr(0b11100 + 0o30), 17172 - 17164), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(0b110001) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101000 + 0o7) + '\x31' + '\x31' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11110 + 0o31) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(48) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110101) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11000 + 0o32) + chr(55) + chr(0b11011 + 0o25), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(1714 - 1662) + chr(0b1101 + 0o47), 2564 - 2556), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110 + 0o53) + chr(0b110110) + chr(1520 - 1466), 62624 - 62616), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101101 + 0o5) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(2240 - 2192) + chr(0b1001 + 0o146) + '\x34' + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2209 - 2160) + chr(53) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b110000 + 0o77) + chr(53) + chr(112 - 62), 8), ehT0Px3KOsy9('\x30' + chr(11874 - 11763) + chr(1733 - 1683) + chr(0b110011) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1010001 + 0o36) + '\061' + '\x35' + chr(0b110100), 8), ehT0Px3KOsy9(chr(579 - 531) + chr(111) + '\x31' + chr(50) + chr(0b101001 + 0o10), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7774 - 7663) + '\063' + chr(0b110000 + 0o4) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + chr(11191 - 11080) + chr(0b110011) + '\060' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\157' + chr(0b110011) + '\064' + '\x37', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010 + 0o0) + chr(1112 - 1062) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(1455 - 1406) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + chr(0b110010) + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\063' + chr(695 - 641), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(49) + '\x34', 23272 - 23264), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\x6f' + chr(53) + chr(1381 - 1329), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2310 - 2260) + chr(1463 - 1413) + '\062', 47696 - 47688), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(0b1101 + 0o43) + chr(1919 - 1864), 0b1000), ehT0Px3KOsy9('\x30' + chr(8613 - 8502) + chr(0b110011) + '\x30' + chr(0b110100), 8), ehT0Px3KOsy9(chr(1122 - 1074) + '\x6f' + chr(326 - 277) + chr(0b110100) + '\066', 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + '\062' + chr(48) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\x30' + chr(10463 - 10352) + '\062' + chr(50) + '\062', 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(49) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + '\x32' + chr(0b100 + 0o62) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\x6f' + chr(51) + chr(488 - 437) + chr(2438 - 2384), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + chr(53) + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\r'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(111) + chr(0b11001 + 0o113) + '\x65')(chr(0b1110101) + '\164' + chr(0b1100110) + chr(784 - 739) + chr(2898 - 2842)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def WJQUXv1DYOLt(oVre8I6UXc3b, Cli4Sf5HnGOS, f5Ww7tOW_bKL, AIgvIWQd9onz, cR28UAwBtSml):
YbLi4ide0_3E = oVre8I6UXc3b._ensure_ctable(Cli4Sf5HnGOS)
vziqQXSwuqQo = oVre8I6UXc3b._session_labels
ugLZXrRtvhnJ = oVre8I6UXc3b._calendar.minute_to_session_label(dubtF9GfzOdC.Timestamp(f5Ww7tOW_bKL[ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\157' + '\060', ord("\x08"))]), direction=xafqLlk3kkUe(SXOLrMavuUCe(b'S\xd5\xb7\x1a4C\xfbd'), chr(1089 - 989) + chr(101) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(0b1110 + 0o147) + chr(0b1110100) + chr(0b1000101 + 0o41) + chr(1798 - 1753) + '\070'))
wMWA42oTQSts = oVre8I6UXc3b.last_date_in_output_for_sid(Cli4Sf5HnGOS)
mSe3lTY2XJsl = ugLZXrRtvhnJ - vziqQXSwuqQo.ha8aTvyciPGb
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'I\xd6\xe2/jX\xfaz;g\x15y'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\x6f' + '\x64' + '\145')(chr(0b100 + 0o161) + '\x74' + '\146' + '\x2d' + chr(0b1011 + 0o55)))(Cli4Sf5HnGOS, mSe3lTY2XJsl)
YbLi4ide0_3E = oVre8I6UXc3b._ensure_ctable(Cli4Sf5HnGOS)
KSgZQZC2ZRBF = YbLi4ide0_3E.NLcc3BCJnQka
HBepccutmfGl = oVre8I6UXc3b._minute_index
y064n5ohaTSz = dubtF9GfzOdC.Timestamp(f5Ww7tOW_bKL[-ehT0Px3KOsy9('\x30' + chr(7825 - 7714) + chr(1537 - 1488), ord("\x08"))], tz=xafqLlk3kkUe(SXOLrMavuUCe(b'v\xf3\x91'), chr(100) + chr(6697 - 6596) + chr(0b1000111 + 0o34) + chr(0b1101111) + chr(0b111111 + 0o45) + chr(0b1100101))('\165' + chr(0b100100 + 0o120) + chr(0b1100110) + '\055' + chr(0b111000)))
if KSgZQZC2ZRBF > ehT0Px3KOsy9(chr(843 - 795) + chr(0b1101111) + '\060', 8):
HIjUBl7E_gv5 = HBepccutmfGl[KSgZQZC2ZRBF - ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101110 + 0o1) + '\x31', 8)]
if y064n5ohaTSz <= HIjUBl7E_gv5:
raise aL3Jz_uuW9LI(xafqLlk3kkUe(ojh11Z5rxCFF(xafqLlk3kkUe(SXOLrMavuUCe(b')\x87\xf2L}\x0c\xae7j\x1fe\n\x98\x04V4\x05,K\xec\rq\x95\xad\x93\xfc\xad\x7f\xbf\xffX\xcd\xa3\xa5\x12\xe3\xaf\xf3\x83\xa3\x03\xc6\xbe\x1e8M\xeanjV+I\xd4Q\x12qVHC\xf6\x1c$\x96\xe4\x94\xe0\xeca\xaa\xb1W\xa3\xba\xe4\x00\xe9\xe0\x82\x93\xfe\x03\x87\xf2L}\x0c\xae7j\x1fe\n\x98\x04\x05}AUQ\xaa\x11'), chr(0b1100100) + '\145' + '\143' + '\157' + chr(100) + chr(0b1100101))('\165' + chr(2413 - 2297) + chr(8210 - 8108) + chr(0b101101) + chr(0b101111 + 0o11)).strip()), xafqLlk3kkUe(SXOLrMavuUCe(b'u\x93\xa0\x03\x15M\xdd$\x1aO @'), chr(4124 - 4024) + chr(9205 - 9104) + '\x63' + chr(0b1101111 + 0o0) + chr(0b1001100 + 0o30) + chr(0b110101 + 0o60))('\x75' + chr(0b1110100) + '\146' + '\x2d' + '\070'))(wMWA42oTQSts, ugLZXrRtvhnJ, Cli4Sf5HnGOS))
nmhtvnJu5jiw = HBepccutmfGl.get_loc(y064n5ohaTSz)
xxrd4u0BIn46 = HBepccutmfGl[KSgZQZC2ZRBF:nmhtvnJu5jiw + ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b101000 + 0o107) + chr(0b110001), 8)]
UkjT5CAvyE5x = xxrd4u0BIn46.NLcc3BCJnQka
giQNJUxb6LOP = WqUC3KWvYVup.zeros(UkjT5CAvyE5x, dtype=WqUC3KWvYVup.uint32)
bG0GEsnV_x8t = WqUC3KWvYVup.zeros(UkjT5CAvyE5x, dtype=WqUC3KWvYVup.uint32)
pSFzd8J1fcV3 = WqUC3KWvYVup.zeros(UkjT5CAvyE5x, dtype=WqUC3KWvYVup.uint32)
vo83oJtFLOLP = WqUC3KWvYVup.zeros(UkjT5CAvyE5x, dtype=WqUC3KWvYVup.uint32)
Ly34tG1bik5i = WqUC3KWvYVup.zeros(UkjT5CAvyE5x, dtype=WqUC3KWvYVup.uint32)
iX7sLQw_15Gp = WqUC3KWvYVup.searchsorted(xxrd4u0BIn46.SPnCNu54H1db, f5Ww7tOW_bKL.astype(xafqLlk3kkUe(SXOLrMavuUCe(b'G\xc6\xa6\t)E\xe3r|\x0b\x1eD\xcby'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(0b11000 + 0o127) + chr(0b11001 + 0o113) + '\145')(chr(117) + chr(0b111001 + 0o73) + chr(0b1100110) + chr(0b101101) + chr(553 - 497))))
e09z13O4ZtXV = oVre8I6UXc3b.ohlc_ratio_for_sid(Cli4Sf5HnGOS)
(giQNJUxb6LOP[iX7sLQw_15Gp], bG0GEsnV_x8t[iX7sLQw_15Gp], pSFzd8J1fcV3[iX7sLQw_15Gp], vo83oJtFLOLP[iX7sLQw_15Gp], Ly34tG1bik5i[iX7sLQw_15Gp]) = _Hy_Io2AL3wE(AIgvIWQd9onz, e09z13O4ZtXV, Cli4Sf5HnGOS, cR28UAwBtSml)
xafqLlk3kkUe(YbLi4ide0_3E, xafqLlk3kkUe(SXOLrMavuUCe(b'B\xd7\xa2\t3H'), '\144' + '\145' + '\143' + chr(6537 - 6426) + '\x64' + '\145')(chr(7004 - 6887) + chr(116) + '\146' + chr(0b1010 + 0o43) + chr(56)))([giQNJUxb6LOP, bG0GEsnV_x8t, pSFzd8J1fcV3, vo83oJtFLOLP, Ly34tG1bik5i])
xafqLlk3kkUe(YbLi4ide0_3E, xafqLlk3kkUe(SXOLrMavuUCe(b'E\xcb\xa7\x1f5'), '\144' + '\x65' + chr(8625 - 8526) + chr(5076 - 4965) + '\144' + chr(101))(chr(2548 - 2431) + chr(0b100011 + 0o121) + '\x66' + chr(1036 - 991) + chr(0b110101 + 0o3)))()
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter.data_len_for_day
|
def data_len_for_day(self, day):
"""
Return the number of data points up to and including the
provided day.
"""
day_ix = self._session_labels.get_loc(day)
# Add one to the 0-indexed day_ix to get the number of days.
num_days = day_ix + 1
return num_days * self._minutes_per_day
|
python
|
def data_len_for_day(self, day):
"""
Return the number of data points up to and including the
provided day.
"""
day_ix = self._session_labels.get_loc(day)
# Add one to the 0-indexed day_ix to get the number of days.
num_days = day_ix + 1
return num_days * self._minutes_per_day
|
[
"def",
"data_len_for_day",
"(",
"self",
",",
"day",
")",
":",
"day_ix",
"=",
"self",
".",
"_session_labels",
".",
"get_loc",
"(",
"day",
")",
"# Add one to the 0-indexed day_ix to get the number of days.",
"num_days",
"=",
"day_ix",
"+",
"1",
"return",
"num_days",
"*",
"self",
".",
"_minutes_per_day"
] |
Return the number of data points up to and including the
provided day.
|
[
"Return",
"the",
"number",
"of",
"data",
"points",
"up",
"to",
"and",
"including",
"the",
"provided",
"day",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L846-L854
|
train
|
Return the number of data points up to and including the provided day.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1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,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2068 - 2018) + '\066' + chr(52), 35993 - 35985), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + chr(0b110001) + chr(2228 - 2178) + chr(0b1000 + 0o57), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(0b1000 + 0o56) + '\061', 63413 - 63405), ehT0Px3KOsy9(chr(237 - 189) + chr(0b1100000 + 0o17) + chr(51) + '\x32' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(5593 - 5482) + '\x33' + '\067' + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + chr(9848 - 9737) + chr(2073 - 2022) + chr(0b110111) + '\x35', 29950 - 29942), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1100000 + 0o17) + '\x31' + chr(0b1000 + 0o51) + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(8249 - 8138) + '\061' + '\066' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(3220 - 3109) + chr(51) + '\067' + '\x37', 49865 - 49857), ehT0Px3KOsy9('\060' + '\157' + chr(1895 - 1844) + chr(0b110011 + 0o3) + '\065', 42380 - 42372), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + '\061' + chr(0b110101) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(4807 - 4696) + '\062' + '\x30' + chr(49), 8309 - 8301), ehT0Px3KOsy9(chr(48) + chr(0b1010100 + 0o33) + chr(1412 - 1361) + chr(512 - 462) + '\067', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11101 + 0o30) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(1243 - 1195) + chr(2448 - 2394), 30822 - 30814), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(204 - 150) + chr(1752 - 1698), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + '\x33' + '\x36' + chr(0b11110 + 0o22), 37280 - 37272), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + '\061' + chr(1294 - 1244) + chr(51), 0b1000), ehT0Px3KOsy9(chr(1154 - 1106) + chr(0b1101111) + '\063' + chr(1141 - 1093) + chr(49), 0b1000), ehT0Px3KOsy9(chr(1811 - 1763) + chr(0b100010 + 0o115) + '\062' + '\x31' + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + '\065' + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1227 - 1178) + '\060' + chr(1757 - 1702), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b10110 + 0o131) + '\063' + '\x31' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010010 + 0o35) + '\066' + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b111101 + 0o62) + chr(0b110010) + chr(687 - 633) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(111) + '\x31' + chr(0b110100 + 0o3) + '\064', 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(2023 - 1912) + chr(50) + chr(0b110 + 0o53) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(602 - 552) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(10791 - 10680) + chr(1161 - 1110) + chr(52) + chr(48), 0o10), ehT0Px3KOsy9(chr(469 - 421) + chr(0b1101111) + chr(1159 - 1109) + chr(0b110001) + '\x35', 8), ehT0Px3KOsy9(chr(247 - 199) + '\x6f' + '\063' + '\063' + chr(60 - 9), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\062' + chr(0b110011), 8), ehT0Px3KOsy9(chr(1403 - 1355) + chr(8254 - 8143) + chr(49) + chr(2579 - 2524) + chr(0b110001), 23221 - 23213), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(439 - 388) + chr(52) + chr(0b11011 + 0o32), 18150 - 18142), ehT0Px3KOsy9(chr(1707 - 1659) + chr(12021 - 11910) + '\x31' + '\067' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11111 + 0o26) + chr(0b110010 + 0o5), 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(10220 - 10109) + '\x31' + chr(0b100101 + 0o17) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(8560 - 8449) + chr(0b101011 + 0o10) + '\x37' + chr(0b100111 + 0o13), 8), ehT0Px3KOsy9(chr(1592 - 1544) + '\x6f' + chr(0b110011) + chr(0b10010 + 0o42) + chr(0b110100), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1000001 + 0o56) + chr(0b11000 + 0o35) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x9a'), chr(100) + chr(7486 - 7385) + chr(1742 - 1643) + chr(0b1101111) + chr(0b1100100) + chr(826 - 725))('\x75' + chr(0b111000 + 0o74) + '\146' + chr(45) + chr(0b101000 + 0o20)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def KNH2ag0ULHub(oVre8I6UXc3b, Y8Mo1TTYaa7l):
nOf30L4UDibz = oVre8I6UXc3b._session_labels.get_loc(Y8Mo1TTYaa7l)
VTOQxbU0lZxg = nOf30L4UDibz + ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\x6f' + chr(0b110001), 8)
return VTOQxbU0lZxg * xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xeb:\x18\xb9\x8f\x89-\x00\xa0\x85\x0e\xf3\x88L\xe7\x0f'), '\144' + chr(9507 - 9406) + '\143' + chr(4710 - 4599) + chr(0b1100100) + chr(0b1100101))('\x75' + chr(10195 - 10079) + '\x66' + chr(45) + '\070'))
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarWriter.truncate
|
def truncate(self, date):
"""Truncate data beyond this date in all ctables."""
truncate_slice_end = self.data_len_for_day(date)
glob_path = os.path.join(self._rootdir, "*", "*", "*.bcolz")
sid_paths = sorted(glob(glob_path))
for sid_path in sid_paths:
file_name = os.path.basename(sid_path)
try:
table = bcolz.open(rootdir=sid_path)
except IOError:
continue
if table.len <= truncate_slice_end:
logger.info("{0} not past truncate date={1}.", file_name, date)
continue
logger.info(
"Truncating {0} at end_date={1}", file_name, date.date()
)
table.resize(truncate_slice_end)
# Update end session in metadata.
metadata = BcolzMinuteBarMetadata.read(self._rootdir)
metadata.end_session = date
metadata.write(self._rootdir)
|
python
|
def truncate(self, date):
"""Truncate data beyond this date in all ctables."""
truncate_slice_end = self.data_len_for_day(date)
glob_path = os.path.join(self._rootdir, "*", "*", "*.bcolz")
sid_paths = sorted(glob(glob_path))
for sid_path in sid_paths:
file_name = os.path.basename(sid_path)
try:
table = bcolz.open(rootdir=sid_path)
except IOError:
continue
if table.len <= truncate_slice_end:
logger.info("{0} not past truncate date={1}.", file_name, date)
continue
logger.info(
"Truncating {0} at end_date={1}", file_name, date.date()
)
table.resize(truncate_slice_end)
# Update end session in metadata.
metadata = BcolzMinuteBarMetadata.read(self._rootdir)
metadata.end_session = date
metadata.write(self._rootdir)
|
[
"def",
"truncate",
"(",
"self",
",",
"date",
")",
":",
"truncate_slice_end",
"=",
"self",
".",
"data_len_for_day",
"(",
"date",
")",
"glob_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_rootdir",
",",
"\"*\"",
",",
"\"*\"",
",",
"\"*.bcolz\"",
")",
"sid_paths",
"=",
"sorted",
"(",
"glob",
"(",
"glob_path",
")",
")",
"for",
"sid_path",
"in",
"sid_paths",
":",
"file_name",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"sid_path",
")",
"try",
":",
"table",
"=",
"bcolz",
".",
"open",
"(",
"rootdir",
"=",
"sid_path",
")",
"except",
"IOError",
":",
"continue",
"if",
"table",
".",
"len",
"<=",
"truncate_slice_end",
":",
"logger",
".",
"info",
"(",
"\"{0} not past truncate date={1}.\"",
",",
"file_name",
",",
"date",
")",
"continue",
"logger",
".",
"info",
"(",
"\"Truncating {0} at end_date={1}\"",
",",
"file_name",
",",
"date",
".",
"date",
"(",
")",
")",
"table",
".",
"resize",
"(",
"truncate_slice_end",
")",
"# Update end session in metadata.",
"metadata",
"=",
"BcolzMinuteBarMetadata",
".",
"read",
"(",
"self",
".",
"_rootdir",
")",
"metadata",
".",
"end_session",
"=",
"date",
"metadata",
".",
"write",
"(",
"self",
".",
"_rootdir",
")"
] |
Truncate data beyond this date in all ctables.
|
[
"Truncate",
"data",
"beyond",
"this",
"date",
"in",
"all",
"ctables",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L856-L883
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h7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1942 - 1894) + chr(111) + chr(50) + chr(0b11010 + 0o35), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(1236 - 1186) + '\060' + chr(0b110011), 60504 - 60496), ehT0Px3KOsy9(chr(2282 - 2234) + chr(0b1101111) + chr(0b110010) + chr(258 - 205) + chr(49), 0b1000), ehT0Px3KOsy9(chr(401 - 353) + chr(8830 - 8719) + chr(0b10000 + 0o43) + chr(0b110110) + '\067', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(627 - 572) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\067' + chr(846 - 793), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000011 + 0o54) + chr(0b100 + 0o55) + chr(0b10011 + 0o41), 1551 - 1543), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(0b110100) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(0b110010) + chr(1541 - 1489), 0b1000), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + chr(236 - 187) + '\x36' + chr(2387 - 2338), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + '\x34' + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(9297 - 9186) + chr(2192 - 2142) + chr(0b110001) + chr(285 - 235), 15391 - 15383), ehT0Px3KOsy9(chr(0b110000) + chr(8724 - 8613) + chr(0b110111) + chr(0b11000 + 0o30), 0o10), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(7903 - 7792) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + '\x32' + chr(0b110111) + chr(2299 - 2251), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010 + 0o0) + chr(0b101101 + 0o5) + chr(658 - 603), 0b1000), ehT0Px3KOsy9(chr(679 - 631) + chr(2448 - 2337) + chr(0b100001 + 0o20) + chr(51) + chr(2295 - 2247), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1100111 + 0o10) + chr(0b110010) + chr(54) + chr(0b0 + 0o65), 6234 - 6226), ehT0Px3KOsy9(chr(488 - 440) + chr(0b1100101 + 0o12) + chr(1020 - 971) + chr(51) + chr(1972 - 1919), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(104 - 54) + chr(0b110110) + chr(0b110101), 8), ehT0Px3KOsy9('\060' + chr(0b1001000 + 0o47) + '\062' + chr(0b101000 + 0o12) + chr(943 - 895), 0o10), ehT0Px3KOsy9('\x30' + chr(4820 - 4709) + '\x34' + '\x30', 62029 - 62021), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(111) + chr(49) + chr(783 - 732) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b101111 + 0o100) + chr(49) + chr(54) + chr(2194 - 2140), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + '\061' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(736 - 688) + chr(0b1000001 + 0o56) + chr(0b101101 + 0o4) + chr(179 - 129), 54256 - 54248), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + '\063' + '\x33' + chr(0b110010 + 0o5), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(12225 - 12114) + chr(2450 - 2398) + '\061', 65031 - 65023), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + '\x33' + '\x33' + chr(54), 0o10), ehT0Px3KOsy9(chr(1348 - 1300) + chr(0b1101111) + chr(1813 - 1763) + '\062' + chr(1639 - 1587), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4548 - 4437) + chr(818 - 767) + chr(2548 - 2495) + chr(668 - 619), 54411 - 54403), ehT0Px3KOsy9('\x30' + chr(10004 - 9893) + '\x33' + '\x35' + chr(0b11001 + 0o30), 8), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b1101111) + '\x31' + '\x30' + chr(0b1001 + 0o50), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101011 + 0o4) + chr(0b11 + 0o60) + chr(2217 - 2165), 0o10), ehT0Px3KOsy9(chr(595 - 547) + '\x6f' + chr(0b111 + 0o53) + chr(1188 - 1136) + chr(54), 8), ehT0Px3KOsy9(chr(880 - 832) + chr(7767 - 7656) + chr(252 - 201) + chr(0b110001) + '\060', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(0b110001) + chr(0b110011), 24418 - 24410), ehT0Px3KOsy9('\x30' + chr(11306 - 11195) + chr(49) + chr(0b110001) + '\065', 48710 - 48702), ehT0Px3KOsy9('\060' + '\x6f' + chr(2301 - 2250) + chr(0b100111 + 0o12) + chr(0b110000), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(5523 - 5412) + chr(0b101100 + 0o11) + chr(0b110000), 56068 - 56060)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'9'), '\x64' + chr(3540 - 3439) + '\143' + chr(1695 - 1584) + chr(100) + chr(0b1100101))(chr(11517 - 11400) + chr(0b101111 + 0o105) + chr(0b1100110) + chr(45) + chr(0b110 + 0o62)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Yq_nPL_1VyPl(oVre8I6UXc3b, J4aeFOr3sjPo):
sb80bz_BNf7W = oVre8I6UXc3b.data_len_for_day(J4aeFOr3sjPo)
I6N5mVz4hZy5 = oqhJDdMJfuwx.path._oWXztVNnqHF(oVre8I6UXc3b._rootdir, xafqLlk3kkUe(SXOLrMavuUCe(b'='), '\144' + chr(7992 - 7891) + chr(178 - 79) + chr(111) + '\x64' + chr(0b110 + 0o137))(chr(0b1110101) + '\164' + chr(0b1100110) + '\x2d' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'='), '\x64' + chr(0b110000 + 0o65) + chr(0b10100 + 0o117) + chr(111) + chr(3862 - 3762) + chr(0b1100101))(chr(3835 - 3718) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'=\xad\xcb\x94\x90Qv'), '\x64' + chr(101) + chr(99) + chr(0b1101111) + chr(0b1000 + 0o134) + chr(101))(chr(12942 - 12825) + chr(0b1110100) + chr(102) + chr(1663 - 1618) + '\070'))
XWqKlzqJ7Mzq = vUlqIvNSaRMa(jt2o3b6QEdP_(I6N5mVz4hZy5))
for EUjbJLSCdpoB in XWqKlzqJ7Mzq:
OK327sCYstzB = oqhJDdMJfuwx.path.g_1BfC8eoU5Q(EUjbJLSCdpoB)
try:
YbLi4ide0_3E = oxWyLaiFGvnT.open(rootdir=EUjbJLSCdpoB)
except sR2sPcm7Zrfn:
continue
if xafqLlk3kkUe(YbLi4ide0_3E, xafqLlk3kkUe(SXOLrMavuUCe(b'{\xe6\xc7'), chr(6930 - 6830) + chr(0b1100101) + '\143' + chr(3873 - 3762) + chr(1794 - 1694) + '\x65')(chr(0b11000 + 0o135) + chr(0b1110100) + chr(0b111111 + 0o47) + chr(0b10 + 0o53) + chr(2330 - 2274))) <= sb80bz_BNf7W:
xafqLlk3kkUe(hdK8qOUhR6Or, xafqLlk3kkUe(SXOLrMavuUCe(b'D\xb4\xe1\x8f\x8a^k\x95\xbe\x1d\xfci'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(10438 - 10327) + chr(1782 - 1682) + '\x65')('\x75' + '\164' + '\x66' + chr(0b10100 + 0o31) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'l\xb3\xd4\xd7\x91Rx\x82\xa4\x10\xd5v\xaaLq\xcd\xf9;\xd4)\xd0\xb0D:\x02\xa87\xa4\x10\xa3\xba'), chr(0b1100100) + chr(101) + chr(0b1011010 + 0o11) + chr(0b1101111) + '\x64' + '\145')('\x75' + chr(11783 - 11667) + chr(102) + '\055' + '\x38'), OK327sCYstzB, J4aeFOr3sjPo)
continue
xafqLlk3kkUe(hdK8qOUhR6Or, xafqLlk3kkUe(SXOLrMavuUCe(b'D\xb4\xe1\x8f\x8a^k\x95\xbe\x1d\xfci'), '\144' + chr(0b1100101) + '\143' + '\157' + chr(100) + chr(0b110110 + 0o57))('\x75' + chr(0b1110100) + chr(505 - 403) + chr(1940 - 1895) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'C\xf1\xdc\x99\x9c\\x\xcb\xba\x16\x86y\xbaE#\xd9\xe3x\xd03\xd1\xcfD:\x02\xa87\xa4\x10\xa3'), '\144' + '\145' + chr(0b1000010 + 0o41) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(0b1101000 + 0o15) + chr(5537 - 5421) + '\x66' + chr(0b101101 + 0o0) + '\x38'), OK327sCYstzB, xafqLlk3kkUe(J4aeFOr3sjPo, xafqLlk3kkUe(SXOLrMavuUCe(b's\xe2\xdd\x92'), chr(0b1100100) + chr(0b10110 + 0o117) + '\143' + chr(111) + '\x64' + '\145')(chr(0b11101 + 0o130) + chr(0b1110100) + '\146' + chr(228 - 183) + chr(1586 - 1530)))())
xafqLlk3kkUe(YbLi4ide0_3E, xafqLlk3kkUe(SXOLrMavuUCe(b'e\xe6\xda\x9e\x85X'), '\x64' + '\x65' + chr(315 - 216) + '\x6f' + chr(0b1100100) + chr(101))('\165' + chr(0b1110100) + chr(102) + chr(192 - 147) + chr(0b1000 + 0o60)))(sb80bz_BNf7W)
mU7wOAGoTnlM = s5FpdwikV4nK.U6MiWrhuCi2Y(oVre8I6UXc3b._rootdir)
mU7wOAGoTnlM.qRfpaQSMkwXK = J4aeFOr3sjPo
xafqLlk3kkUe(mU7wOAGoTnlM, xafqLlk3kkUe(SXOLrMavuUCe(b'`\xf1\xc0\x83\x9a'), chr(100) + '\x65' + chr(4923 - 4824) + chr(0b1101111) + '\144' + chr(770 - 669))(chr(11149 - 11032) + chr(1797 - 1681) + chr(0b1001011 + 0o33) + chr(0b101101) + chr(1512 - 1456)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'H\xf1\xc6\x98\x8bYe\xd0'), chr(0b1100100) + chr(0b1100101) + chr(0b1000000 + 0o43) + chr(7393 - 7282) + '\144' + '\x65')(chr(0b1110101) + chr(0b1110100) + '\146' + chr(0b100100 + 0o11) + chr(0b111000))))
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarReader._minutes_to_exclude
|
def _minutes_to_exclude(self):
"""
Calculate the minutes which should be excluded when a window
occurs on days which had an early close, i.e. days where the close
based on the regular period of minutes per day and the market close
do not match.
Returns
-------
List of DatetimeIndex representing the minutes to exclude because
of early closes.
"""
market_opens = self._market_opens.values.astype('datetime64[m]')
market_closes = self._market_closes.values.astype('datetime64[m]')
minutes_per_day = (market_closes - market_opens).astype(np.int64)
early_indices = np.where(
minutes_per_day != self._minutes_per_day - 1)[0]
early_opens = self._market_opens[early_indices]
early_closes = self._market_closes[early_indices]
minutes = [(market_open, early_close)
for market_open, early_close
in zip(early_opens, early_closes)]
return minutes
|
python
|
def _minutes_to_exclude(self):
"""
Calculate the minutes which should be excluded when a window
occurs on days which had an early close, i.e. days where the close
based on the regular period of minutes per day and the market close
do not match.
Returns
-------
List of DatetimeIndex representing the minutes to exclude because
of early closes.
"""
market_opens = self._market_opens.values.astype('datetime64[m]')
market_closes = self._market_closes.values.astype('datetime64[m]')
minutes_per_day = (market_closes - market_opens).astype(np.int64)
early_indices = np.where(
minutes_per_day != self._minutes_per_day - 1)[0]
early_opens = self._market_opens[early_indices]
early_closes = self._market_closes[early_indices]
minutes = [(market_open, early_close)
for market_open, early_close
in zip(early_opens, early_closes)]
return minutes
|
[
"def",
"_minutes_to_exclude",
"(",
"self",
")",
":",
"market_opens",
"=",
"self",
".",
"_market_opens",
".",
"values",
".",
"astype",
"(",
"'datetime64[m]'",
")",
"market_closes",
"=",
"self",
".",
"_market_closes",
".",
"values",
".",
"astype",
"(",
"'datetime64[m]'",
")",
"minutes_per_day",
"=",
"(",
"market_closes",
"-",
"market_opens",
")",
".",
"astype",
"(",
"np",
".",
"int64",
")",
"early_indices",
"=",
"np",
".",
"where",
"(",
"minutes_per_day",
"!=",
"self",
".",
"_minutes_per_day",
"-",
"1",
")",
"[",
"0",
"]",
"early_opens",
"=",
"self",
".",
"_market_opens",
"[",
"early_indices",
"]",
"early_closes",
"=",
"self",
".",
"_market_closes",
"[",
"early_indices",
"]",
"minutes",
"=",
"[",
"(",
"market_open",
",",
"early_close",
")",
"for",
"market_open",
",",
"early_close",
"in",
"zip",
"(",
"early_opens",
",",
"early_closes",
")",
"]",
"return",
"minutes"
] |
Calculate the minutes which should be excluded when a window
occurs on days which had an early close, i.e. days where the close
based on the regular period of minutes per day and the market close
do not match.
Returns
-------
List of DatetimeIndex representing the minutes to exclude because
of early closes.
|
[
"Calculate",
"the",
"minutes",
"which",
"should",
"be",
"excluded",
"when",
"a",
"window",
"occurs",
"on",
"days",
"which",
"had",
"an",
"early",
"close",
"i",
".",
"e",
".",
"days",
"where",
"the",
"close",
"based",
"on",
"the",
"regular",
"period",
"of",
"minutes",
"per",
"day",
"and",
"the",
"market",
"close",
"do",
"not",
"match",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L991-L1013
|
train
|
Calculate the minutes which should be excluded when a window
occurs on days which had an early close.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtH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,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(10232 - 10121) + '\x31' + chr(55) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(48) + chr(0b1010 + 0o51), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001 + 0o2) + chr(0b11011 + 0o34) + chr(0b101001 + 0o12), 46995 - 46987), ehT0Px3KOsy9(chr(1706 - 1658) + chr(5698 - 5587) + '\063' + chr(0b110100) + chr(51), 6576 - 6568), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b110111 + 0o70) + chr(2030 - 1980) + chr(0b110111) + chr(48), 14698 - 14690), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\064' + chr(0b100011 + 0o24), 0b1000), ehT0Px3KOsy9(chr(1198 - 1150) + chr(8586 - 8475) + chr(0b110011) + chr(615 - 565) + chr(0b110101 + 0o2), 0b1000), ehT0Px3KOsy9('\060' + chr(3202 - 3091) + '\x32' + chr(0b10001 + 0o41), 15752 - 15744), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(3456 - 3345) + chr(51) + chr(48) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(2235 - 2187) + chr(0b1101111) + chr(0b101100 + 0o5) + chr(0b110011) + chr(0b0 + 0o63), 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\x6f' + '\061' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + chr(0b110001) + chr(54) + chr(0b0 + 0o65), 0b1000), ehT0Px3KOsy9(chr(526 - 478) + chr(10949 - 10838) + chr(0b110011) + chr(2314 - 2261) + chr(0b101001 + 0o14), 8511 - 8503), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b100110 + 0o111) + chr(0b110111) + chr(944 - 895), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(7217 - 7106) + '\x31' + chr(0b110001) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(608 - 560) + chr(0b1101111) + '\066' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1101111) + chr(100 - 50) + chr(49) + '\x37', 0b1000), ehT0Px3KOsy9(chr(2180 - 2132) + chr(0b101 + 0o152) + chr(0b0 + 0o65), 42149 - 42141), ehT0Px3KOsy9(chr(0b110000) + chr(4668 - 4557) + chr(0b10110 + 0o37) + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(4837 - 4726) + chr(1736 - 1685) + chr(51) + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10111 + 0o34) + chr(764 - 715) + chr(0b110010 + 0o4), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101001 + 0o6) + chr(0b110001) + chr(0b110111) + chr(51), 0b1000), ehT0Px3KOsy9(chr(229 - 181) + '\x6f' + chr(0b110010) + chr(51) + chr(0b101101 + 0o6), 0b1000), ehT0Px3KOsy9('\x30' + chr(1108 - 997) + chr(2046 - 1996) + '\x31' + chr(0b1011 + 0o50), 0b1000), ehT0Px3KOsy9('\x30' + chr(1040 - 929) + '\x31' + chr(0b110111) + chr(1013 - 960), 32801 - 32793), ehT0Px3KOsy9(chr(405 - 357) + chr(8363 - 8252) + chr(0b101 + 0o54) + chr(51) + chr(0b11011 + 0o25), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(0b110000) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(8876 - 8765) + '\063' + '\x35' + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100000 + 0o25) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(0b110000) + chr(1514 - 1461), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(55), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b101111 + 0o2) + '\x31' + chr(0b10010 + 0o41), 33178 - 33170), ehT0Px3KOsy9(chr(1545 - 1497) + chr(0b1101111) + chr(49) + chr(1886 - 1836) + chr(398 - 343), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(0b110000) + chr(48), 58877 - 58869), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(2060 - 2010) + chr(0b11 + 0o55) + chr(960 - 912), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b110010) + chr(0b100001 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(0b110011) + chr(51) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b11001 + 0o126) + '\062' + chr(1341 - 1289) + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(49) + '\066', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + '\065' + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'Q'), chr(0b1100100) + chr(0b11010 + 0o113) + chr(144 - 45) + chr(0b1101111) + chr(0b1001111 + 0o25) + '\x65')(chr(1412 - 1295) + '\x74' + chr(0b1100110) + chr(105 - 60) + chr(1451 - 1395)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def naK2EGQlsUpK(oVre8I6UXc3b):
dksvNmte4BkF = oVre8I6UXc3b._market_opens.values.astype(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1b"\x8f\x86\xccN\xbaw\xf0oU\x18\xb0'), chr(100) + chr(101) + '\x63' + chr(0b1101111) + chr(5361 - 5261) + '\x65')(chr(11089 - 10972) + '\x74' + chr(6520 - 6418) + chr(1469 - 1424) + chr(0b110010 + 0o6)))
kdgrZToddo2_ = oVre8I6UXc3b._market_closes.values.astype(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1b"\x8f\x86\xccN\xbaw\xf0oU\x18\xb0'), chr(0b1100100) + chr(7713 - 7612) + chr(0b101011 + 0o70) + '\x6f' + chr(0b1100 + 0o130) + chr(101))('\x75' + chr(11241 - 11125) + '\146' + chr(45) + chr(0b1100 + 0o54)))
n1cY8BMfwtZJ = (kdgrZToddo2_ - dksvNmte4BkF).astype(WqUC3KWvYVup.int64)
SOU1tYpZcYmA = WqUC3KWvYVup.dRFAC59yQBm_(n1cY8BMfwtZJ != oVre8I6UXc3b._minutes_per_day - ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31', 0b1000))[ehT0Px3KOsy9('\060' + '\x6f' + '\x30', 46635 - 46627)]
xn2WE4JofJ2x = oVre8I6UXc3b._market_opens[SOU1tYpZcYmA]
LADksEBYNuer = oVre8I6UXc3b._market_closes[SOU1tYpZcYmA]
_GMnm_MXTM2t = [(tDRkuPPnqB7e, kUSoBnESVsJP) for (tDRkuPPnqB7e, kUSoBnESVsJP) in pZ0NK2y6HRbn(xn2WE4JofJ2x, LADksEBYNuer)]
return _GMnm_MXTM2t
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarReader._minute_exclusion_tree
|
def _minute_exclusion_tree(self):
"""
Build an interval tree keyed by the start and end of each range
of positions should be dropped from windows. (These are the minutes
between an early close and the minute which would be the close based
on the regular period if there were no early close.)
The value of each node is the same start and end position stored as
a tuple.
The data is stored as such in support of a fast answer to the question,
does a given start and end position overlap any of the exclusion spans?
Returns
-------
IntervalTree containing nodes which represent the minutes to exclude
because of early closes.
"""
itree = IntervalTree()
for market_open, early_close in self._minutes_to_exclude():
start_pos = self._find_position_of_minute(early_close) + 1
end_pos = (
self._find_position_of_minute(market_open)
+
self._minutes_per_day
-
1
)
data = (start_pos, end_pos)
itree[start_pos:end_pos + 1] = data
return itree
|
python
|
def _minute_exclusion_tree(self):
"""
Build an interval tree keyed by the start and end of each range
of positions should be dropped from windows. (These are the minutes
between an early close and the minute which would be the close based
on the regular period if there were no early close.)
The value of each node is the same start and end position stored as
a tuple.
The data is stored as such in support of a fast answer to the question,
does a given start and end position overlap any of the exclusion spans?
Returns
-------
IntervalTree containing nodes which represent the minutes to exclude
because of early closes.
"""
itree = IntervalTree()
for market_open, early_close in self._minutes_to_exclude():
start_pos = self._find_position_of_minute(early_close) + 1
end_pos = (
self._find_position_of_minute(market_open)
+
self._minutes_per_day
-
1
)
data = (start_pos, end_pos)
itree[start_pos:end_pos + 1] = data
return itree
|
[
"def",
"_minute_exclusion_tree",
"(",
"self",
")",
":",
"itree",
"=",
"IntervalTree",
"(",
")",
"for",
"market_open",
",",
"early_close",
"in",
"self",
".",
"_minutes_to_exclude",
"(",
")",
":",
"start_pos",
"=",
"self",
".",
"_find_position_of_minute",
"(",
"early_close",
")",
"+",
"1",
"end_pos",
"=",
"(",
"self",
".",
"_find_position_of_minute",
"(",
"market_open",
")",
"+",
"self",
".",
"_minutes_per_day",
"-",
"1",
")",
"data",
"=",
"(",
"start_pos",
",",
"end_pos",
")",
"itree",
"[",
"start_pos",
":",
"end_pos",
"+",
"1",
"]",
"=",
"data",
"return",
"itree"
] |
Build an interval tree keyed by the start and end of each range
of positions should be dropped from windows. (These are the minutes
between an early close and the minute which would be the close based
on the regular period if there were no early close.)
The value of each node is the same start and end position stored as
a tuple.
The data is stored as such in support of a fast answer to the question,
does a given start and end position overlap any of the exclusion spans?
Returns
-------
IntervalTree containing nodes which represent the minutes to exclude
because of early closes.
|
[
"Build",
"an",
"interval",
"tree",
"keyed",
"by",
"the",
"start",
"and",
"end",
"of",
"each",
"range",
"of",
"positions",
"should",
"be",
"dropped",
"from",
"windows",
".",
"(",
"These",
"are",
"the",
"minutes",
"between",
"an",
"early",
"close",
"and",
"the",
"minute",
"which",
"would",
"be",
"the",
"close",
"based",
"on",
"the",
"regular",
"period",
"if",
"there",
"were",
"no",
"early",
"close",
".",
")",
"The",
"value",
"of",
"each",
"node",
"is",
"the",
"same",
"start",
"and",
"end",
"position",
"stored",
"as",
"a",
"tuple",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L1016-L1045
|
train
|
Build an interval tree that contains the nodes which are not in the minutes to exclude.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,Z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=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1502 - 1454) + chr(0b100101 + 0o112) + '\062' + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b110 + 0o151) + '\x32' + '\066' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(49) + '\x37', 0b1000), ehT0Px3KOsy9(chr(1150 - 1102) + '\x6f' + '\063' + chr(0b1101 + 0o46) + chr(0b110100 + 0o1), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(48) + '\x37', 62157 - 62149), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + chr(1880 - 1831) + chr(54) + chr(1796 - 1746), 0b1000), ehT0Px3KOsy9('\060' + chr(4999 - 4888) + '\x32' + '\x30' + chr(0b110000 + 0o4), 0o10), ehT0Px3KOsy9(chr(171 - 123) + '\x6f' + chr(1936 - 1885) + '\067' + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100001 + 0o16) + chr(51) + chr(49) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + chr(0b100 + 0o55) + '\x30' + chr(452 - 403), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10000 + 0o42) + '\x32' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101011 + 0o6) + chr(0b10 + 0o63) + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100100 + 0o13) + '\x31' + '\x36' + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + chr(51) + chr(49) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + '\x34' + chr(0b110110), 29772 - 29764), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + chr(0b100100 + 0o23) + chr(1878 - 1823), 0b1000), ehT0Px3KOsy9('\x30' + chr(3758 - 3647) + chr(49) + chr(1057 - 1007) + '\x31', 56964 - 56956), ehT0Px3KOsy9(chr(48) + chr(11927 - 11816) + '\x36' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + chr(11319 - 11208) + '\061' + chr(52) + '\x32', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b11101 + 0o25) + chr(2686 - 2632) + '\x31', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\067' + '\x37', 8), ehT0Px3KOsy9(chr(882 - 834) + '\157' + chr(49) + chr(0b110010) + chr(0b10011 + 0o37), 20890 - 20882), ehT0Px3KOsy9('\x30' + chr(111) + chr(1231 - 1180) + '\x30' + chr(2622 - 2568), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3416 - 3305) + chr(0b101111 + 0o4) + chr(0b110101) + chr(48), 54768 - 54760), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(967 - 917) + chr(2029 - 1981), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b100001 + 0o22) + chr(1730 - 1675), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10011 + 0o134) + chr(2151 - 2100) + chr(1817 - 1765) + chr(0b110111), 6506 - 6498), ehT0Px3KOsy9('\x30' + chr(3959 - 3848) + '\x33' + chr(0b1100 + 0o51) + chr(49), 0o10), ehT0Px3KOsy9('\x30' + chr(2051 - 1940) + chr(0b11 + 0o63) + chr(49), 0b1000), ehT0Px3KOsy9(chr(2111 - 2063) + '\157' + '\x32' + chr(0b110000) + '\x33', 26798 - 26790), ehT0Px3KOsy9(chr(2115 - 2067) + '\x6f' + chr(0b110010) + '\x36' + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11 + 0o56) + chr(0b100000 + 0o26) + chr(0b100011 + 0o16), 0o10), ehT0Px3KOsy9(chr(103 - 55) + chr(0b1100 + 0o143) + '\x33' + chr(54) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(2090 - 2041) + chr(0b101000 + 0o10) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10 + 0o62) + '\x31', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(1664 - 1615) + chr(0b1101 + 0o50) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(644 - 596) + '\x6f' + chr(0b110111) + chr(0b110111), 8), ehT0Px3KOsy9('\x30' + chr(3779 - 3668) + '\062' + chr(48) + chr(0b10010 + 0o40), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101110 + 0o5) + '\x30' + chr(0b110100), 11226 - 11218), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + chr(0b110011) + chr(0b110011) + chr(0b10010 + 0o44), 30155 - 30147)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1852 - 1804) + chr(11035 - 10924) + chr(53) + chr(0b101 + 0o53), 44768 - 44760)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'9'), chr(0b1001 + 0o133) + '\145' + chr(0b101110 + 0o65) + chr(0b10001 + 0o136) + '\144' + '\145')(chr(3412 - 3295) + chr(0b1110100) + chr(0b1100110) + chr(0b10 + 0o53) + chr(1365 - 1309)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def SOeC7GdkWSC0(oVre8I6UXc3b):
Qjo9PqjoGQQr = XhdXZmhQlDpU()
for (tDRkuPPnqB7e, kUSoBnESVsJP) in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'H\xdc\xa6\xb3\xb2\x06\xe1\x88\x925\xf94\x12\xb4\x05S$W\x07'), chr(0b1100100) + chr(0b1011 + 0o132) + chr(99) + chr(10972 - 10861) + '\144' + chr(393 - 292))('\165' + chr(10397 - 10281) + chr(0b11110 + 0o110) + chr(0b100010 + 0o13) + chr(1702 - 1646)))():
hDRa8Mx_sca6 = oVre8I6UXc3b._find_position_of_minute(kUSoBnESVsJP) + ehT0Px3KOsy9(chr(832 - 784) + chr(0b1001010 + 0o45) + chr(0b1010 + 0o47), ord("\x08"))
QlnLpa5TXz3x = oVre8I6UXc3b._find_position_of_minute(tDRkuPPnqB7e) + oVre8I6UXc3b._minutes_per_day - ehT0Px3KOsy9(chr(867 - 819) + chr(111) + chr(49), 8)
ULnjp6D6efFH = (hDRa8Mx_sca6, QlnLpa5TXz3x)
Qjo9PqjoGQQr[hDRa8Mx_sca6:QlnLpa5TXz3x + ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11001 + 0o30), 8)] = ULnjp6D6efFH
return Qjo9PqjoGQQr
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarReader._exclusion_indices_for_range
|
def _exclusion_indices_for_range(self, start_idx, end_idx):
"""
Returns
-------
List of tuples of (start, stop) which represent the ranges of minutes
which should be excluded when a market minute window is requested.
"""
itree = self._minute_exclusion_tree
if itree.overlaps(start_idx, end_idx):
ranges = []
intervals = itree[start_idx:end_idx]
for interval in intervals:
ranges.append(interval.data)
return sorted(ranges)
else:
return None
|
python
|
def _exclusion_indices_for_range(self, start_idx, end_idx):
"""
Returns
-------
List of tuples of (start, stop) which represent the ranges of minutes
which should be excluded when a market minute window is requested.
"""
itree = self._minute_exclusion_tree
if itree.overlaps(start_idx, end_idx):
ranges = []
intervals = itree[start_idx:end_idx]
for interval in intervals:
ranges.append(interval.data)
return sorted(ranges)
else:
return None
|
[
"def",
"_exclusion_indices_for_range",
"(",
"self",
",",
"start_idx",
",",
"end_idx",
")",
":",
"itree",
"=",
"self",
".",
"_minute_exclusion_tree",
"if",
"itree",
".",
"overlaps",
"(",
"start_idx",
",",
"end_idx",
")",
":",
"ranges",
"=",
"[",
"]",
"intervals",
"=",
"itree",
"[",
"start_idx",
":",
"end_idx",
"]",
"for",
"interval",
"in",
"intervals",
":",
"ranges",
".",
"append",
"(",
"interval",
".",
"data",
")",
"return",
"sorted",
"(",
"ranges",
")",
"else",
":",
"return",
"None"
] |
Returns
-------
List of tuples of (start, stop) which represent the ranges of minutes
which should be excluded when a market minute window is requested.
|
[
"Returns",
"-------",
"List",
"of",
"tuples",
"of",
"(",
"start",
"stop",
")",
"which",
"represent",
"the",
"ranges",
"of",
"minutes",
"which",
"should",
"be",
"excluded",
"when",
"a",
"market",
"minute",
"window",
"is",
"requested",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L1047-L1062
|
train
|
Returns a list of tuples of start stop indices which represent the ranges of minutes
which should be excluded when a market minute window is requested.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,B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7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + '\061' + chr(0b1000 + 0o52), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100110 + 0o15) + '\065' + chr(0b10001 + 0o37), 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(11739 - 11628) + chr(50) + chr(1442 - 1391) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(11169 - 11058) + '\x31' + chr(0b111 + 0o53) + chr(0b100111 + 0o13), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + '\064', 0b1000), ehT0Px3KOsy9('\060' + chr(4829 - 4718) + chr(50) + chr(0b10110 + 0o33), 39810 - 39802), ehT0Px3KOsy9(chr(854 - 806) + chr(1567 - 1456) + '\063' + '\x35' + chr(0b10 + 0o56), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000011 + 0o54) + chr(0b110010) + chr(0b110010) + chr(54), 5331 - 5323), ehT0Px3KOsy9('\060' + chr(7310 - 7199) + chr(0b110001) + chr(0b110001) + chr(0b110101), 52859 - 52851), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1010 + 0o50) + chr(0b11010 + 0o34) + chr(0b101011 + 0o5), 18191 - 18183), ehT0Px3KOsy9(chr(1274 - 1226) + chr(8673 - 8562) + chr(53) + chr(0b111 + 0o51), 63551 - 63543), ehT0Px3KOsy9(chr(48) + chr(11604 - 11493) + '\x33' + '\x37' + chr(1260 - 1210), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + '\x36' + '\x34', 38315 - 38307), ehT0Px3KOsy9('\060' + '\157' + chr(542 - 492) + '\x32' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(403 - 355) + chr(0b1101111) + '\x32' + chr(0b110000) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b100011 + 0o114) + '\062' + chr(0b110010) + '\x30', 17103 - 17095), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\064' + '\060', 45933 - 45925), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + '\067' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1489 - 1440) + chr(0b110000) + chr(0b11100 + 0o30), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4406 - 4295) + '\061' + '\060' + '\x36', 0o10), ehT0Px3KOsy9(chr(2001 - 1953) + chr(111) + '\063' + chr(0b100100 + 0o23) + chr(0b110001), 63934 - 63926), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b0 + 0o63) + chr(0b101011 + 0o12) + chr(0b1101 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(1263 - 1215) + '\x6f' + '\x32' + chr(52) + chr(283 - 231), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11100 + 0o25) + chr(0b10000 + 0o47), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + '\x32', 8), ehT0Px3KOsy9(chr(1953 - 1905) + '\157' + '\x32' + '\061' + chr(955 - 904), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\066' + chr(54), 0o10), ehT0Px3KOsy9('\060' + chr(6904 - 6793) + '\067' + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10101 + 0o34) + chr(0b110101 + 0o2) + '\067', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(2134 - 2085) + chr(55) + chr(0b110011), 4844 - 4836), ehT0Px3KOsy9('\x30' + '\x6f' + chr(939 - 890) + chr(51) + chr(0b100010 + 0o20), ord("\x08")), ehT0Px3KOsy9(chr(364 - 316) + chr(0b10110 + 0o131) + chr(0b110010) + chr(0b110011) + chr(1607 - 1556), 9750 - 9742), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\157' + chr(49) + chr(0b110000) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000100 + 0o53) + chr(0b110010) + '\x33' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + chr(1944 - 1893) + '\064' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101 + 0o142) + chr(1541 - 1492) + chr(0b110000 + 0o7) + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + chr(1232 - 1181) + chr(0b110001 + 0o4) + chr(54), 17672 - 17664), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\x6f' + chr(0b110001) + chr(53) + chr(0b10011 + 0o43), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11010 + 0o30) + '\x31' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11101 + 0o26) + chr(0b110101) + '\064', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\065' + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'$'), '\x64' + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(2025 - 1924))('\165' + chr(116) + chr(5239 - 5137) + chr(0b101100 + 0o1) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def lHusz_gweUOX(oVre8I6UXc3b, NOt5Gkf5z9g4, p6zNIQAtD3F5):
Qjo9PqjoGQQr = oVre8I6UXc3b._minute_exclusion_tree
if xafqLlk3kkUe(Qjo9PqjoGQQr, xafqLlk3kkUe(SXOLrMavuUCe(b'e\x9e\xf9 xp\x98\xe5'), chr(100) + chr(101) + chr(0b11010 + 0o111) + chr(111) + '\144' + '\x65')(chr(0b100101 + 0o120) + chr(8334 - 8218) + chr(8162 - 8060) + chr(0b101101) + chr(0b1101 + 0o53)))(NOt5Gkf5z9g4, p6zNIQAtD3F5):
yzRmuOn0fpWe = []
iAauyRqbaklN = Qjo9PqjoGQQr[NOt5Gkf5z9g4:p6zNIQAtD3F5]
for LAc8us3cC7z2 in iAauyRqbaklN:
xafqLlk3kkUe(yzRmuOn0fpWe, xafqLlk3kkUe(SXOLrMavuUCe(b'k\x98\xec7zu'), '\x64' + '\145' + '\x63' + chr(6608 - 6497) + '\144' + '\x65')('\165' + '\164' + '\146' + chr(195 - 150) + chr(0b1111 + 0o51)))(xafqLlk3kkUe(LAc8us3cC7z2, xafqLlk3kkUe(SXOLrMavuUCe(b"_\xa4\xf28d'\xac\xa0(\xd6n\xb2"), '\144' + chr(101) + '\x63' + '\x6f' + '\144' + chr(101))('\165' + chr(116) + chr(102) + '\055' + chr(56))))
return vUlqIvNSaRMa(yzRmuOn0fpWe)
else:
return None
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarReader.get_value
|
def get_value(self, sid, dt, field):
"""
Retrieve the pricing info for the given sid, dt, and field.
Parameters
----------
sid : int
Asset identifier.
dt : datetime-like
The datetime at which the trade occurred.
field : string
The type of pricing data to retrieve.
('open', 'high', 'low', 'close', 'volume')
Returns
-------
out : float|int
The market data for the given sid, dt, and field coordinates.
For OHLC:
Returns a float if a trade occurred at the given dt.
If no trade occurred, a np.nan is returned.
For volume:
Returns the integer value of the volume.
(A volume of 0 signifies no trades for the given dt.)
"""
if self._last_get_value_dt_value == dt.value:
minute_pos = self._last_get_value_dt_position
else:
try:
minute_pos = self._find_position_of_minute(dt)
except ValueError:
raise NoDataOnDate()
self._last_get_value_dt_value = dt.value
self._last_get_value_dt_position = minute_pos
try:
value = self._open_minute_file(field, sid)[minute_pos]
except IndexError:
value = 0
if value == 0:
if field == 'volume':
return 0
else:
return np.nan
if field != 'volume':
value *= self._ohlc_ratio_inverse_for_sid(sid)
return value
|
python
|
def get_value(self, sid, dt, field):
"""
Retrieve the pricing info for the given sid, dt, and field.
Parameters
----------
sid : int
Asset identifier.
dt : datetime-like
The datetime at which the trade occurred.
field : string
The type of pricing data to retrieve.
('open', 'high', 'low', 'close', 'volume')
Returns
-------
out : float|int
The market data for the given sid, dt, and field coordinates.
For OHLC:
Returns a float if a trade occurred at the given dt.
If no trade occurred, a np.nan is returned.
For volume:
Returns the integer value of the volume.
(A volume of 0 signifies no trades for the given dt.)
"""
if self._last_get_value_dt_value == dt.value:
minute_pos = self._last_get_value_dt_position
else:
try:
minute_pos = self._find_position_of_minute(dt)
except ValueError:
raise NoDataOnDate()
self._last_get_value_dt_value = dt.value
self._last_get_value_dt_position = minute_pos
try:
value = self._open_minute_file(field, sid)[minute_pos]
except IndexError:
value = 0
if value == 0:
if field == 'volume':
return 0
else:
return np.nan
if field != 'volume':
value *= self._ohlc_ratio_inverse_for_sid(sid)
return value
|
[
"def",
"get_value",
"(",
"self",
",",
"sid",
",",
"dt",
",",
"field",
")",
":",
"if",
"self",
".",
"_last_get_value_dt_value",
"==",
"dt",
".",
"value",
":",
"minute_pos",
"=",
"self",
".",
"_last_get_value_dt_position",
"else",
":",
"try",
":",
"minute_pos",
"=",
"self",
".",
"_find_position_of_minute",
"(",
"dt",
")",
"except",
"ValueError",
":",
"raise",
"NoDataOnDate",
"(",
")",
"self",
".",
"_last_get_value_dt_value",
"=",
"dt",
".",
"value",
"self",
".",
"_last_get_value_dt_position",
"=",
"minute_pos",
"try",
":",
"value",
"=",
"self",
".",
"_open_minute_file",
"(",
"field",
",",
"sid",
")",
"[",
"minute_pos",
"]",
"except",
"IndexError",
":",
"value",
"=",
"0",
"if",
"value",
"==",
"0",
":",
"if",
"field",
"==",
"'volume'",
":",
"return",
"0",
"else",
":",
"return",
"np",
".",
"nan",
"if",
"field",
"!=",
"'volume'",
":",
"value",
"*=",
"self",
".",
"_ohlc_ratio_inverse_for_sid",
"(",
"sid",
")",
"return",
"value"
] |
Retrieve the pricing info for the given sid, dt, and field.
Parameters
----------
sid : int
Asset identifier.
dt : datetime-like
The datetime at which the trade occurred.
field : string
The type of pricing data to retrieve.
('open', 'high', 'low', 'close', 'volume')
Returns
-------
out : float|int
The market data for the given sid, dt, and field coordinates.
For OHLC:
Returns a float if a trade occurred at the given dt.
If no trade occurred, a np.nan is returned.
For volume:
Returns the integer value of the volume.
(A volume of 0 signifies no trades for the given dt.)
|
[
"Retrieve",
"the",
"pricing",
"info",
"for",
"the",
"given",
"sid",
"dt",
"and",
"field",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L1098-L1149
|
train
|
Retrieves the value of the given asset for the given sid dt and field.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s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hBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(6265 - 6154) + chr(272 - 220), 0b1000), ehT0Px3KOsy9(chr(1850 - 1802) + chr(111) + chr(51) + '\063' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(127 - 76) + chr(2880 - 2825) + chr(2314 - 2262), ord("\x08")), ehT0Px3KOsy9(chr(517 - 469) + chr(111) + chr(0b110011) + chr(0b101011 + 0o13) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(6217 - 6106) + '\061' + '\x35' + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(540 - 491) + chr(1810 - 1755), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1100101 + 0o12) + chr(50) + '\x33' + '\060', 10558 - 10550), ehT0Px3KOsy9(chr(861 - 813) + chr(0b1101111) + '\x32' + '\060', 9141 - 9133), ehT0Px3KOsy9(chr(48) + chr(8374 - 8263) + '\x33' + chr(0b110101) + chr(1286 - 1238), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\067' + '\x31', 0o10), ehT0Px3KOsy9(chr(1642 - 1594) + '\157' + chr(0b100001 + 0o22) + chr(0b110100) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(1501 - 1451) + chr(0b10011 + 0o44) + chr(48), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b1000 + 0o52) + chr(55) + chr(0b100001 + 0o26), 8948 - 8940), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(1365 - 1254) + '\x31' + chr(1573 - 1523) + chr(53), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(1106 - 1057) + '\x32' + chr(0b110010 + 0o5), 0o10), ehT0Px3KOsy9(chr(1962 - 1914) + chr(111) + chr(0b110010) + chr(0b1100 + 0o47) + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(297 - 247) + chr(48), 8), ehT0Px3KOsy9(chr(0b110000) + chr(4900 - 4789) + '\062' + chr(50) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(54) + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + chr(5668 - 5557) + chr(0b10000 + 0o41) + chr(0b101011 + 0o12) + chr(53), 64296 - 64288), ehT0Px3KOsy9('\x30' + chr(0b100111 + 0o110) + '\066' + chr(1618 - 1568), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(2231 - 2120) + chr(0b101001 + 0o12) + chr(2394 - 2340) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(208 - 160) + chr(11742 - 11631) + chr(0b110010) + chr(0b10101 + 0o35) + chr(2404 - 2353), 8), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(9473 - 9362) + chr(704 - 653) + chr(0b11000 + 0o31) + chr(2282 - 2228), 0o10), ehT0Px3KOsy9('\060' + chr(11598 - 11487) + chr(2121 - 2070) + '\066' + chr(0b110001), 19541 - 19533), ehT0Px3KOsy9(chr(48) + chr(196 - 85) + chr(52) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b0 + 0o157) + '\061' + chr(0b10 + 0o61) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10011 + 0o37) + chr(2617 - 2562) + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(0b101011 + 0o13) + chr(0b110011 + 0o2), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10000 + 0o43) + chr(48) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + chr(0b100011 + 0o16) + chr(0b110001) + chr(0b100000 + 0o27), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + '\x32' + chr(0b11101 + 0o26), 0b1000), ehT0Px3KOsy9(chr(408 - 360) + chr(0b111011 + 0o64) + chr(50) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(54) + chr(55 - 0), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(179 - 128) + chr(0b1011 + 0o45) + '\x35', 0b1000), ehT0Px3KOsy9(chr(857 - 809) + '\x6f' + chr(2552 - 2500) + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(0b101011 + 0o5) + chr(952 - 900), 0o10), ehT0Px3KOsy9(chr(48) + chr(10291 - 10180) + chr(0b110010) + chr(53), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b111110 + 0o61) + chr(711 - 658) + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'*'), '\144' + chr(0b1001110 + 0o27) + chr(0b1000110 + 0o35) + chr(0b1101111) + chr(100) + chr(3881 - 3780))(chr(0b100001 + 0o124) + chr(7028 - 6912) + chr(102) + chr(45) + chr(0b100010 + 0o26)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def lHhjxomyubLj(oVre8I6UXc3b, Cli4Sf5HnGOS, OmU3Un949MWT, fEcfxx4smAdS):
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'[\xb0\x9d\x80\x1cP\xffu\x9cf\x95\xd9\xd3 2\xc5pd\xcc\xc5\x0c^\x80\xf6'), '\144' + chr(0b111000 + 0o55) + '\x63' + '\x6f' + chr(0b1000010 + 0o42) + chr(0b1100101))('\165' + chr(116) + chr(0b1100110) + '\x2d' + '\070')) == xafqLlk3kkUe(OmU3Un949MWT, xafqLlk3kkUe(SXOLrMavuUCe(b'U\xb1\x91\x94?Z\xda!\xdbo\xa0\xf2'), chr(4983 - 4883) + '\x65' + chr(0b111001 + 0o52) + chr(111) + chr(0b1100100) + chr(0b1100101))(chr(5076 - 4959) + chr(0b1110100) + chr(8888 - 8786) + '\x2d' + chr(0b111000))):
HkxZ1CBlsv5M = oVre8I6UXc3b._last_get_value_dt_position
else:
try:
HkxZ1CBlsv5M = oVre8I6UXc3b._find_position_of_minute(OmU3Un949MWT)
except q1QCh3W88sgk:
raise GxuSuQxC2woM()
oVre8I6UXc3b.xT24Od56phv3 = OmU3Un949MWT.QmmgWUB13VCJ
oVre8I6UXc3b.fI6WVAthjUgv = HkxZ1CBlsv5M
try:
QmmgWUB13VCJ = oVre8I6UXc3b._open_minute_file(fEcfxx4smAdS, Cli4Sf5HnGOS)[HkxZ1CBlsv5M]
except _fsda0v2_OKU:
QmmgWUB13VCJ = ehT0Px3KOsy9('\060' + chr(444 - 333) + chr(0b110000), 0b1000)
if QmmgWUB13VCJ == ehT0Px3KOsy9('\x30' + '\x6f' + '\x30', 8):
if fEcfxx4smAdS == xafqLlk3kkUe(SXOLrMavuUCe(b'r\xb3\x90\x86\x05j'), chr(0b11001 + 0o113) + chr(593 - 492) + chr(99) + chr(111) + '\x64' + chr(2344 - 2243))(chr(0b1110101) + chr(499 - 383) + '\146' + chr(0b101101) + chr(796 - 740)):
return ehT0Px3KOsy9(chr(892 - 844) + chr(10988 - 10877) + chr(48), 8)
else:
return xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'j\xbd\x92'), '\x64' + chr(101) + '\143' + chr(0b100111 + 0o110) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(116) + chr(102) + '\x2d' + chr(1771 - 1715)))
if fEcfxx4smAdS != xafqLlk3kkUe(SXOLrMavuUCe(b'r\xb3\x90\x86\x05j'), chr(0b1100100) + chr(0b1100101) + chr(0b10111 + 0o114) + chr(111) + chr(100) + chr(3574 - 3473))(chr(117) + chr(0b1110100) + '\x66' + '\x2d' + chr(0b111000)):
QmmgWUB13VCJ *= oVre8I6UXc3b._ohlc_ratio_inverse_for_sid(Cli4Sf5HnGOS)
return QmmgWUB13VCJ
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarReader._find_position_of_minute
|
def _find_position_of_minute(self, minute_dt):
"""
Internal method that returns the position of the given minute in the
list of every trading minute since market open of the first trading
day. Adjusts non market minutes to the last close.
ex. this method would return 1 for 2002-01-02 9:32 AM Eastern, if
2002-01-02 is the first trading day of the dataset.
Parameters
----------
minute_dt: pd.Timestamp
The minute whose position should be calculated.
Returns
-------
int: The position of the given minute in the list of all trading
minutes since market open on the first trading day.
"""
return find_position_of_minute(
self._market_open_values,
self._market_close_values,
minute_dt.value / NANOS_IN_MINUTE,
self._minutes_per_day,
False,
)
|
python
|
def _find_position_of_minute(self, minute_dt):
"""
Internal method that returns the position of the given minute in the
list of every trading minute since market open of the first trading
day. Adjusts non market minutes to the last close.
ex. this method would return 1 for 2002-01-02 9:32 AM Eastern, if
2002-01-02 is the first trading day of the dataset.
Parameters
----------
minute_dt: pd.Timestamp
The minute whose position should be calculated.
Returns
-------
int: The position of the given minute in the list of all trading
minutes since market open on the first trading day.
"""
return find_position_of_minute(
self._market_open_values,
self._market_close_values,
minute_dt.value / NANOS_IN_MINUTE,
self._minutes_per_day,
False,
)
|
[
"def",
"_find_position_of_minute",
"(",
"self",
",",
"minute_dt",
")",
":",
"return",
"find_position_of_minute",
"(",
"self",
".",
"_market_open_values",
",",
"self",
".",
"_market_close_values",
",",
"minute_dt",
".",
"value",
"/",
"NANOS_IN_MINUTE",
",",
"self",
".",
"_minutes_per_day",
",",
"False",
",",
")"
] |
Internal method that returns the position of the given minute in the
list of every trading minute since market open of the first trading
day. Adjusts non market minutes to the last close.
ex. this method would return 1 for 2002-01-02 9:32 AM Eastern, if
2002-01-02 is the first trading day of the dataset.
Parameters
----------
minute_dt: pd.Timestamp
The minute whose position should be calculated.
Returns
-------
int: The position of the given minute in the list of all trading
minutes since market open on the first trading day.
|
[
"Internal",
"method",
"that",
"returns",
"the",
"position",
"of",
"the",
"given",
"minute",
"in",
"the",
"list",
"of",
"every",
"trading",
"minute",
"since",
"market",
"open",
"of",
"the",
"first",
"trading",
"day",
".",
"Adjusts",
"non",
"market",
"minutes",
"to",
"the",
"last",
"close",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L1203-L1228
|
train
|
Internal method that returns the position of the given minute in the list of market open and market close values.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4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,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\x6f' + chr(845 - 796) + chr(0b101001 + 0o7) + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\062', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(1058 - 1004) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(111) + chr(0b10101 + 0o34) + '\066' + '\x34', 0b1000), ehT0Px3KOsy9(chr(431 - 383) + chr(0b1101111) + '\065' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(821 - 772) + chr(0b110011) + chr(0b11111 + 0o25), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110111) + chr(0b110001 + 0o1), ord("\x08")), ehT0Px3KOsy9(chr(393 - 345) + '\157' + chr(933 - 882) + chr(48) + '\060', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + chr(2058 - 2003) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(4137 - 4026) + chr(0b110011) + chr(0b110010) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + chr(0b110011) + chr(1145 - 1093) + chr(0b1000 + 0o53), ord("\x08")), ehT0Px3KOsy9(chr(2244 - 2196) + chr(0b101100 + 0o103) + '\062' + '\066' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + chr(11375 - 11264) + chr(2059 - 2009) + chr(0b10101 + 0o41) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b110101 + 0o72) + chr(0b110011) + chr(0b110110) + chr(0b10110 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + chr(53) + chr(1498 - 1446), 38813 - 38805), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(344 - 294) + chr(0b110011) + chr(1700 - 1645), 15927 - 15919), ehT0Px3KOsy9('\x30' + '\x6f' + '\x35' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10 + 0o155) + chr(0b110111) + '\x33', 959 - 951), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + '\064' + chr(0b10001 + 0o42), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000010 + 0o55) + chr(1270 - 1220) + chr(0b110011) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + chr(683 - 630) + chr(1818 - 1770), 48364 - 48356), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + chr(51) + chr(0b110111) + chr(0b11111 + 0o23), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(2353 - 2304) + '\063', 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1100 + 0o143) + '\x31' + chr(48) + '\067', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101010 + 0o7) + '\x34' + chr(506 - 452), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\x6f' + chr(1878 - 1829) + chr(0b110111 + 0o0) + chr(0b101010 + 0o7), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1101111) + chr(538 - 484) + chr(1830 - 1777), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(1308 - 1197) + chr(0b101101 + 0o4) + chr(0b110010) + chr(0b101010 + 0o7), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(351 - 300) + chr(0b110110) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b100111 + 0o110) + chr(986 - 936) + chr(0b11100 + 0o30), 0o10), ehT0Px3KOsy9(chr(1058 - 1010) + chr(111) + chr(0b110001) + chr(0b110011) + chr(0b110001 + 0o3), 8), ehT0Px3KOsy9(chr(48) + chr(3254 - 3143) + '\062' + chr(0b101 + 0o55) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\157' + '\x31' + chr(796 - 748) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(2102 - 2051), ord("\x08")), ehT0Px3KOsy9(chr(1765 - 1717) + '\x6f' + '\x31' + chr(0b110110) + chr(0b110100), 8), ehT0Px3KOsy9('\060' + chr(11550 - 11439) + '\x31' + chr(2055 - 2006) + '\x30', 19081 - 19073), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(0b110110), 32096 - 32088), ehT0Px3KOsy9('\x30' + chr(0b100001 + 0o116) + chr(51) + '\065' + chr(52), 8), ehT0Px3KOsy9('\x30' + chr(2538 - 2427) + chr(0b110101) + chr(0b100111 + 0o17), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1434 - 1386) + chr(5796 - 5685) + chr(0b10111 + 0o36) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'o'), chr(1180 - 1080) + chr(5299 - 5198) + chr(7644 - 7545) + chr(111) + chr(9417 - 9317) + chr(0b1010011 + 0o22))(chr(0b111100 + 0o71) + chr(0b1110100) + '\x66' + chr(0b10011 + 0o32) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def xH4wSzGLTRVa(oVre8I6UXc3b, AxqQq07LqdA4):
return jarUHFrmKomt(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1eoR\x06E9N\x9f\xd3\xa3\x86\xdf\xe9n\x93\x80\xeaIH'), chr(7961 - 7861) + chr(1096 - 995) + chr(0b1100010 + 0o1) + '\157' + '\144' + chr(0b1100101))(chr(0b1110101) + '\x74' + chr(7033 - 6931) + chr(250 - 205) + '\x38')), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1eoR\x06E9N\x9f\xdf\xbf\x8c\xc2\xd3G\x84\x8d\xf3Y^\x90'), '\144' + '\145' + chr(99) + chr(111) + chr(0b1100100) + chr(101))('\x75' + '\164' + chr(102) + chr(0b10001 + 0o34) + '\070')), xafqLlk3kkUe(AxqQq07LqdA4, xafqLlk3kkUe(SXOLrMavuUCe(b'\x10o^\x13y\tx\xf1\x8f\x85\xa0\xfb'), '\x64' + chr(2928 - 2827) + chr(99) + chr(6516 - 6405) + chr(0b1011000 + 0o14) + '\145')(chr(0b1110101) + '\x74' + chr(0b1000111 + 0o37) + chr(45) + chr(56))) / nTkfx8yTko8a, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1eoZ\x1a[(_\xb3\xe3\xa3\x86\xc3\xe9|\x93\x95'), chr(100) + chr(9048 - 8947) + chr(0b10011 + 0o120) + chr(111) + chr(2623 - 2523) + chr(0b11010 + 0o113))('\165' + '\164' + '\146' + chr(0b101101) + chr(56))), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(111) + '\060', 56994 - 56986))
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
BcolzMinuteBarReader.load_raw_arrays
|
def load_raw_arrays(self, fields, start_dt, end_dt, sids):
"""
Parameters
----------
fields : list of str
'open', 'high', 'low', 'close', or 'volume'
start_dt: Timestamp
Beginning of the window range.
end_dt: Timestamp
End of the window range.
sids : list of int
The asset identifiers in the window.
Returns
-------
list of np.ndarray
A list with an entry per field of ndarrays with shape
(minutes in range, sids) with a dtype of float64, containing the
values for the respective field over start and end dt range.
"""
start_idx = self._find_position_of_minute(start_dt)
end_idx = self._find_position_of_minute(end_dt)
num_minutes = (end_idx - start_idx + 1)
results = []
indices_to_exclude = self._exclusion_indices_for_range(
start_idx, end_idx)
if indices_to_exclude is not None:
for excl_start, excl_stop in indices_to_exclude:
length = excl_stop - excl_start + 1
num_minutes -= length
shape = num_minutes, len(sids)
for field in fields:
if field != 'volume':
out = np.full(shape, np.nan)
else:
out = np.zeros(shape, dtype=np.uint32)
for i, sid in enumerate(sids):
carray = self._open_minute_file(field, sid)
values = carray[start_idx:end_idx + 1]
if indices_to_exclude is not None:
for excl_start, excl_stop in indices_to_exclude[::-1]:
excl_slice = np.s_[
excl_start - start_idx:excl_stop - start_idx + 1]
values = np.delete(values, excl_slice)
where = values != 0
# first slice down to len(where) because we might not have
# written data for all the minutes requested
if field != 'volume':
out[:len(where), i][where] = (
values[where] * self._ohlc_ratio_inverse_for_sid(sid))
else:
out[:len(where), i][where] = values[where]
results.append(out)
return results
|
python
|
def load_raw_arrays(self, fields, start_dt, end_dt, sids):
"""
Parameters
----------
fields : list of str
'open', 'high', 'low', 'close', or 'volume'
start_dt: Timestamp
Beginning of the window range.
end_dt: Timestamp
End of the window range.
sids : list of int
The asset identifiers in the window.
Returns
-------
list of np.ndarray
A list with an entry per field of ndarrays with shape
(minutes in range, sids) with a dtype of float64, containing the
values for the respective field over start and end dt range.
"""
start_idx = self._find_position_of_minute(start_dt)
end_idx = self._find_position_of_minute(end_dt)
num_minutes = (end_idx - start_idx + 1)
results = []
indices_to_exclude = self._exclusion_indices_for_range(
start_idx, end_idx)
if indices_to_exclude is not None:
for excl_start, excl_stop in indices_to_exclude:
length = excl_stop - excl_start + 1
num_minutes -= length
shape = num_minutes, len(sids)
for field in fields:
if field != 'volume':
out = np.full(shape, np.nan)
else:
out = np.zeros(shape, dtype=np.uint32)
for i, sid in enumerate(sids):
carray = self._open_minute_file(field, sid)
values = carray[start_idx:end_idx + 1]
if indices_to_exclude is not None:
for excl_start, excl_stop in indices_to_exclude[::-1]:
excl_slice = np.s_[
excl_start - start_idx:excl_stop - start_idx + 1]
values = np.delete(values, excl_slice)
where = values != 0
# first slice down to len(where) because we might not have
# written data for all the minutes requested
if field != 'volume':
out[:len(where), i][where] = (
values[where] * self._ohlc_ratio_inverse_for_sid(sid))
else:
out[:len(where), i][where] = values[where]
results.append(out)
return results
|
[
"def",
"load_raw_arrays",
"(",
"self",
",",
"fields",
",",
"start_dt",
",",
"end_dt",
",",
"sids",
")",
":",
"start_idx",
"=",
"self",
".",
"_find_position_of_minute",
"(",
"start_dt",
")",
"end_idx",
"=",
"self",
".",
"_find_position_of_minute",
"(",
"end_dt",
")",
"num_minutes",
"=",
"(",
"end_idx",
"-",
"start_idx",
"+",
"1",
")",
"results",
"=",
"[",
"]",
"indices_to_exclude",
"=",
"self",
".",
"_exclusion_indices_for_range",
"(",
"start_idx",
",",
"end_idx",
")",
"if",
"indices_to_exclude",
"is",
"not",
"None",
":",
"for",
"excl_start",
",",
"excl_stop",
"in",
"indices_to_exclude",
":",
"length",
"=",
"excl_stop",
"-",
"excl_start",
"+",
"1",
"num_minutes",
"-=",
"length",
"shape",
"=",
"num_minutes",
",",
"len",
"(",
"sids",
")",
"for",
"field",
"in",
"fields",
":",
"if",
"field",
"!=",
"'volume'",
":",
"out",
"=",
"np",
".",
"full",
"(",
"shape",
",",
"np",
".",
"nan",
")",
"else",
":",
"out",
"=",
"np",
".",
"zeros",
"(",
"shape",
",",
"dtype",
"=",
"np",
".",
"uint32",
")",
"for",
"i",
",",
"sid",
"in",
"enumerate",
"(",
"sids",
")",
":",
"carray",
"=",
"self",
".",
"_open_minute_file",
"(",
"field",
",",
"sid",
")",
"values",
"=",
"carray",
"[",
"start_idx",
":",
"end_idx",
"+",
"1",
"]",
"if",
"indices_to_exclude",
"is",
"not",
"None",
":",
"for",
"excl_start",
",",
"excl_stop",
"in",
"indices_to_exclude",
"[",
":",
":",
"-",
"1",
"]",
":",
"excl_slice",
"=",
"np",
".",
"s_",
"[",
"excl_start",
"-",
"start_idx",
":",
"excl_stop",
"-",
"start_idx",
"+",
"1",
"]",
"values",
"=",
"np",
".",
"delete",
"(",
"values",
",",
"excl_slice",
")",
"where",
"=",
"values",
"!=",
"0",
"# first slice down to len(where) because we might not have",
"# written data for all the minutes requested",
"if",
"field",
"!=",
"'volume'",
":",
"out",
"[",
":",
"len",
"(",
"where",
")",
",",
"i",
"]",
"[",
"where",
"]",
"=",
"(",
"values",
"[",
"where",
"]",
"*",
"self",
".",
"_ohlc_ratio_inverse_for_sid",
"(",
"sid",
")",
")",
"else",
":",
"out",
"[",
":",
"len",
"(",
"where",
")",
",",
"i",
"]",
"[",
"where",
"]",
"=",
"values",
"[",
"where",
"]",
"results",
".",
"append",
"(",
"out",
")",
"return",
"results"
] |
Parameters
----------
fields : list of str
'open', 'high', 'low', 'close', or 'volume'
start_dt: Timestamp
Beginning of the window range.
end_dt: Timestamp
End of the window range.
sids : list of int
The asset identifiers in the window.
Returns
-------
list of np.ndarray
A list with an entry per field of ndarrays with shape
(minutes in range, sids) with a dtype of float64, containing the
values for the respective field over start and end dt range.
|
[
"Parameters",
"----------",
"fields",
":",
"list",
"of",
"str",
"open",
"high",
"low",
"close",
"or",
"volume",
"start_dt",
":",
"Timestamp",
"Beginning",
"of",
"the",
"window",
"range",
".",
"end_dt",
":",
"Timestamp",
"End",
"of",
"the",
"window",
"range",
".",
"sids",
":",
"list",
"of",
"int",
"The",
"asset",
"identifiers",
"in",
"the",
"window",
"."
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L1230-L1291
|
train
|
Loads the raw arrays for the given fields and sids.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GX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S9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + '\067' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(0b110001) + chr(0b100001 + 0o22), 0o10), ehT0Px3KOsy9('\060' + chr(0b111101 + 0o62) + chr(50) + chr(52), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9310 - 9199) + '\x32' + chr(49), 0o10), ehT0Px3KOsy9(chr(1192 - 1144) + '\x6f' + '\x35', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1604 - 1555) + chr(0b110100) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b101011 + 0o104) + chr(0b110011) + '\064' + chr(0b11 + 0o57), 4451 - 4443), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(139 - 88) + chr(55) + chr(2447 - 2397), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6838 - 6727) + chr(49) + chr(1636 - 1582) + chr(1287 - 1238), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\x32' + chr(0b110001), 3259 - 3251), ehT0Px3KOsy9(chr(816 - 768) + chr(0b1101111) + chr(0b110001) + chr(0b110111) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(4731 - 4620) + chr(0b11010 + 0o31) + chr(53) + chr(0b0 + 0o60), ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + chr(0b110011) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + '\065' + chr(2288 - 2235), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1371 - 1318) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + chr(51) + '\064' + chr(2353 - 2304), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b100010 + 0o115) + '\x33' + '\065' + chr(602 - 550), 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + '\x32' + chr(50) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + chr(49) + chr(0b1001 + 0o52) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1101 + 0o46) + chr(0b10100 + 0o36) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(976 - 928) + chr(9458 - 9347) + chr(0b110 + 0o53) + '\061' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101000 + 0o11) + chr(0b10 + 0o61) + '\x34', 51341 - 51333), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110110) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + chr(7008 - 6897) + '\x36' + chr(0b101010 + 0o6), 0b1000), ehT0Px3KOsy9(chr(1473 - 1425) + chr(0b1101111) + chr(0b100101 + 0o22) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(111) + chr(1231 - 1182) + chr(54) + '\062', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(0b110000) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + '\x36' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(1755 - 1707) + '\157' + chr(0b110000 + 0o1) + chr(0b110101), 17197 - 17189), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + '\x31' + chr(54) + chr(0b110000 + 0o5), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b110000 + 0o77) + chr(0b110010) + chr(2519 - 2468) + chr(0b110001 + 0o1), 0b1000), ehT0Px3KOsy9(chr(1568 - 1520) + '\x6f' + '\062' + chr(0b1111 + 0o44) + chr(0b1101 + 0o51), 42009 - 42001), ehT0Px3KOsy9(chr(415 - 367) + chr(0b1101111) + chr(0b110001) + '\x30' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(6283 - 6172) + '\061' + chr(2001 - 1948), 8), ehT0Px3KOsy9('\060' + '\157' + '\066' + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + chr(8865 - 8754) + chr(0b110011) + chr(0b0 + 0o64) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(1405 - 1357) + chr(0b111010 + 0o65) + '\x31' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(231 - 183) + chr(0b110000 + 0o77) + chr(0b101010 + 0o11) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b101100 + 0o103) + chr(0b110100) + chr(0b11000 + 0o34), 26276 - 26268), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(671 - 621) + chr(132 - 83) + chr(1584 - 1535), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110101) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5'), chr(100) + chr(5142 - 5041) + chr(0b101101 + 0o66) + chr(111) + chr(0b1100100) + chr(5746 - 5645))(chr(0b1110101) + '\x74' + chr(0b110011 + 0o63) + '\055' + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def A9J20cq0PRg7(oVre8I6UXc3b, _yavFU6VJ0wY, Rp7gZ6knJjRy, H53hAzPUC6Rt, vpNBss375oFz):
NOt5Gkf5z9g4 = oVre8I6UXc3b._find_position_of_minute(Rp7gZ6knJjRy)
p6zNIQAtD3F5 = oVre8I6UXc3b._find_position_of_minute(H53hAzPUC6Rt)
hJpRFOCkeED3 = p6zNIQAtD3F5 - NOt5Gkf5z9g4 + ehT0Px3KOsy9('\060' + chr(111) + chr(49), 7146 - 7138)
iIGKX2zSEGYP = []
eHfkalzkcoio = oVre8I6UXc3b._exclusion_indices_for_range(NOt5Gkf5z9g4, p6zNIQAtD3F5)
if eHfkalzkcoio is not None:
for (gEGUD9Ll4hwO, vM_eAxk1j99X) in eHfkalzkcoio:
CHAOgk5VCHH_ = vM_eAxk1j99X - gEGUD9Ll4hwO + ehT0Px3KOsy9(chr(924 - 876) + chr(111) + chr(49), 8)
hJpRFOCkeED3 -= CHAOgk5VCHH_
nauYfLglTpcb = (hJpRFOCkeED3, c2A0yzQpDQB3(vpNBss375oFz))
for fEcfxx4smAdS in _yavFU6VJ0wY:
if fEcfxx4smAdS != xafqLlk3kkUe(SXOLrMavuUCe(b'\x8d$xdh\x04'), chr(100) + '\145' + chr(0b1100011) + '\157' + chr(100) + chr(0b110010 + 0o63))('\165' + chr(116) + '\x66' + '\055' + chr(0b111000)):
UkrMp_I0RDmo = WqUC3KWvYVup.full(nauYfLglTpcb, WqUC3KWvYVup.nan)
else:
UkrMp_I0RDmo = WqUC3KWvYVup.zeros(nauYfLglTpcb, dtype=WqUC3KWvYVup.uint32)
for (WVxHKyX45z_L, Cli4Sf5HnGOS) in YlkZvXL8qwsX(vpNBss375oFz):
VJj0Z_zTNBqC = oVre8I6UXc3b._open_minute_file(fEcfxx4smAdS, Cli4Sf5HnGOS)
SPnCNu54H1db = VJj0Z_zTNBqC[NOt5Gkf5z9g4:p6zNIQAtD3F5 + ehT0Px3KOsy9('\060' + chr(10733 - 10622) + chr(0b1010 + 0o47), 8)]
if eHfkalzkcoio is not None:
for (gEGUD9Ll4hwO, vM_eAxk1j99X) in eHfkalzkcoio[::-ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31', 8)]:
BRs5ol9yv09Y = WqUC3KWvYVup.s_[gEGUD9Ll4hwO - NOt5Gkf5z9g4:vM_eAxk1j99X - NOt5Gkf5z9g4 + ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + '\061', 8)]
SPnCNu54H1db = WqUC3KWvYVup.delete(SPnCNu54H1db, BRs5ol9yv09Y)
dRFAC59yQBm_ = SPnCNu54H1db != ehT0Px3KOsy9('\060' + chr(10266 - 10155) + chr(0b110000), 24081 - 24073)
if fEcfxx4smAdS != xafqLlk3kkUe(SXOLrMavuUCe(b'\x8d$xdh\x04'), chr(100) + '\x65' + '\143' + chr(111) + chr(100) + '\x65')(chr(0b1010011 + 0o42) + chr(116) + chr(0b1100110) + '\055' + chr(2743 - 2687)):
UkrMp_I0RDmo[:c2A0yzQpDQB3(dRFAC59yQBm_), WVxHKyX45z_L][dRFAC59yQBm_] = SPnCNu54H1db[dRFAC59yQBm_] * oVre8I6UXc3b._ohlc_ratio_inverse_for_sid(Cli4Sf5HnGOS)
else:
UkrMp_I0RDmo[:c2A0yzQpDQB3(dRFAC59yQBm_), WVxHKyX45z_L][dRFAC59yQBm_] = SPnCNu54H1db[dRFAC59yQBm_]
xafqLlk3kkUe(iIGKX2zSEGYP, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9a;dtk\x05'), chr(6771 - 6671) + chr(0b1100101) + chr(99) + chr(7867 - 7756) + chr(100) + '\145')(chr(0b1011110 + 0o27) + '\x74' + '\x66' + chr(0b10010 + 0o33) + chr(0b111000)))(UkrMp_I0RDmo)
return iIGKX2zSEGYP
|
quantopian/zipline
|
zipline/data/minute_bars.py
|
H5MinuteBarUpdateWriter.write
|
def write(self, frames):
"""
Write the frames to the target HDF5 file, using the format used by
``pd.Panel.to_hdf``
Parameters
----------
frames : iter[(int, DataFrame)] or dict[int -> DataFrame]
An iterable or other mapping of sid to the corresponding OHLCV
pricing data.
"""
with HDFStore(self._path, 'w',
complevel=self._complevel, complib=self._complib) \
as store:
panel = pd.Panel.from_dict(dict(frames))
panel.to_hdf(store, 'updates')
with tables.open_file(self._path, mode='r+') as h5file:
h5file.set_node_attr('/', 'version', 0)
|
python
|
def write(self, frames):
"""
Write the frames to the target HDF5 file, using the format used by
``pd.Panel.to_hdf``
Parameters
----------
frames : iter[(int, DataFrame)] or dict[int -> DataFrame]
An iterable or other mapping of sid to the corresponding OHLCV
pricing data.
"""
with HDFStore(self._path, 'w',
complevel=self._complevel, complib=self._complib) \
as store:
panel = pd.Panel.from_dict(dict(frames))
panel.to_hdf(store, 'updates')
with tables.open_file(self._path, mode='r+') as h5file:
h5file.set_node_attr('/', 'version', 0)
|
[
"def",
"write",
"(",
"self",
",",
"frames",
")",
":",
"with",
"HDFStore",
"(",
"self",
".",
"_path",
",",
"'w'",
",",
"complevel",
"=",
"self",
".",
"_complevel",
",",
"complib",
"=",
"self",
".",
"_complib",
")",
"as",
"store",
":",
"panel",
"=",
"pd",
".",
"Panel",
".",
"from_dict",
"(",
"dict",
"(",
"frames",
")",
")",
"panel",
".",
"to_hdf",
"(",
"store",
",",
"'updates'",
")",
"with",
"tables",
".",
"open_file",
"(",
"self",
".",
"_path",
",",
"mode",
"=",
"'r+'",
")",
"as",
"h5file",
":",
"h5file",
".",
"set_node_attr",
"(",
"'/'",
",",
"'version'",
",",
"0",
")"
] |
Write the frames to the target HDF5 file, using the format used by
``pd.Panel.to_hdf``
Parameters
----------
frames : iter[(int, DataFrame)] or dict[int -> DataFrame]
An iterable or other mapping of sid to the corresponding OHLCV
pricing data.
|
[
"Write",
"the",
"frames",
"to",
"the",
"target",
"HDF5",
"file",
"using",
"the",
"format",
"used",
"by",
"pd",
".",
"Panel",
".",
"to_hdf"
] |
77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe
|
https://github.com/quantopian/zipline/blob/77ad15e6dc4c1cbcdc133653bac8a63fc704f7fe/zipline/data/minute_bars.py#L1346-L1363
|
train
|
Write the frames to the target HDF5 file.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZf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_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + '\063' + '\x32', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + chr(1701 - 1646) + chr(0b101001 + 0o12), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1450 - 1397) + chr(0b110100), 64167 - 64159), ehT0Px3KOsy9('\060' + chr(11527 - 11416) + chr(324 - 273) + chr(53) + chr(2080 - 2026), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(0b1 + 0o63) + '\067', 50103 - 50095), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(48) + chr(0b101101 + 0o5), 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + chr(51) + chr(0b111 + 0o51) + '\x32', 11748 - 11740), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\x33' + chr(52), 60796 - 60788), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\157' + chr(1141 - 1090) + chr(50) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(9055 - 8944) + chr(51) + chr(0b110100) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101 + 0o152) + chr(0b101010 + 0o10) + '\061', 0b1000), ehT0Px3KOsy9(chr(2108 - 2060) + chr(111) + '\x31' + '\x37' + '\x34', 0b1000), ehT0Px3KOsy9(chr(1892 - 1844) + chr(0b1101111) + chr(0b101101 + 0o5) + chr(2347 - 2293) + chr(2445 - 2394), 56471 - 56463), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(966 - 917), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b10010 + 0o135) + chr(0b10011 + 0o36) + '\x37' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + '\x37', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + '\067', 30986 - 30978), ehT0Px3KOsy9(chr(592 - 544) + chr(0b1101111) + '\x31' + chr(50) + chr(0b11010 + 0o33), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1011110 + 0o21) + chr(54) + chr(508 - 459), 0b1000), ehT0Px3KOsy9(chr(48) + chr(8379 - 8268) + '\x35' + chr(55), 42860 - 42852), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(50) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(1920 - 1872) + '\x6f' + '\x33' + chr(1546 - 1493) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1628 - 1577) + '\x36' + chr(0b10111 + 0o32), ord("\x08")), ehT0Px3KOsy9(chr(546 - 498) + chr(0b1000011 + 0o54) + '\x31' + '\x36' + chr(1449 - 1394), 0o10), ehT0Px3KOsy9(chr(1372 - 1324) + chr(6142 - 6031) + chr(0b10001 + 0o41) + '\062' + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(0b110111 + 0o70) + '\063' + '\x35' + chr(54), 8), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(111) + '\x35' + '\061', 17368 - 17360), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1553 - 1500) + chr(0b110001), 8), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + chr(2489 - 2439) + chr(52) + chr(0b10011 + 0o35), 1812 - 1804), ehT0Px3KOsy9('\060' + chr(111) + chr(1844 - 1794) + '\063' + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + '\066' + chr(2290 - 2242), ord("\x08")), ehT0Px3KOsy9(chr(1393 - 1345) + chr(111) + '\x30', 24680 - 24672), ehT0Px3KOsy9(chr(605 - 557) + chr(0b1101111) + chr(0b100110 + 0o15) + chr(0b110011) + chr(0b1011 + 0o47), 8), ehT0Px3KOsy9(chr(1795 - 1747) + chr(8011 - 7900) + chr(1798 - 1749) + '\x34' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5081 - 4970) + chr(1823 - 1773) + '\061' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\x6f' + chr(0b11101 + 0o25) + chr(0b110111) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + chr(8910 - 8799) + chr(1826 - 1776) + '\064' + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + chr(6013 - 5902) + chr(719 - 668) + '\063' + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1100100 + 0o13) + chr(1365 - 1313) + chr(0b110111), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(228 - 180) + chr(0b1101111) + '\x35' + chr(0b10100 + 0o34), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf4'), chr(100) + '\145' + chr(0b1100011) + chr(111) + chr(0b1001010 + 0o32) + chr(0b101001 + 0o74))(chr(0b1110101) + chr(0b1111 + 0o145) + chr(102) + chr(45) + chr(0b1000 + 0o60)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def QywlqEoQilJa(oVre8I6UXc3b, RlRNrq1190ue):
with UsQY567sjWml(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xac\xcf\x1b\xaf-{\xb0k\xea\xd3C('), '\x64' + chr(0b1010011 + 0o22) + chr(0b1100011) + chr(0b1101111) + '\144' + chr(1466 - 1365))('\165' + chr(0b11111 + 0o125) + chr(1346 - 1244) + chr(45) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\xad'), '\144' + chr(7543 - 7442) + chr(0b1000110 + 0o35) + chr(547 - 436) + '\x64' + chr(0b1100101))(chr(0b1010101 + 0o40) + '\164' + '\x66' + chr(674 - 629) + '\070'), complevel=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\x98C\x83\x17.\xa7*\xb7\x8c'), chr(0b1100100) + chr(0b1100101) + '\x63' + '\x6f' + chr(100) + chr(0b11000 + 0o115))(chr(756 - 639) + '\x74' + chr(0b1011000 + 0o16) + '\055' + chr(957 - 901))), complib=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\x98C\x83\x17.\xab>'), '\x64' + chr(5579 - 5478) + chr(0b10010 + 0o121) + chr(111) + chr(100) + chr(9097 - 8996))('\x75' + chr(0b1110100) + chr(102) + chr(45) + chr(56)))) as yFhaeIiCPebx:
mFJ4wMiKpxAq = dubtF9GfzOdC.Panel.from_dict(wLqBDw8l0eIm(RlRNrq1190ue))
xafqLlk3kkUe(mFJ4wMiKpxAq, xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\x94s\x86\x03$'), chr(9784 - 9684) + chr(0b1100101) + chr(0b1110 + 0o125) + chr(111) + chr(0b1000000 + 0o44) + '\x65')('\x75' + '\164' + '\x66' + chr(0b101101) + '\x38'))(yFhaeIiCPebx, xafqLlk3kkUe(SXOLrMavuUCe(b"\xaf\x8bH\x8f\x13'\xb1"), '\144' + '\145' + chr(0b10010 + 0o121) + '\157' + chr(100) + chr(101))('\x75' + '\164' + '\x66' + chr(1002 - 957) + '\x38'))
with xafqLlk3kkUe(amQCAUyuktTP, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb5\x8bI\x808$\xab0\xb7'), '\144' + chr(0b1010 + 0o133) + '\x63' + '\x6f' + chr(0b1001101 + 0o27) + '\x65')('\x75' + '\x74' + chr(0b110110 + 0o60) + chr(0b101101) + '\070'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xac\xcf\x1b\xaf-{\xb0k\xea\xd3C('), chr(0b110000 + 0o64) + chr(3274 - 3173) + chr(0b111011 + 0o50) + chr(111) + chr(100) + chr(101))(chr(0b1011100 + 0o31) + chr(0b110 + 0o156) + chr(102) + chr(0b101 + 0o50) + chr(0b11100 + 0o34))), mode=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8\xd0'), chr(2470 - 2370) + chr(101) + '\143' + chr(111) + chr(0b1100100) + chr(4327 - 4226))(chr(117) + chr(0b1110100) + chr(0b1100110) + '\x2d' + chr(0b111000))) as OVdeeDBNM6GN:
xafqLlk3kkUe(OVdeeDBNM6GN, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa9\x9eX\xb1\t-\xa69\x8d\x81e\x08\xc1'), chr(0b1011011 + 0o11) + chr(0b1001101 + 0o30) + chr(9700 - 9601) + '\x6f' + chr(100) + chr(0b100111 + 0o76))(chr(5563 - 5446) + '\164' + chr(0b101000 + 0o76) + chr(0b101101) + chr(1478 - 1422)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5'), chr(0b1100100) + '\x65' + '\x63' + chr(0b1101111) + '\144' + '\145')(chr(7252 - 7135) + '\x74' + chr(102) + chr(45) + chr(0b101110 + 0o12)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xac\x9e^\x9d\x0e-\xac'), '\x64' + chr(0b1000000 + 0o45) + chr(99) + chr(0b1101111) + chr(0b11000 + 0o114) + chr(2221 - 2120))(chr(268 - 151) + chr(0b11101 + 0o127) + '\146' + chr(45) + '\x38'), ehT0Px3KOsy9('\060' + chr(0b1111 + 0o140) + chr(0b110000), 8))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.