def validate_endpoints(closed):
left_closed = False<EOL>right_closed = False<EOL>if closed is None:<EOL><INDENT>left_closed = True<EOL>right_closed = True<EOL><DEDENT>elif closed == "<STR_LIT:left>":<EOL><INDENT>left_closed = True<EOL><DEDENT>elif closed == "<STR_LIT:right>":<EOL><INDENT>right_closed = True<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>return left_closed, right_closed<EOL>
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