def set_ordered(self, value, inplace=False):
inplace = validate_bool_kwarg(inplace, '<STR_LIT>')<EOL>new_dtype = CategoricalDtype(self.categories, ordered=value)<EOL>cat = self if inplace else self.copy()<EOL>cat._dtype = new_dtype<EOL>if not inplace:<EOL><INDENT>return cat<EOL><DEDENT>
Set the ordered attribute to the boolean value.

Parameters
----------
value : bool
   Set whether this categorical is ordered (True) or not (False).
inplace : bool, default False
   Whether or not to set the ordered attribute in-place or return
   a copy of this categorical with ordered set to the value.