def item_object_hook(dct):
 if (len(dct.keys()) > 1):
  return dct
 if ('S' in dct):
  return dct['S']
 if ('N' in dct):
  return convert_num(dct['N'])
 if ('SS' in dct):
  return set(dct['SS'])
 if ('NS' in dct):
  return set(map(convert_num, dct['NS']))
 if ('B' in dct):
  return convert_binary(dct['B'])
 if ('BS' in dct):
  return set(map(convert_binary, dct['BS']))
 return dct

def item_object_hook ( dct ) : if ( len ( dct . keys ( ) ) > 1 ) : return dct if ( 'S' in dct ) : return dct [ 'S' ] if ( 'N' in dct ) : return convert_num ( dct [ 'N' ] ) if ( 'SS' in dct ) : return set ( dct [ 'SS' ] ) if ( 'NS' in dct ) : return set ( map ( convert_num , dct [ 'NS' ] ) ) if ( 'B' in dct ) : return convert_binary ( dct [ 'B' ] ) if ( 'BS' in dct ) : return set ( map ( convert_binary , dct [ 'BS' ] ) ) return dct
a custom object hook for use when decoding json item bodys .