code: def get_titles():
      '''returns titles of all open windows'''
      if os.name == 'posix':
          for proc in get_processes():
              cmd = ['xdotool','search','--name', proc]
              proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
              window_ids = proc.communicate()[0].decode('utf-8')
              if window_ids:
                  for window_id in window_ids.split('\n'):
                      cmd = ['xdotool','getwindowname',window_id]
                      proc = subprocess.Popen(cmd,
                                          stdout=subprocess.PIPE,
                                          stderr=subprocess.PIPE)
                      title = proc.communicate()[0].decode('utf-8')
                      try:
                          if title[-1] == '\n':
                              title = title[:-1]
                          yield title
                      except IndexError:
                          pass
      else:
          raise NotImplementedErrof get_titles():
      '''returns titles of all open windows'''
      if os.name == 'posix':
          for proc in get_processes():
              cmd = ['xdotool','search','--name', proc]
              proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
              window_ids = proc.communicate()[0].decode('utf-8')
              if window_ids:
                  for window_id in window_ids.split('\n'):
                      cmd = ['xdotool','getwindowname',window_id]
                      proc = subprocess.Popen(cmd,
                                          stdout=subprocess.PIPE,
                                          stderr=subprocess.PIPE)
                      title = proc.communicate()[0].decode('utf-8')
                      try:
                          if title[-1] == '\n':
                              title = title[:-1]
                          yield title
                      except IndexError:
                          pass
      else:
          raise NotImplementedError
docs: returns titles of all open windows