code: def plot_with_plotly(x_vals, y_vals, labels, plot_in_notebook=True):
      from plotly.offline import init_notebook_mode, iplot, plot
      import plotly.graph_objs as go
  
      trace = go.Scatter(x=x_vals, y=y_vals, mode="text", text=labels)
      data = [trace]
  
      if plot_in_notebook:
          init_notebook_mode(connected=True)
          iplot(data, filename="word-embedding-plot")
      else:
          plot(data, filename="word-embedding-plot.html")
  
imports: import logging
  import gensim.downloader
  from gensim.test.utils import datapath
  from gensim import utils
  import gensim.models
  import tempfile
  import os
  import io
  import os
  import gensim.models.word2vec
  import gensim.downloader
  import smart_open
  import time
  import numpy
  import pandas
  from sklearn.decomposition import IncrementalPCA
  from sklearn.manifold import TSNE
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: plot_with_plotly(x_vals, y_vals, labels, plot_in_notebook) without return types