code: def _vertex_data_to_sframe(data, vid_field):
      """
      Convert data into a vertex data sframe. Using vid_field to identify the id
      column. The returned sframe will have id column name '__id'.
      """
      if isinstance(data, SFrame):
          # '__id' already in the sframe, and it is ok to not specify vid_field
          if vid_field is None and _VID_COLUMN in data.column_names():
              return data
          if vid_field is None:
              raise ValueError(
                  "vid_field must be specified for SFrame input"
              )
          data_copy = copy.copy(data)
          data_copy.rename({vid_field: _VID_COLUMN}, inplace=True)
          return data_copy
  
      if type(data) == Vertex or type(data) == list:
          return _vertex_list_to_sframe(data, "__id")
  
      elif HAS_PANDAS and type(data) == pd.DataFrame:
          if vid_field is None:
              # using the dataframe index as vertex id
              if data.index.is_unique:
                  if not ("index" in data.columns):
                      # pandas reset_index() will insert a new column of name "index".
                      sf = SFrame(data.reset_index())  # "index"
                      sf.rename({"index": _VID_COLUMN}, inplace=True)
                      return sf
                  else:
                      # pandas reset_index() will insert a new column of name "level_0" if there exists a column named "index".
                      sf = SFrame(data.reset_index())  # "level_0"
                      sf.rename({"level_0": _VID_COLUMN}, inplace=True)
                      return sf
              else:
                  raise ValueError(
                      "Index of the vertices dataframe is not unique, \
                          try specifying vid_field name to use a column for vertex ids."
                  )
          else:
              sf = SFrame(data)
              if _VID_COLUMN in sf.column_names():
                  raise ValueError(
                      "%s reserved vid column name already exists in the SFrame"
                      % _VID_COLUMN
                  )
              sf.rename({vid_field: _VID_COLUMN}, inplace=True)
              return sf
      else:
          raise TypeError(
              "Vertices type %s is Not supported." % str(type(data))
          )
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from .._connect import main
  from .sframe import SFrame
  from .sarray import SArray
  from .gframe import GFrame, VERTEX_GFRAME, EDGE_GFRAME
  from .._cython.cy_graph import UnityGraphProxy
  from .._cython.context import debug_trace
  from ..util import _is_non_string_iterable, _make_internal_url
  from .._deps import pandas
  from .._deps import HAS_PANDAS
  import inspect
  import copy
  import sys
label_desc: Use image node_id 8 for calling a global function with example usage: _vertex_data_to_sframe(data, vid_field) and returns: data_copy, _vertex_list_to_sframe, data, sf, sf, sf