def value_interval(ol,value):
si,ei = where(ol,value)<EOL>if(si == None):<EOL><INDENT>sv = None<EOL><DEDENT>else:<EOL><INDENT>sv = ol[si]<EOL><DEDENT>if(ei == None):<EOL><INDENT>ev = None<EOL><DEDENT>else:<EOL><INDENT>ev = ol[ei]<EOL><DEDENT>return((sv,ev))<EOL>
ol = [0, 4, 6, 8, 10, 14]
value_interval(ol,-1)
value_interval(ol,1)
value_interval(ol,2)
value_interval(ol,3)
value_interval(ol,4)
value_interval(ol,9)
value_interval(ol,14)
value_interval(ol,17)