def from_response(cls, response):
        """ Create a Table from returned Dynamo data """
        hash_key = None
        range_key = None
        # KeySchema may not be in the response if the TableStatus is DELETING.
        if 'KeySchema' in response:
            attrs = dict(((d['AttributeName'],
                           DynamoKey(d['AttributeName'], d['AttributeType']))
                          for d in response['AttributeDefinitions']))
            hash_key = attrs[response['KeySchema'][0]['AttributeName']]
            if len(response['KeySchema']) > 1:
                range_key = attrs[response['KeySchema'][1]['AttributeName']]

        indexes = []
        for idx in response.get('LocalSecondaryIndexes', []):
            indexes.append(LocalIndex.from_response(idx, attrs))
        global_indexes = []
        for idx in response.get('GlobalSecondaryIndexes', []):
            global_indexes.append(GlobalIndex.from_response(idx, attrs))

        table = cls(
            name=response['TableName'],
            hash_key=hash_key,
            range_key=range_key,
            indexes=indexes,
            global_indexes=global_indexes,
            throughput=Throughput.from_response(
                response['ProvisionedThroughput']),
            status=response['TableStatus'],
            size=response['TableSizeBytes'],
        )
        table.response = response
        return table
Create a Table from returned Dynamo data