code: def _LogInvalidRunLevels(states, valid):
    
    invalid = set()
    for state in states:
      if state not in valid:
        invalid.add(state)
    if invalid:
      logging.warning("Invalid init runlevel(s) encountered: %s",
                      ", ".join(invalid))
docs: Log any invalid run states found.