code: def _validate(cls, kind):
          
          if kind not in cls._valid_kinds:
              mesg = "'kind' must be one of {}, {}, {}, or {}."
              raise ValueError(mesg.format(*cls._valid_kinds))
          else:
              return kind
docs: Validate the kind argument.