docs: def strip_commands(commands):
      """ Strips a sequence of commands.
  
      Strips down the sequence of commands by removing comments and
      surrounding whitespace around each individual command and then
      removing blank commands.
  
      Parameters
      ----------
      commands : iterable of strings
          Iterable of commands to strip.
  
      Returns
      -------
      stripped_commands : list of str
          The stripped commands with blank ones removed.
  
      """
      # Go through each command one by one, stripping it and adding it to
      # a growing list if it is not blank. Each command needs to be
      # converted to an str if it is a bytes.
      stripped_commands = []
      for v in commands:
          if isinstance(v, bytes):
              v = v.decode(errors='replace')
          v = v.split(';')[0].strip()
          if len(v) != 0:
              stripped_commands.append(v)
      return stripped_commands