code: def create_array(n_rows=1000, extras=False, has_none=True):
      """
      Creates a numpy dataset with some categorical variables.
      """
      ds = [
          [
              random.random(),
              random.random(),
              random.choice(["A", "B", "C"]),
              random.choice(["A", "B", "C", "D"])
              if extras
              else random.choice(["A", "B", "C"]),
              random.choice(["A", "B", "C", None, np.nan])
              if has_none
              else random.choice(["A", "B", "C"]),
              random.choice(["A"]),
          ]
          for _ in range(n_rows)
      ]
  
      return np.array(ds)
  
file_path: category_encoders/tests/helpers.py
imports: import numpy
  import random
  import pandas
  import math
label_desc: Use image node_id 2 for calling a global function with example usage: create_array(n_rows, extras, has_none) and returns: np