code: def hostapi_info(index=None):
      
      if index is None:
          return (hostapi_info(i) for i in range(_pa.Pa_GetHostApiCount()))
      else:
          info = _pa.Pa_GetHostApiInfo(index)
          if not info:
              raise RuntimeError("Invalid host API")
          assert info.structVersion == 1
          return {'name': ffi.string(info.name).decode(errors='ignore'),
                  'default_input_device': info.defaultInputDevice,
                  'default_output_device': info.defaultOutputDevice}
docs: Return a generator with information about each host API.
  
      If index is given, only one dictionary for the given host API is
      returned.