code: def _create(
      observation_data,
      user_id="user_id",
      item_id="item_id",
      target=None,
      user_data=None,
      item_data=None,
      ranking=True,
      verbose=True,
  ):
      """
      A unified interface for training recommender models. Based on simple
      characteristics of the data, a type of model is selected and trained. The
      trained model can be used to predict ratings and make recommendations.
  
      To use specific options of a desired model, use the ``create`` function
      of the corresponding model.
  
      Parameters
      ----------
      observation_data : SFrame
          The dataset to use for training the model. It must contain a column of
          user ids and a column of item ids. Each row represents an observed
          interaction between the user and the item.  The (user, item) pairs
          are stored with the model so that they can later be excluded from
          recommendations if desired. It can optionally contain a target ratings
          column. All other columns are interpreted by the underlying model as
          side features for the observations.
  
          The user id and item id columns must be of type 'int' or 'str'. The
          target column must be of type 'int' or 'float'.
  
      user_id : string, optional
          The name of the column in `observation_data` that corresponds to the
          user id.
  
      item_id : string, optional
          The name of the column in `observation_data` that corresponds to the
          item id.
  
      target : string, optional
          Name of the column in `observation_data` containing ratings given by
          users to items, if applicable.
  
      user_data : SFrame, optional
          Side information for the users. This SFrame must have a column with the
          same name as what is specified by the `user_id` input parameter.
          `user_data` can provide any amount of additional user-specific
          information.
  
      item_data : SFrame, optional
          Side information for the items. This SFrame must have a column with the
          same name as what is specified by the `item_id` input parameter.
          `item_data` can provide any amount of additional item-specific
          information.
  
      ranking : bool, optional
          Determine whether or not the goal is to rank items for each user.
  
      verbose : bool, optional
          Enables verbose output.
  
      Returns
      -------
      out :  A trained model.
          - If a target column is given, then
            :class:`turicreate.recommender.factorization_recommender.FactorizationRecommender`.
          - If no target column is given, then
            :class:`turicreate.recommender.item_similarity_recommender.ItemSimilarityRecommender`.
  
      Examples
      --------
      **Basic usage**
  
      Given basic user-item observation data, an
      :class:`~turicreate.recommender.item_similarity_recommender.ItemSimilarityRecommender` is created:
  
      >>> sf = turicreate.SFrame({'user_id': ['0', '0', '0', '1', '1', '2', '2', '2'],
      ...                       'item_id': ['a', 'b', 'c', 'a', 'b', 'b', 'c', 'd']})
      >>> m = turicreate.recommender.create(sf)
      >>> recs = m.recommend()
  
      **Creating a model for ratings data**
  
      This trains a :class:`~turicreate.recommender.factorization_recommender.FactorizationRecommender` that
      can predict target ratings:
  
      >>> sf2 = turicreate.SFrame({'user_id': ['0', '0', '0', '1', '1', '2', '2', '2'],
      ...                        'item_id': ['a', 'b', 'c', 'a', 'b', 'b', 'c', 'd'],
      ...                        'rating': [1, 3, 2, 5, 4, 1, 4, 3]})
      >>> m2 = turicreate.recommender.create(sf2, target="rating", ranking = False)
  
      **Creating specific models**
  
      Specific models allow for a number of additional options during create.
      The available recommenders are all in the turicreate.recommender namespace.
      For the complete list of acceptable options, please refer to the documentation
      for individual models. Such options can be passed to the underlying model
      just like any other parameter. For example, the following code creates
      an :class:`~turicreate.recommender.ItemSimilarityRecommender` with a space-saving
      option called `only_top_k`. The returned model stores only the 2 most
      similar items for item:
  
      >>> from turicreate.recommender import item_similarity_recommender
      >>> item_similarity_recommender.create(sf, only_top_k=2)
      """
  
      if not (isinstance(observation_data, _SFrame)):
          raise TypeError("observation_data input must be a SFrame")
  
      side_data = (user_data is not None) or (item_data is not None)
      if user_data is not None:
          if not isinstance(user_data, _SFrame):
              raise TypeError("Provided user_data must be an SFrame.")
      if item_data is not None:
          if not isinstance(item_data, _SFrame):
              raise TypeError("Provided item_data must be an SFrame.")
  
      if target is None:
          if ranking:
              if side_data:
                  method = "ranking_factorization_recommender"
              else:
                  method = "item_similarity"
          else:
              if side_data:
                  method = "ranking_factorization_recommender"
              else:
                  method = "item_similarity"
      else:
          if ranking:
              if side_data:
                  method = "ranking_factorization_recommender"
              else:
                  method = "ranking_factorization_recommender"
          else:
              if side_data:
                  method = "factorization_recommender"
              else:
                  method = "factorization_recommender"
  
      opts = {
          "observation_data": observation_data,
          "user_id": user_id,
          "item_id": item_id,
          "target": target,
          "user_data": user_data,
          "item_data": item_data,
      }
  
      if method == "item_similarity":
          return _turicreate.recommender.item_similarity_recommender.create(
              **opts
          )
      elif method == "factorization_recommender":
          return (
              _turicreate.recommender.factorization_recommender.create(
                  **opts
              )
          )
      elif method == "ranking_factorization_recommender":
          return _turicreate.recommender.ranking_factorization_recommender.create(
              **opts
          )
      else:
          raise RuntimeError("Provided method not recognized.")
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import turicreate
  import random
  import array
  import logging
  import time
  import six
  from turicreate.toolkits import _coreml_utils
  from turicreate.toolkits._main import ToolkitError
  from turicreate.toolkits._model import Model
  from turicreate.toolkits._internal_utils import _toolkit_repr_print, _precomputed_field
  import turicreate.aggregate
  from turicreate.data_structures.sarray import SArray
  from turicreate.data_structures.sframe import SFrame
  from turicreate._deps import numpy, HAS_NUMPY
label_desc: Use image node_id 1 for calling a global function with example usage: _create(observation_data, user_id, item_id, target, user_data, item_data, ranking, verbose) and returns: _turicreate, _turicreate, _turicreate