code: def _convert_port_bindings(self, value):
          
          converted = {}
  
          if not value:
              return converted
  
          if isinstance(value, list):
              value = self._convert_port_bindings_from_list(value)
  
          if isinstance(value, dict):
              for port_protocol, host_bindings in six.iteritems(value):
                  if '/' in port_protocol:
                      port, protocol = port_protocol.split('/')
  
                      if protocol not in ('tcp', 'udp'):
                          raise ValueError('only supported protocols are tcp and udp. {0} was passed.'.format(protocol))
                  else:
                      port_protocol = "{0}/tcp".format(port_protocol)
  
                  converted[port_protocol] = []
  
                  if isinstance(host_bindings, list):
                      for host_binding in host_bindings:
                          if isinstance(host_binding, dict):
                              if "host_port" not in host_binding:
                                  raise ValueError("host_port must be provided.")
  
                              if 'host_ip' not in host_binding:
                                  host_binding['host_ip'] = ''
  
                              converted[port_protocol].append(host_binding)
                          else:
                              raise TypeError("The host binding information must be a dict.")
                  else:
                      raise TypeError("The host binding information in port bindings must be in a list.")
  
          return converted
docs: "PortBindings": {
              "6379/tcp": [
                  {
                      "HostIp": "",
                      "HostPort": "6379"
                  }
              ]
          }