def get_capacity(self, tablename, index_name=None):
        """ Get the consumed read/write capacity """
        # If we're connected to a DynamoDB Local instance, don't connect to the
        # actual cloudwatch endpoint
        if self.connection.region == "local":
            return 0, 0
        # Gracefully fail if we get exceptions from CloudWatch
        try:
            return (
                self._get_metric("ConsumedReadCapacityUnits", tablename, index_name),
                self._get_metric("ConsumedWriteCapacityUnits", tablename, index_name),
            )
        except ClientError:
            return 0, 0
def get_capacity ( self , tablename , index_name = None ) : if self . connection . region == "local" : return 0 , 0 try : return ( self . _get_metric ( "ConsumedReadCapacityUnits" , tablename , index_name ) , self . _get_metric ( "ConsumedWriteCapacityUnits" , tablename , index_name ) , ) except ClientError : return 0 , 0
Get the consumed read/write capacity