code: def submit_and_connect(self, spec):
          
          spec = ApplicationSpec._from_any(spec)
          app_id = self.submit(spec)
          try:
              return self.connect(app_id, security=spec.master.security)
          except BaseException:
              self.kill_application(app_id)
              raise
docs: Submit a new skein application, and wait to connect to it.
  
          If an error occurs before the application connects, the application is
          killed.
  
          Parameters
          ----------
          spec : ApplicationSpec, str, or dict
              A description of the application to run. Can be an
              ``ApplicationSpec`` object, a path to a yaml/json file, or a
              dictionary description of an application specification.
  
          Returns
          -------
          app_client : ApplicationClient