docs: def decorate(cls, function):
          '''
          Decorate a function so the function call is checked whenever
          a call is made. The calls that do not need any checks are skipped.
  
          The `function` argument is the function to be decorated.
  
          The return value will be either
  
          * the function itself, if there is nothing to validate, or
          * a proxy function that will execute the validation.
          '''
  
          should_skip = getattr(function, 'typesafety_skip', False)
          if cls.is_function_validated(function) or should_skip:
              return function
  
          validator = cls(function)
  
          if not validator.need_validate_arguments and \
                  not validator.need_validate_return_value:
              return function
  
          @functools.wraps(function)
          def __wrapper(*args, **kwargs):
              return validator(*args, **kwargs)
  
          __wrapper.__validator__ = validator
  
          return __wrapper