code: def generate_random_labeled_dataset(
      n_samples,
      n_features,
      labels,
      features_density=1.0,
      features_dtype=np.float32,
      features_range=(-1.0, 1.0),
      features_order="C",
      seed=20191008,
  ):
      assert features_density > 0.0
  
      random.seed(seed)
  
      features = np.empty(
          (n_samples, n_features),
          dtype=features_dtype,
          order=features_order,
      )
      for feature_idx in range(n_features):
          for sample_idx in range(n_samples):
              v1 = random.random()
              if v1 > features_density:
                  value = 0
              else:
                  value = features_range[0] + (
                      features_range[1] - features_range[0]
                  ) * (v1 / features_density)
              features[sample_idx, feature_idx] = features_dtype(value)
  
      labels = [random.choice(tuple(labels)) for _ in range(n_samples)]
  
      return (features, labels)
  
imports: import collections
  import csv
  import json
  import os
  import random
  import shutil
  import sys
  from pandas import read_csv, DataFrame
  from copy import deepcopy
  import numpy
  from catboost.utils import read_cd
label_desc: Use image node_id 5 for calling a global function with example usage: generate_random_labeled_dataset(n_samples, n_features, labels, features_density, features_dtype, features_range, features_order, seed) and returns: features,  labels