code: def get_condition_flag(word_str_ser, condition):
      """
      condition  = None or a function that returns a bool series
      return a bool series where flag is valid
      """
      if condition is None:
          return cudf.Series(cp.ones(len(word_str_ser), bool))
      else:
          return condition(word_str_ser)
  
imports: from .porter_stemmer_utils.measure_utils import has_positive_measure, measure_gt_n, measure_eq_n
  from .porter_stemmer_utils.len_flags_utils import len_eq_n, len_gt_n
  from .porter_stemmer_utils.consonant_vowel_utils import contains_vowel, is_consonant
  from .porter_stemmer_utils.porter_stemmer_rules import ends_with_suffix, ends_with_double_constant, last_char_not_in, last_char_in, ends_cvc
  from .porter_stemmer_utils.suffix_utils import get_stem_series, get_str_replacement_series, replace_suffix
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 2 for calling a global function with example usage: get_condition_flag(word_str_ser, condition) and returns: cudf, condition