code: def _init_jupyter(run):
      
      from wandb import jupyter
      # TODO: Should we log to jupyter?
      # global logging had to be disabled because it set the level to debug
      # I also disabled run logging because we're rairly using it.
      # try_to_set_up_global_logging()
      # run.enable_logging()
  
      api = InternalApi()
      if not api.api_key:
          termerror(
              "Not authenticated.  Copy a key from https://app.wandb.ai/profile?message=true")
          key = getpass.getpass("API Key: ").strip()
          if len(key) == 40:
              os.environ[env.API_KEY] = key
              util.write_netrc(api.api_url, "user", key)
          else:
              raise ValueError("API Key must be 40 characters long")
          # Ensure our api client picks up the new key
          api = InternalApi()
      os.environ["WANDB_JUPYTER"] = "true"
      run.resume = "allow"
      api.set_current_run_id(run.id)
      print("W&B Run: %s" % run.get_url(api))
      print("Call `%%wandb` in the cell containing your training loop to display live results.")
      try:
          run.save(api=api)
      except (CommError, ValueError) as e:
          termerror(str(e))
      run.set_environment()
      run._init_jupyter_agent()
      ipython = get_ipython()
      ipython.register_magics(jupyter.WandBMagics)
  
      def reset_start():
          """Reset START_TIME to when the cell starts"""
          global START_TIME
          START_TIME = time.time()
      ipython.events.register("pre_run_cell", reset_start)
      ipython.events.register('post_run_cell', run._stop_jupyter_agent)
docs: Asks for user input to configure the machine if it isn't already and creates a new run.
      Log pushing and system stats don't start until `wandb.monitor()` is called.