code: def tcp(klass, host, port, interval, timeout=None, deregister=None):
          
          ret = {
              'tcp': '{host:s}:{port:d}'.format(host=host, port=port),
              'interval': interval
          }
          if timeout:
              ret['timeout'] = timeout
          if deregister:
              ret['DeregisterCriticalServiceAfter'] = deregister
          return ret
docs: Attempt to establish a tcp connection to the specified *host* and
          *port* at a specified *interval* with optional *timeout* and optional
          *deregister* after which a failing service will be automatically
          deregistered.