code: def is_versionable(brain_or_object, policy='at_edit_autoversion'):
      
      pr = get_tool("portal_repository")
      obj = get_object(brain_or_object)
      return pr.supportsPolicy(obj, 'at_edit_autoversion') \
          and pr.isVersionable(obj)
docs: Checks if the passed in object is versionable.
  
      :param brain_or_object: A single catalog brain or content object
      :type brain_or_object: ATContentType/DexterityContentType/CatalogBrain
      :returns: True if the object is versionable
      :rtype: bool