code: def plot_regressions(
      ksi,
      eta,
      x,
      y,
      sigma_x,
      sigma_y,
      add_regression_lines=False,
      alpha_in=1,
      beta_in=0.5,
      basis="linear",
  ):
      figure = plt.figure(figsize=(8, 6))
      ax = figure.add_subplot(111)
      ax.scatter(x, y, alpha=0.5)
      ax.errorbar(x, y, xerr=sigma_x, yerr=sigma_y, alpha=0.3, ls="")
      ax.set_xlabel("x")
      ax.set_ylabel("y")
  
      x0 = np.linspace(np.min(x) - 0.5, np.max(x) + 0.5, 20)
  
      # True regression line
  
      if alpha_in is not None and beta_in is not None:
          if basis == "linear":
              y0 = alpha_in + x0 * beta_in
          elif basis == "poly":
              y0 = (
                  alpha_in
                  + beta_in[0] * x0
                  + beta_in[1] * x0 * x0
                  + beta_in[2] * x0 * x0 * x0
              )
  
          ax.plot(x0, y0, color="black", label="True regression")
      else:
          y0 = None
  
      if add_regression_lines:
          for label, data, *target in [
              ["fit no errors", x, y, 1],
              ["fit y errors only", x, y, sigma_y],
              ["fit x errors only", y, x, sigma_x],
          ]:
              linreg = LinearRegression()
              linreg.fit(data[:, None], *target)
              if label == "fit x errors only" and y0 is not None:
                  x_fit = linreg.predict(y0[:, None])
                  ax.plot(x_fit, y0, label=label)
              else:
                  y_fit = linreg.predict(x0[:, None])
                  ax.plot(x0, y_fit, label=label)
  
          # TLS
          X = np.vstack((x, y)).T
          dX = np.zeros((len(x), 2, 2))
          dX[:, 0, 0] = sigma_x
          dX[:, 1, 1] = sigma_y
  
          def min_func(beta):
              return -TLS_logL(beta, X, dX)
  
          beta_fit = optimize.fmin(min_func, x0=[-1, 1])
          m_fit, b_fit = get_m_b(beta_fit)
          x_fit = np.linspace(-10, 10, 20)
          ax.plot(x_fit, m_fit * x_fit + b_fit, label="TLS")
  
      ax.set_xlim(np.min(x) - 0.5, np.max(x) + 0.5)
      ax.set_ylim(np.min(y) - 0.5, np.max(y) + 0.5)
      ax.legend()
  
imports: import numpy
  import matplotlib.pyplot
  from scipy import optimize
  from astroML.linear_model import TLS_logL, LinearRegression
label_desc: Use image node_id 2 for calling a global function with example usage: plot_regressions(ksi, eta, x, y, sigma_x, sigma_y, add_regression_lines, alpha_in, beta_in, basis) and returns: unknown