code: def learning_curve(visualizer, idx, value, window=None, title=""):
      """
      Appends new value to learning curve, creating new curve if none exists.
      """
      opts = {
          "title": title,
          "xlabel": "Number of samples",
          "ylabel": "Reward value",
      }
      window = visualizer.line(
          value.view(value.nelement(), 1),
          idx,
          update=None if window is None else "append",
          opts=opts,
          win=window,
          env="contextual_bandits",
      )
      return window
  
file_path: CrypTen/examples/bandits/launcher.py
imports: import argparse
  import logging
  import os
  import random
  import examples.util
  import torch
  import visdom
  from examples.multiprocess_launcher import MultiProcessLauncher
  from examples.util import NoopContextManager, process_mnist_files
  from torchvision.datasets.mnist import MNIST
label_desc: Use image node_id 1 for calling a global function with example usage: learning_curve(visualizer, idx, value, window, title) and returns: window