code: def set_scanner (type, scanner):
      
      if __debug__:
          from .scanner import Scanner
          assert isinstance(type, basestring)
          assert issubclass(scanner, Scanner)
      validate (type)
      __types [type]['scanner'] = scanner
docs: Sets a scanner class that will be used for this 'type'.