code: def get_partition_count(context, default=0):
      
      if not is_ar(context):
          return default
  
      parent = context.getParentAnalysisRequest()
  
      if not parent:
          return default
  
      return len(parent.getDescendants())
docs: Returns the number of partitions of this AR