MCPcopy Index your code
hub / github.com/PaddlePaddle/FastDeploy / parse_ports

Function parse_ports

fastdeploy/utils.py:609–619  ·  view source on GitHub ↗
(ports)

Source from the content-addressed store, hash-verified

607
608
609def parse_ports(ports):
610 if ports is None:
611 return None
612 elif isinstance(ports, int):
613 return [ports]
614 elif isinstance(ports, str):
615 return [int(p) for p in ports.split(",")]
616 elif isinstance(ports, list):
617 return [int(p) for p in ports]
618 else:
619 raise TypeError(f"Cannot parse ports into List[int]: {ports}")
620
621
622def is_port_available(host, port):

Callers 3

__init__Method · 0.90
__init__Method · 0.90
post_init_portsMethod · 0.90

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected