def _environment_for_container(self, container):
        # Improve the factoring of this later.  Separate it into two methods.
        links = []
        environment = []
        if container.environment:
            environment_dict = container.environment.to_dict()
            for label, value in environment_dict.items():
                # <ALIAS>_PORT_<PORTNUM>_TCP_PORT=<value>
                parts = label.rsplit(b"_", 4)
                try:
                    alias, pad_a, port, pad_b, pad_c = parts
                    local_port = int(port)
                except ValueError:
                    # <ALIAS>_PORT_<PORT>_TCP
                    parts = label.rsplit(b"_", 3)
                    try:
                        alias, pad_a, port, pad_b = parts
                    except ValueError:
                        environment.append((label, value))
                        continue
                    if not (pad_a, pad_b) == (b"PORT", b"TCP"):
                        environment.append((label, value))
                    continue
                if (pad_a, pad_b, pad_c) == (b"PORT", b"TCP", b"PORT"):
                    links.append(Link(
                        local_port=local_port,
                        remote_port=int(value),
                        alias=alias,
                    ))
        return links, environment
Return a single extra spec item.
dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/_container.py/ApplicationNodeDeployer._environment_for_container--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/api/openstack/compute/legacy_v2/contrib/flavorextraspecs.py/FlavorExtraSpecsController.show