Guest User

Untitled

a guest
Oct 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. @outputSchema("is_contained:int")
  4. def is_contained_within(val, begin_range, end_range):
  5.  
  6. # If there is no list of dates, the passed
  7. # date will not be in between them
  8. if not begin_range:
  9. return 0;
  10.  
  11. if (not end_range) and (val >= begin_range):
  12. return 1;
  13.  
  14. if (val >= begin_range) and (val <= end_range):
  15. return 1
  16.  
  17. return 0
Add Comment
Please, Sign In to add comment