code: def _feature_list_to_numpy_arrays(
      feature_list0: List[np.ndarray],
      feature_list1: List[np.ndarray],
      is_categorical_list0: List[bool],
      is_categorical_list1: List[bool],
      weight_feature: Optional[np.ndarray],
      filter_feature: Optional[np.ndarray],
  ) -> Tuple[
      List[np.ndarray],
      List[np.ndarray],
      List[np.ndarray],
      List[np.ndarray],
      np.ndarray,
  ]:
      """Converts feature lists into np.ndarray lists for MI computation."""
      n_samples = len(feature_list0[0])
  
      if weight_feature is None:  # the default weight is constant 1
          weights = np.ones(n_samples).astype(float)
      else:
          weights = weight_feature.astype(float)
  
      # We will handle ordinal and categorical features differently.
      def select_features(feature_list, is_categorical_list, keep_fn):
          return [
              _fill_missing_values(f, is_categorical)
              for f, is_categorical in zip(
                  feature_list, is_categorical_list
              )
              if keep_fn(is_categorical)
          ]
  
      # Select ordinal features and categorical features.
      cf_list0 = select_features(
          feature_list0, is_categorical_list0, lambda a: not a
      )
      cf_list1 = select_features(
          feature_list1, is_categorical_list1, lambda a: not a
      )
      df_list0 = select_features(
          feature_list0, is_categorical_list0, lambda a: a
      )
      df_list1 = select_features(
          feature_list1, is_categorical_list1, lambda a: a
      )
  
      # Ignore those samples whose the filter_feature is missing.
      if filter_feature is not None:
          cf_list0 = [f[filter_feature] for f in cf_list0]
          df_list0 = [f[filter_feature] for f in df_list0]
          cf_list1 = [f[filter_feature] for f in cf_list1]
          df_list1 = [f[filter_feature] for f in df_list1]
          weights = weights[filter_feature]
      return cf_list0, cf_list1, df_list0, df_list1, weights
  
imports: import functools
  import itertools
  import math
  from typing import Any, List, Optional, Tuple, Union
  import uuid
  import numpy
  import pandas
  import scipy.special
  import sklearn.neighbors
label_desc: Use image node_id 13 for calling a global function with example usage: _feature_list_to_numpy_arrays(feature_list0, feature_list1, is_categorical_list0, is_categorical_list1, weight_feature, filter_feature) and returns: cf_list0,  cf_list1,  df_list0,  df_list1,  weights, unknown