code: def property_available_if(check):
      """A property attribute that is available only if check returns a truthy value.
  
      Only supports getting an attribute value, setting or deleting an attribute value are not supported.
  
      Parameters
      ----------
      check : callable
          When passed the object of the decorated method, this should return
          `True` if the property attribute is available, and either return `False`
          or raise an `AttributeError` if not available.
  
      Returns
      -------
      callable
          Callable makes the decorated property available if `check` returns
          `True`, otherwise the decorated property is unavailable.
      """
      return lambda fn: _PropertyAvailableIfDescriptor(
          check=check, fget=fn
      )
  
file_path: scikit-survival/sksurv/util.py
imports: import numpy
  import pandas
  from pandas.api.types import CategoricalDtype
  from sklearn.utils import check_array, check_consistent_length
label_desc: Use image node_id 4 for calling a global function with example usage: property_available_if(check) and returns: function