code: def _validate_ports_low_level(ports):
      
      if not isinstance(ports, (list, tuple)):
          raise ValueError("'ports' must be a list of strings")
      if any([not isinstance(x, (six.text_type, str)) for x in ports]):
          raise ValueError("'ports' must be a list of strings")
      for port in ports:
          _validate_single_port_string(port)
docs: Internal helper.
  
      Validates the 'ports' argument to EphemeralOnionService or
      EphemeralAuthenticatedOnionService returning None on success or
      raising ValueError otherwise.
  
      This only accepts the "list of strings" variants; some
      higher-level APIs also allow lists of ints or lists of 2-tuples,
      but those must be converted to strings before they get here.