code: def ports(self):
          
  
          if self._ports is None:
              self._ports = {}
              if self.net_settings["Ports"]:
                  for key, value in self.net_settings["Ports"].items():
                      cleaned_port = key.split("/")[0]
                      self._ports[cleaned_port] = graceful_chain_get(value, 0, "HostPort")
              # in case of --net=host, there's nothing in network settings, let's get it from "Config"
              exposed_ports_section = graceful_chain_get(self.inspect_data, "Config", "ExposedPorts")
              if exposed_ports_section:
                  for key, value in exposed_ports_section.items():
                      cleaned_port = key.split("/")[0]
                      self._ports[cleaned_port] = None  # extremely docker specific
          return self._ports
docs: :return: dict
              {
                  # container -> host
                  "1234": "2345"
              }