code: def make_california_housing_data(num_examples=None, test_size=0.2):
      """
      Create train/test featuresets from the California housing dataset.
  
      All columns are standardized into z-scores before creating the
      two feature sets.
  
      Parameters
      ----------
      num_examples : int, optional
          Number of total examples to use. 80% of these examples
          will be in the training set and the remaining 20% in
          the test set. If ``None``, it will use all of the
          examples in the dataset.
          Defaults to ``None``.
      test_size : float, optional
          Fraction of ``num_examples`` to use for the test
          featureset. Should be between 0 and 1. If this is 0,
          the training featureset will contain all of the
          examples and the test featureset will be ``None``.
          Defaults to 0.2.
  
      Returns
      -------
      fs_tuple : tuple
          A 2-tuple containing the created train and test featuresets.
          The test featureset will be ``None`` if ``test_size`` is 0.
  
      Raises
      ------
      ValueError
          If ``num_examples`` is greater than the number of available
          examples.
      """
      # load the housing data
      housing = fetch_california_housing(
          data_home=str(other_dir),
          download_if_missing=False,
          as_frame=True,
      )
      df_housing = housing.frame
  
      # standardize all of the values to get them on the same scale
      df_housing = (df_housing - df_housing.mean()) / df_housing.std()
  
      # use all examples if ``num_examples`` was ``None``
      num_examples = (
          len(df_housing) if num_examples is None else num_examples
      )
  
      # raise an exception if the number of desired examples is greater
      # than the number of available examples in the data
      if num_examples > len(df_housing):
          raise ValueError(
              f"invalid value {num_examples} for 'num_examples', "
              f"only {len(df_housing)} examples are available."
          )
  
      # select the desired number of examples
      row_indices = np.arange(len(df_housing))
      prng = np.random.default_rng(123456789)
      if num_examples < len(df_housing):
          chosen_row_indices = prng.choice(
              row_indices,
              size=num_examples,
              replace=False,
              shuffle=False,
          )
      else:
          chosen_row_indices = row_indices
  
      # now split the chosen indices into train and test indices
      # assuming ``test_size`` > 0
      if test_size > 0:
          splitter = ShuffleSplit(
              n_splits=1, test_size=test_size, random_state=123456789
          )
          train_indices, test_indices = list(
              splitter.split(chosen_row_indices)
          )[0]
      else:
          train_indices = chosen_row_indices
          test_indices = np.array([])
  
      # now subset the training and test rows from the data frame
      df_train = df_housing.iloc[train_indices].copy()
      df_test = df_housing.iloc[test_indices].copy()
  
      # now create the train and test feature sets from the data frames
      train_fs = FeatureSet.from_data_frame(
          df_train, "housing_train", labels_column="MedHouseVal"
      )
      if len(df_test) > 0:
          test_fs = FeatureSet.from_data_frame(
              df_test,
              "housing_test",
              labels_column="MedHouseVal",
              vectorizer=train_fs.vectorizer,
          )
      else:
          test_fs = None
  
      return train_fs, test_fs
  
imports: import os
  import re
  from collections import OrderedDict
  from math import floor, log10
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple
  import numpy
  from numpy.random import RandomState
  from sklearn.datasets import fetch_california_housing, load_digits, make_classification, make_regression
  from sklearn.feature_extraction import FeatureHasher
  from sklearn.model_selection import KFold, ShuffleSplit, StratifiedKFold
  from sklearn.utils import shuffle
  from skll.config import _setup_config_parser, fix_json
  from skll.data import FeatureSet, NDJWriter
  from skll.types import PathOrStr
label_desc: Use image node_id 13 for calling a global function with example usage: make_california_housing_data(num_examples, test_size) and returns: train_fs,  test_fs