code: def validate_endpoints(closed):
      
      left_closed = False
      right_closed = False
  
      if closed is None:
          left_closed = True
          right_closed = True
      elif closed == "left":
          left_closed = True
      elif closed == "right":
          right_closed = True
      else:
          raise ValueError("Closed has to be either 'left', 'right' or None")
  
      return left_closed, right_closed
docs: Check that the `closed` argument is among [None, "left", "right"]
  
      Parameters
      ----------
      closed : {None, "left", "right"}
  
      Returns
      -------
      left_closed : bool
      right_closed : bool
  
      Raises
      ------
      ValueError : if argument is not among valid values