parameters: (self, attr)
return_statement: return {dynamodb_type: encoder(attr)}
docstring: Encodes a python type to the format expected
          by DynamoDB.
docstring_summary: Encodes a python type to the format expected
          by DynamoDB.
docstring_tokens: Encodes a python type to the format expected by DynamoDB .
function: def encode(self, attr):
          """
          Encodes a python type to the format expected
          by DynamoDB.
  
          """
          dynamodb_type = self._get_dynamodb_type(attr)
          try:
              encoder = getattr(self, '_encode_%s' % dynamodb_type.lower())
          except AttributeError:
              raise ValueError("Unable to encode dynamodb type: %s" %
                               dynamodb_type)
          return {dynamodb_type: encoder(attr)}
function_tokens: def encode ( self , attr ) : dynamodb_type = self . _get_dynamodb_type ( attr ) try : encoder = getattr ( self , '_encode_%s' % dynamodb_type . lower ( ) ) except AttributeError : raise ValueError ( "Unable to encode dynamodb type: %s" % dynamodb_type ) return { dynamodb_type : encoder ( attr ) }