class_docstr: Mixin for configurable classes that work with connection files
class_docstr_tok: ["Mixin","for","configurable","classes","that","work","with","connection","files"]
docstr: Records which of the ports are randomly assigned.
  
  Records on first invocation, if the transport is tcp.
  Does nothing on later invocations.
code: def _record_random_port_names(self):
      """Records which of the ports are randomly assigned.
  
      Records on first invocation, if the transport is tcp.
      Does nothing on later invocations."""
  
      if self.transport != "tcp":
          return
      if self._random_port_names is not None:
          return
  
      self._random_port_names = []
      for name in port_names:
          if getattr(self, name) <= 0:
              self._random_port_names.append(name)
  
imports: from __future__ import absolute_import
  import errno
  import glob
  import json
  import os
  import socket
  import stat
  import tempfile
  import warnings
  from getpass import getpass
  from contextlib import contextmanager
  import zmq
  from traitlets.config import LoggingConfigurable
  from .localinterfaces import localhost
  from ipython_genutils.path import filefind
  from ipython_genutils.py3compat import bytes_to_str, cast_bytes, cast_bytes_py2, string_types
  from traitlets import Bool, Integer, Unicode, CaselessStrEnum, Instance, Type
  from jupyter_core.paths import jupyter_data_dir, jupyter_runtime_dir, secure_write
label_desc: Use image node_id 10 for calling the ConnectionFileMixin obj's underlying member method code with example usage: obj._record_random_port_names() without return types