code: def custom_parsing(self, input: str) -> str:
      colons = input.count(":")
      host = input
      port = None
      if colons > 1:
          raise BadGrammar(
              f"You cannot have more than one : for {self.name}, try: {self.get_example()}"
          )
      elif colons == 1:
          parts = input.split(":")
          host = parts[0]
          port = parts[1]
  
      if port is None:
          if host == "docker":
              port = "8081+"  # default
          else:
              port = "80"  # default
  
      if host not in allowed_hosts:
          _ = self.validate_host(host_or_ip=host)
  
      _ = self.validate_port(port=port)
  
      return f"{host}:{port}"
  
imports: from __future__ import annotations
  import socket
  from typing import Any
  from typing import Callable
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Tuple
  from typing import Union
  from .deps import allowed_hosts
  from .lib import find_available_port
label_desc: Use image node_id 10 for calling the HostGrammarTerm obj's underlying member method code with example usage: obj.custom_parsing(input) and returns: host, str, port