parameters: (self, name=None)
docstring: Get detector used for specified OS name, or the detector for this OS if name is ``None``.
          
          :raises: :exc:`KeyError`
docstring_summary: Get detector used for specified OS name, or the detector for this OS if name is ``None``.
          
          :raises: :exc:`KeyError`
docstring_tokens: Get detector used for specified OS name or the detector for this OS if name is None . : raises : : exc : KeyError
function: def get_detector(self, name=None):
          """
          Get detector used for specified OS name, or the detector for this OS if name is ``None``.
          
          :raises: :exc:`KeyError`
          """
          if name is None:
              if not self._os_detector:
                  self.detect_os()
              return self._os_detector
          else:
              try:
                  return [d for d_name, d in self._os_list if d_name == name][0]
              except IndexError:
                  raise KeyError(name)
function_tokens: def get_detector ( self , name = None ) : if name is None : if not self . _os_detector : self . detect_os ( ) return self . _os_detector else : try : return [ d for d_name , d in self . _os_list if d_name == name ] [ 0 ] except IndexError : raise KeyError ( name )