code: def generate_data(m, n, task="logistic_regression"):
      if task == "logistic_regression":
          X = torch.randn(m, n).to(torch.double)
          w_0 = (torch.randn(n, 1)).to(torch.double)
          y = torch.rand(m, 1).to(torch.double) < 1 / (
              1 + torch.exp(X.mm(w_0))
          )
          y = y.double()
          y = 2 * y - 1
      elif task == "linear_regression":
          X = torch.randn(m, n).to(torch.double)
          x_o = torch.randn(n, 1).to(torch.double)
          ns = 0.1 * torch.randn(m, 1).to(torch.double)
          y = X.mm(x_o) + ns
      else:
          raise NotImplementedError(
              "Task not supported. This example only supports"
              + " linear_regression and logistic_regression"
          )
  
      return X, y
  
file_path: bluefog/examples/pytorch_optimization.py
imports: import os
  import torch
  import matplotlib
  import matplotlib.pyplot
  import argparse
  import bluefog.torch
  from bluefog.common import topology_util
  import networkx
label_desc: Use image node_id 2 for calling a global function with example usage: generate_data(m, n, task) and returns: X,  y