code: def _get_bucket_statistics(self, bucket_name, bucket_region, storage_type, statistic, days):
          
  
          cw = self.session.client('cloudwatch', region_name=bucket_region)
  
          # gather cw stats
  
          try:
              obj_stats = cw.get_metric_statistics(
                  Namespace='AWS/S3',
                  MetricName=statistic,
                  Dimensions=[
                      {
                          'Name': 'StorageType',
                          'Value': storage_type
                      },
                      {
                          'Name': 'BucketName',
                          'Value': bucket_name
                      }
                  ],
                  Period=86400,
                  StartTime=datetime.utcnow() - timedelta(days=days),
                  EndTime=datetime.utcnow(),
                  Statistics=[
                      'Average'
                  ]
              )
              stat_value = obj_stats['Datapoints'][0]['Average'] if obj_stats['Datapoints'] else 'NO_DATA'
  
              return stat_value
  
          except Exception as e:
              self.log.error(
                  'Could not get bucket statistic for account {} / bucket {} / {}'.format(self.account.account_name,
                                                                                          bucket_name, e))
  
          finally:
              del cw
docs: Returns datapoints from cloudwatch for bucket statistics.
  
          Args:
              bucket_name `(str)`: The name of the bucket
              statistic `(str)`: The statistic you want to fetch from
              days `(int)`: Sample period for the statistic