code: def create_dataset(
      n_rows=1000, extras=False, has_missing=True, random_seed=2001
  ):
      """
      Creates a dataset with some categorical variables.
      """
      random.seed(random_seed)
      ds = [
          [
              random.random(),  # Floats
              random.choice(
                  [
                      float("nan"),
                      float("inf"),
                      float("-inf"),
                      -0,
                      0,
                      1,
                      -1,
                      math.pi,
                  ]
              ),  # Floats with edge scenarios
              row,  # Unique integers
              str(row),  # Unique strings
              random.choice(["A", "B"])
              if extras
              else "A",  # Invariant in the training data
              random.choice(
                  ["A", "B_b", "C_c_c"]
              ),  # Strings with underscores to test reverse_dummies()
              random.choice(["A", "B", "C", np.NaN])
              if has_missing
              else random.choice(["A", "B", "C"]),  # None
              random.choice(["A", "B", "C", "D"])
              if extras
              else random.choice(
                  ["A", "B", "C"]
              ),  # With a new string value
              random.choice(
                  ["A", "B", "C"]
              ),  # What is going to become the categorical column
              random.choice(
                  ["A", "B", "C", np.nan]
              ),  # Categorical with missing values
              random.choice([1, 2, 3]),  # Ordinal integers
          ]
          for row in range(n_rows)
      ]
  
      df = pd.DataFrame(
          ds,
          columns=[
              "float",
              "float_edge",
              "unique_int",
              "unique_str",
              "invariant",
              "underscore",
              "none",
              "extra",
              "categorical",
              "na_categorical",
              "categorical_int",
          ],
      )
      df["categorical"] = pd.Categorical(
          df["categorical"], categories=["A", "B", "C"]
      )
      df["na_categorical"] = pd.Categorical(
          df["na_categorical"], categories=["A", "B", "C"]
      )
      df["categorical_int"] = pd.Categorical(
          df["categorical_int"], categories=[1, 2, 3]
      )
      return df
  
file_path: category_encoders/tests/helpers.py
imports: import numpy
  import random
  import pandas
  import math
label_desc: Use image node_id 3 for calling a global function with example usage: create_dataset(n_rows, extras, has_missing, random_seed) and returns: df