class_docstr: List of ports
  
  For use configuring a list of ports to consume
  
  Ports will be a list of valid ports
  
  Can be specified as a port-range string for convenience
  (mainly for use on the command-line)
  e.g. '10101-10105,10108'
docstr: Parse a port range string in the form '1,3-5,6' into [1,3,4,5,6]
docstr_tok: ["Parse","a","port","range","string","in","the","form","'","1,3-5,6","'","into","[","1,3,4,5,6","]"]
code: def parse_port_range(s):
      """Parse a port range string in the form '1,3-5,6' into [1,3,4,5,6]"""
      ports = []
      ranges = s.split(",")
      for r in ranges:
          start, _, end = r.partition("-")
          start = int(start)
          if end:
              end = int(end)
              ports.extend(range(start, end + 1))
          else:
              ports.append(start)
      return ports
  
file_path: ipyparallel/ipyparallel/traitlets.py
imports: import entrypoints
  from traitlets import List, TraitError, Type
label_desc: Use image node_id 1 for calling the PortList obj's underlying member method code with example usage: obj.parse_port_range(s) and returns: ports