def _validate_names(names):
if names is not None:<EOL><INDENT>if len(names) != len(set(names)):<EOL><INDENT>msg = ("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>warnings.warn(msg, UserWarning, stacklevel=<NUM_LIT:3>)<EOL><DEDENT><DEDENT>return names<EOL>
Check if the `names` parameter contains duplicates.

If duplicates are found, we issue a warning before returning.

Parameters
----------
names : array-like or None
    An array containing a list of the names used for the output DataFrame.

Returns
-------
names : array-like or None
    The original `names` parameter.