Get the k most similar users for each entry in `users`.

        Each type of recommender has its own model for the similarity
        between users. For example, the factorization_recommender will
        return the nearest users based on the cosine similarity
        between latent user factors.  (This method is not currently
        available for item_similarity models.)

        Parameters
        ----------
        users : SArray or list; optional
            An :class:`~turicreate.SArray` or list of user ids for which to get
            similar users. If 'None', then return the `k` most similar users for
            all users in the training set.

        k : int, optional
            The number of neighbors to return for each user.

        Returns
        -------
        out : SFrame
            A SFrame with the top ranked similar users for each user. The
            columns `user`, 'similar', 'score' and 'rank', where
            `user` matches the user column name specified at training time.
            The 'rank' is between 1 and `k` and 'score' gives the similarity
            score of that user. The value of the score depends on the method
            used for computing user similarities.

        Examples
        --------

        >>> 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.factorization_recommender.create(sf)
        >>> nn = m.get_similar_users()

def get_similar_users(self, users=None, k=10):
        """Get the k most similar users for each entry in `users`.

        Each type of recommender has its own model for the similarity
        between users. For example, the factorization_recommender will
        return the nearest users based on the cosine similarity
        between latent user factors.  (This method is not currently
        available for item_similarity models.)

        Parameters
        ----------
        users : SArray or list; optional
            An :class:`~turicreate.SArray` or list of user ids for which to get
            similar users. If 'None', then return the `k` most similar users for
            all users in the training set.

        k : int, optional
            The number of neighbors to return for each user.

        Returns
        -------
        out : SFrame
            A SFrame with the top ranked similar users for each user. The
            columns `user`, 'similar', 'score' and 'rank', where
            `user` matches the user column name specified at training time.
            The 'rank' is between 1 and `k` and 'score' gives the similarity
            score of that user. The value of the score depends on the method
            used for computing user similarities.

        Examples
        --------

        >>> 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.factorization_recommender.create(sf)
        >>> nn = m.get_similar_users()

        """

        if users is None:
            get_all_users = True
            users = _SArray()
        else:
            get_all_users = False

        if isinstance(users, list):
            users = _SArray(users)

        def check_type(arg, arg_name, required_type, allowed_types):
            if not isinstance(arg, required_type):
                raise TypeError("Parameter " + arg_name + " must be of type(s) "
                                + (", ".join(allowed_types) )
                                + "; Type '" + str(type(arg)) + "' not recognized.")

        check_type(users, "users", _SArray, ["SArray", "list"])
        check_type(k, "k", int, ["int"])

        opt = {'model': self.__proxy__,
               'users': users,
               'get_all_users' : get_all_users,
               'k': k}

        response = self.__proxy__.get_similar_users(users, k, get_all_users)
        return response