def contains(self, val):
(start, end) = self.__val_convert(val) <EOL>retlen = <NUM_LIT:0><EOL>for r in self.__has:<EOL><INDENT>if start < r[<NUM_LIT:1>] and end > r[<NUM_LIT:0>]:<EOL><INDENT>retlen += ((end < r[<NUM_LIT:1>] and end) or r[<NUM_LIT:1>]) - ((start > r[<NUM_LIT:0>] and start) or r[<NUM_LIT:0>])<EOL><DEDENT><DEDENT>return retlen<EOL>
Check if given value or range is present.

Parameters
----------
val : int or tuple or list or range
    Range or integer being checked.

Returns
-------
retlen : int
    Length of overlapping with `val` subranges.