code: def free_port_tls(self) -> int:
      if self.port_tls is None:
          raise BadGrammar(
              f"{type(self)} unable to check if tls port {self.port_tls} is free"
          )
      return find_available_port(
          host="localhost", port=self.port_tls, search=True
      )
  
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 6 for calling the HostGrammarTerm obj's underlying member method code with example usage: obj.free_port_tls() and returns: find_available_port