<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse_ports(port_values: dict) -> dict: """Parse ports key. Args: port_values (dict):
 ports configuration values Returns: dict, Ports specification which contains exposed ports """

        # Initialising empty dictionary
        endpoints = {}

        for port_element in port_values:
            target_port = port_element.split(':')
            for port in target_port:
                endpoints[int(port)] = int(port)

        # Setting the types
        endpoint_spec = docker.types.EndpointSpec(ports=endpoints)
        return endpoint_spec