code: def select_data_from_str_filters(
      df: pd.DataFrame,
      feature_id: list,
      id_str_modality: list,
      val_feature: list,
      val_str_modality: list,
  ) -> pd.DataFrame:
      """Create a subset dataframe from filters.
  
      Parameters
      ----------
      df : pd.DataFrame
          Data to sample
      feature_id : list
          features ids
      id_str_modality : list
          string features ids
      val_feature : list
          features names
      val_str_modality : list
          string modalities selected
  
      Returns
      -------
      pd.DataFrame
          Subset dataframe
      """
      # get list of ID
      str_id = [
          id_str_modality[i]["index"]
          for i in range(len(id_str_modality))
      ]
      # If there is some filters
      if len(str_id) > 0:
          for i in range(len(feature_id)):
              if feature_id[i] in str_id:
                  position = np.where(
                      np.array(str_id) == feature_id[i]
                  )[0][0]
                  if (position is not None) & (
                      val_str_modality[position] is not None
                  ):
                      df = df[
                          df[val_feature[i]].isin(
                              val_str_modality[position]
                          )
                      ]
  
      return df
  
imports: from typing import Optional, Tuple
  import numpy
  import pandas
  import datetime
  from dash import dcc, html
  import dash_bootstrap_components
label_desc: Use image node_id 2 for calling a global function with example usage: select_data_from_str_filters(df, feature_id, id_str_modality, val_feature, val_str_modality) and returns: df