code: def _check_items(items):
      '''
      Check:
       - that the list of items is iterable and finite.
       - that the list is not empty
      '''
      num_items = 0
      # Check that the list is iterable and finite
      try:
          num_items = len(items)
      except:
          raise TypeError("The item list ({}) is not a finite iterable (has no length)".format(items))
      # Check that the list has items
      if num_items == 0:
          raise ValueError("The item list is empty."f _check_items(items):
      '''
      Check:
       - that the list of items is iterable and finite.
       - that the list is not empty
      '''
      num_items = 0
      # Check that the list is iterable and finite
      try:
          num_items = len(items)
      except:
          raise TypeError("The item list ({}) is not a finite iterable (has no length)".format(items))
      # Check that the list has items
      if num_items == 0:
          raise ValueError("The item list is empty.")
docs: Check:
       - that the list of items is iterable and finite.
       - that the list is not empty