code: def is_boolean(series: pd.Series, counts: dict) -> bool:
      keys = counts["value_counts_without_nan"].keys()
      if pd.api.types.is_bool_dtype(keys):
          return True
      elif (
          1 <= counts["distinct_count_without_nan"] <= 2
          and pd.api.types.is_numeric_dtype(series)
          and series[~series.isnull()].between(0, 1).all()
      ):
          return True
      elif 1 <= counts["distinct_count_without_nan"] <= 4:
          unique_values = set(
              [str(value).lower() for value in keys.values]
          )
          accepted_combinations = [
              ["y", "n"],
              ["yes", "no"],
              ["true", "false"],
              ["t", "f"],
          ]
  
          if len(unique_values) == 2 and any(
              [
                  unique_values == set(bools)
                  for bools in accepted_combinations
              ]
          ):
              return True
      return False
  
file_path: sweetviz/sweetviz/from_profiling_pandas.py
imports: from urllib.parse import urlparse
  from pathlib import Path
  import pandas
  from sweetviz.config import config
label_desc: Use image node_id 1 for calling a global function with example usage: is_boolean(series, counts) and returns: False, True, True, True