code: def has_categorical(X: np.ndarray) -> bool:
      """Checks if any of the given columns are categorical, i.e. either a string or a boolean. If any of the columns
      is categorical, this method will return True. Alternatively, consider is_categorical for checking if all columns are
      categorical.
  
      Note: A np matrix with mixed data types might internally convert numeric columns to strings and vice versa. To
      ensure that the given given data keeps the original data type, consider converting/initializing it with the dtype
      'object'. For instance: np.array([[1, 'True', '0', 0.2], [3, 'False', '1', 2.3]], dtype=object)
  
      :param X: Input array to check if all columns are categorical.
      :return: True if all columns of the input are categorical, False otherwise.
      """
      X = shape_into_2d(X)
  
      for column in range(X.shape[1]):
          if is_categorical(X[:, column]):
              return True
  
      return False
  
imports: import random
  from typing import Dict, Optional, Union
  import numpy
  from scipy.optimize import minimize
  from sklearn.preprocessing import OneHotEncoder
  from dowhy.gcm.util.catboost_encoder import CatBoostEncoder
label_desc: Use image node_id 10 for calling a global function with example usage: has_categorical(X) and returns: False, True