code: def simple_iv_dataset(
      beta,
      num_samples,
      num_treatments=None,
      treatment_is_binary=True,
      outcome_is_binary=False,
  ):
      """Simple instrumental variable dataset with a single IV and a single confounder."""
      W, Z, c1, c2, cz = [None] * 5
      num_instruments = 1
      num_common_causes = 1
  
      beta = np.array(beta, dtype=np.float64, ndmin=1)
      if num_treatments is None:
          num_treatments = beta.size
      else:
          beta = np.resize(beta, num_treatments)
  
      c1 = np.random.uniform(0, 1, (num_common_causes, num_treatments))
      c2 = np.random.uniform(0, 1, num_common_causes)
      range_cz = 1 + np.max(
          np.absolute(beta)
      )  # cz is much higher than c1 and c2
      cz = np.random.uniform(
          range_cz - (range_cz * 0.05),
          range_cz + (range_cz * 0.05),
          (num_instruments, num_treatments),
      )
      W = np.random.uniform(0, 1, (num_samples, num_common_causes))
      Z = np.random.normal(0, 1, (num_samples, num_instruments))
      t = (
          np.random.normal(0, 1, (num_samples, num_treatments))
          + Z @ cz
          + W @ c1
      )
      if treatment_is_binary:
          t = np.vectorize(convert_to_binary)(t)
  
      def _compute_y(t, W, beta, c2):
          y = t @ beta + W @ c2
          return y
  
      y = _compute_y(t, W, beta, c2)
  
      # creating data frame
      data = np.column_stack((Z, W, t, y))
      treatments = [("v" + str(i)) for i in range(0, num_treatments)]
      outcome = "y"
      common_causes = [
          ("W" + str(i)) for i in range(0, num_common_causes)
      ]
      ate = np.mean(
          _compute_y(
              np.ones((num_samples, num_treatments)), W, beta, c2
          )
          - _compute_y(
              np.zeros((num_samples, num_treatments)), W, beta, c2
          )
      )
      instruments = [("Z" + str(i)) for i in range(0, num_instruments)]
      other_variables = None
      col_names = instruments + common_causes + treatments + [outcome]
      data = pd.DataFrame(data, columns=col_names)
  
      # Specifying the correct dtypes
      if treatment_is_binary:
          data = data.astype(
              {tname: "bool" for tname in treatments}, copy=False
          )
      if outcome_is_binary:
          data = data.astype({outcome: "bool"}, copy=False)
  
      # Now specifying the corresponding graph strings
      dot_graph = create_dot_graph(
          treatments, outcome, common_causes, instruments
      )
      # Now writing the gml graph
      gml_graph = create_gml_graph(
          treatments, outcome, common_causes, instruments
      )
      ret_dict = {
          "df": data,
          "treatment_name": treatments,
          "outcome_name": outcome,
          "common_causes_names": common_causes,
          "instrument_names": instruments,
          "effect_modifier_names": None,
          "dot_graph": dot_graph,
          "gml_graph": gml_graph,
          "ate": ate,
      }
      return ret_dict
  
imports: import math
  import string
  import networkx
  import numpy
  import pandas
  import scipy.stats
  from numpy.random import choice
  from scipy.stats import bernoulli, halfnorm, poisson, uniform
  from sklearn.neural_network import MLPRegressor
  from dowhy.utils.graph_operations import add_edge, del_edge, get_random_node_pair, get_simple_ordered_tree
label_desc: Use image node_id 7 for calling a global function with example usage: simple_iv_dataset(beta, num_samples, num_treatments, treatment_is_binary, outcome_is_binary) and returns: ret_dict, y