def metadata_ports_to_k8s_ports(ports):
exposed_ports = []<EOL>for port in ports:<EOL><INDENT>splits = port.split("<STR_LIT:/>", <NUM_LIT:1>)<EOL>port = int(splits[<NUM_LIT:0>])<EOL>protocol = splits[<NUM_LIT:1>].upper() if len(splits) > <NUM_LIT:1> else None<EOL>exposed_ports.append(client.V1ServicePort(port=port, protocol=protocol))<EOL><DEDENT>return exposed_ports<EOL>
:param ports: list of str, list of exposed ports, example:
        - ['1234/tcp', '8080/udp']
:return: list of V1ServicePort