code: def _path_factory(check):
      
  
      @functools.wraps(check)
      def validator(paths):
          if isinstance(paths, str):
              check(paths)
          elif isinstance(paths, collections.Sequence):
              for path in paths:
                  check(path)
          else:
              raise Exception('expected either basestr or sequenc of basstr')
  
      return validator
docs: Create a function that checks paths.