<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_dynamodb_type(self, val):
 """ Take a scalar Python value and return a string representing the corresponding Amazon DynamoDB type. If the value passed in is not a supported type, raise a TypeError. """

        dynamodb_type = None
        if is_num(val):
            dynamodb_type = 'N'
        elif is_str(val):
            dynamodb_type = 'S'
        elif isinstance(val, (set, frozenset)):
            if False not in map(is_num, val):
                dynamodb_type = 'NS'
            elif False not in map(is_str, val):
                dynamodb_type = 'SS'
        if dynamodb_type is None:
            raise TypeError('Unsupported type "%s" for value "%s"' % (type(val), val))
        return dynamodb_type