code: def check_count(count, max_value=None):
      
      if type(count) not in [int, long]:
          return False
  
      if count < 0:
          return False
  
      if max_value and count > max_value:
          return False
  
      return True
docs: verify that a count is valid
      
      >>> check_count(None)
      False
      >>> check_count('abc')
      False
      >>> check_count({})
      False
      >>> check_count([])
      False
      >>> check_count(True)
      False
      >>> check_count(0)
      True
      >>> check_count(-1)
      False
      >>> check_count(1)
      True
      >>> check_count(2, max_value=2)
      True
      >>> check_count(2, max_value=1)
      False