code: def build_toy_dataset(
      n_students,
      n_questions,
      n_obs,
      sigma_students=1.0,
      sigma_questions=1.5,
      loc=0.0,
  ):
      student_etas = np.random.normal(
          0.0, sigma_students, size=n_students
      )
      question_etas = np.random.normal(
          0.0, sigma_questions, size=n_questions
      )
  
      student_ids = np.random.choice(range(n_students), n_obs)
      question_ids = np.random.choice(range(n_questions), n_obs)
  
      logits = (
          student_etas[student_ids] + question_etas[question_ids] + loc
      )
      outcomes = np.random.binomial(1, expit(logits), n_obs)
  
      data = pd.DataFrame(
          {
              "question_id": question_ids,
              "student_id": student_ids,
              "outcomes": outcomes,
          }
      )
  
      return data, student_etas, question_etas
  
file_path: edward/examples/irt.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import edward
  import matplotlib.pyplot
  import numpy
  import pandas
  import tensorflow
  from edward.models import Normal, Bernoulli
  from scipy.special import expit
label_desc: Use image node_id 1 for calling a global function with example usage: build_toy_dataset(n_students, n_questions, n_obs, sigma_students, sigma_questions, loc) and returns: data,  student_etas,  question_etas