def pformat(self, consumed_capacity=None):
        """ Pretty format for insertion into table pformat """
        consumed_capacity = consumed_capacity or {}
        lines = []
        parts = ["GLOBAL", self.index_type, "INDEX", self.name]
        if self.status != "ACTIVE":
            parts.insert(0, "[%s]" % self.status)
        lines.append(" ".join(parts))
        lines.append("  items: {0:,} ({1:,} bytes)".format(self.item_count, self.size))
        read = "Read: " + format_throughput(
            self.read_throughput, consumed_capacity.get("read")
        )
        write = "Write: " + format_throughput(
            self.write_throughput, consumed_capacity.get("write")
        )
        lines.append("  " + read + "  " + write)
        lines.append("  " + self.hash_key.schema)
        if self.range_key is not None:
            lines.append("  " + self.range_key.schema)

        if self.includes is not None:
            keys = "[%s]" % ", ".join(("'%s'" % i for i in self.includes))
            lines.append("  Projection: %s" % keys)
        return "\n".join(lines)
def pformat ( self , consumed_capacity = None ) : consumed_capacity = consumed_capacity or { } lines = [ ] parts = [ "GLOBAL" , self . index_type , "INDEX" , self . name ] if self . status != "ACTIVE" : parts . insert ( 0 , "[%s]" % self . status ) lines . append ( " " . join ( parts ) ) lines . append ( "  items: {0:,} ({1:,} bytes)" . format ( self . item_count , self . size ) ) read = "Read: " + format_throughput ( self . read_throughput , consumed_capacity . get ( "read" ) ) write = "Write: " + format_throughput ( self . write_throughput , consumed_capacity . get ( "write" ) ) lines . append ( "  " + read + "  " + write ) lines . append ( "  " + self . hash_key . schema ) if self . range_key is not None : lines . append ( "  " + self . range_key . schema ) if self . includes is not None : keys = "[%s]" % ", " . join ( ( "'%s'" % i for i in self . includes ) ) lines . append ( "  Projection: %s" % keys ) return "\n" . join ( lines )
Pretty format for insertion into table pformat